Problem with Google Chart - charts

I'm developing an application which draws some charts and I'm using Google Chart. After I have all the needed data I build the URL dinamically. The problem is that Google Chart doesn't always fix the maximum and minimum of the chart to the values I provide. I calculate Max and Min Values based on the data of the cart. I've set them to be always an integer to avoid any problem.
I'm going to set an example with numbers:
(I write it in different lines with "comments (//)" so it can be read easily, though it is in the same line with any comment at all)
http://chart.apis.google.com/chart?
cht=bvs& //chart type
chs=250x250& //chart size
chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44& //chart data
chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF& //chart colors
chds=-59,80& //data scaling
chf=bg,s,edf5ff|c,s,f6e426& //chart fill color
chtt=my_title& //chart title
chdl=A|B|C|D|E& //chart legend
chdlp=r& //legend position
chxt=x,y& //chart axis
chxl=0:|Col_1|Col_2& //Axis labels
chxr=1,-59,80& //Axis range
chbh=r,1,0& //Bar thickness and spacing
chg=0,12.5 //Grid Lines
with this configuration I'd get this chart. As you can see the zero line is over zero because data has not been scaled isn a good way.
but If I change the maximum and minumum of the chart to -60,80 I get it in a good way
It would be this code:
http://chart.apis.google.com/chart?
cht=bvs& //chart type
chs=250x250& //chart size
chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44& //chart data
chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF& //chart colors
chds=-60,80& //data scaling (CHANGE IN THIS LINE)
chf=bg,s,edf5ff|c,s,f6e426& //chart fill color
chtt=my_title& //chart title
chdl=A|B|C|D|E& //chart legend
chdlp=r& //legend position
chxt=x,y& //chart axis
chxl=0:|Col_1|Col_2& //Axis labels
chxr=1,-60,80& //Axis range (CHANGE IN THIS LINE)
chbh=r,1,0& //Bar thickness and spacing
chg=0,12.5 //Grid Lines
And this chart which seems to be OK:
Can anyone tell me why Google Chart behaves in this way?
Thanks

I changed itsetI get the max and min values to a number which corresponds to the common divisions in a logarithmic scale. I mean:
if value is inside (0,10) I choose an integer value
if value is inside (10,100) I choose 10,20,30...1000
if value is inside (100,1000) I choose 100,200,300...10000
and so on.
With these values Google Chart seems to work.

Related

FusionCharts column_2D chart

How to set the y-axis interval, or 'tick mark?' with a min value of 0 and max value of 9, I'm seeing tick marks every '2', like 0,2,4,6,8,10. I don't want that.. I want y-axis lines every .25
Funny, in fusion charts I can set the background color of the yaxis labels, put a dashed border around the background, even control the space size between the dashes.. but I can't set something important like the tick mark interval
FusionCharts supports 'numDivLines' that allows you to specify the number of divisions on the y-axis. The number of lines required for the chart can be calculated using min and max values. Set 'adjustDiv' to 0. This will force fusioncharts to use the user-defined 'numDivLines'.
JS-Fiddle: https://jsfiddle.net/spranali/yvmq0ab1/44/
adjustDiv: 0,
numDivLines: 35,
yAxisMinValue: 0,
yAxisMaxValue: 9,
The height of the chart has to be scaled to occupy the specified y-axis intervals.

Highstock charts - Show the blank space up to the current date

Currently, I'm having trouble to force the highstock chart to display a blank space up to the current date. It focuses the data I give it.
What I have is:
What I want is something like this
As you can see I want the data to stop at the date of the latest data point and then the graph should show a blank space and stop at the current date. Obv there is not data points for those times
You can control how empty points, and missing points are shown by looking at:
xAxis.ordinal
In an ordinal axis, the points are equally spaced in the chart regardless of the actual time or x distance between them. This means that missing data periods (e.g. nights or weekends for a stock chart) will not take up space in the chart. Having ordinal: false will show any gaps created by the gapSize setting proportionate to their duration.
xAxis.max
The maximum value of the axis. If null, the max value is automatically calculated.
plotOptions.series.connectNulls
Whether to connect a graph line across null points, or render a gap between the two points on either side of the null.
Which means that for your graph, you will want to set:
xAxis: {
ordinal: false,
max: (new Date()).getTime() //to set the current date and time as a maximum
}

How to add legend for color saturation distribution into power bi Filled Map chart

i have a power bi report "Filled Map" chart, where Location = "Cedent Country", and Color Saturation = "Percentage Brokerage Over Premium".
Percentage Brokerage Over Premium = Percentage Brokerage Over Premium = IFERROR(Round(SUM('Production ReportV20-V1 Power B'[Total Brokerage])/SUM('Production ReportV20-V1 Power B'[Cedent Premium]),2),0)
In Format --> Data Colors i configured color saturation as below:
Minimum: Red
Center: Orange
Maximum: Green
I need to show in the chart Legend to display color distribution (Minimum: red, Center: Orange, Maximum: Green), but i couldn't find the option any where.
I created another field Description = IF([Percentage Brokerage Over Premium]<0.1,"Low",IF([Percentage Brokerage Over Premium]>0.25,"High","Medium")) and tried to drag it into Legend field section however nothing happened.
appreciate your assistance.
Best regards,
The Legend field only accepts a column, not measures as input. Therefore nothing will happen if you drag the measure to the field.
The reason why it only accepts a column is because it doesn't serve the purpose as what you mean for legend (i.e. concise explanation of the symbols used in a chart, diagram, drawing, map, table, etc.) [1]
Rather, it's for further slicing/breakdown of the data that you are interested in (e.g. Premium type/LOB, etc).
So my suggestion is that you can simply add a text box to type the legend (i.e. High: red, Medium: orange, Low: green); or better you can add an image with the diverging color and description to the report, like below.
Select chart and Visualizations -> select format tab
1) Select Data Colors
2) select conditional formatting on Default color near right side icon
3) Select Minimum and Maximum color

Aligning BIRT charts regardless of the legend size

I have created a BIRT report with multiple charts.
All the charts include different data but for the same time span.
So i want to make the x axis of the charts align with each other so it is easy to read all the charts at once.
But the series names of these charts are different from each other.And some charts gets dynamic series names in which the length cannot be predicted.
Even though i align the charts with same width and height because of the series names the legend gets too lengthy and the alignment gets ruined.
According to the requirements given to me legend should be placed at the right side of the chart.
Is there a way to fix the size of the legend without truncating the series names.May be a way to wrap the series names so the size of the legend will be same for all the charts and the charts will be aligned nicely.
From your Eclipse designer:
Edit charts -> Format charts -> Legend -> Layout -> Wrapping width
Set a wrapping width value as expected, for example try 60.
You might also have to increase the bottom inset of legend entries to avoid overlapping:
Edit charts -> Format charts -> Legend -> Entries -> Bottom inset
From your Eclipse designer: set Format Chart->Legend->Entries->Ellipsis property to possible max length of your dynamic legends. and the problem will be solved.
As this property work as follows:
The default value is "1". Int attribute "Ellipsis" specifies the behavior of shortening the legend item's text with ellipsis if there is not enough space to display the whole text. Value 0 indicates that the feature is disabled, and the legend item will either be displayed with whole text or be dropped. A positive value n represents the minimal count of characters to be displayed before the ellipsis, which means the legend item will either be dropped or be displayed with at least n characters.
Hope this will solve your problem. It worked for me.

libre office calc: Changing the interval that labels display at

I have a 2 column spreadsheet. The first column is a label, the second is a value. I want to make a chart that displays every single label on the y axis but by default calc displays the labels at intervals, like every 5th one. How can I change this?
You can modify the axis when in chart edit mode. To do so:
Double-click on the chart; after this, there's a light grey border around the chart, telling you that you've activeted chart edit mode:
Open Menu "Format" -> "Axis..." -> "X Axis" (or Y axis, depending o the layout of your chart):
In the Axis Format window, select the "Label" tab:
Set the label formatting as desired. The optimal format settings depend on the labels. If they aren't too long, staggering the labels may help. If they don't fit even staggered, then you could modify the text direction, e.g. settiing it to 45 degrees.