Google Charts Image. Data graph line is not according to axis - graph

I am using Google Chart Image to make graphical chart. I am using PHP to provide the data to the link which in return gives me desired chart. The x-axis and y-axis values are also dynamic i.e. if the graph data is 23,45,37,29... then the y-axis value will range from 20 to 50 and if it is more then that then it will scale according to the data..
Now the problem I am not able to solve is that the dynamic values work fine but I am not able to move the graph line. The image below will clear this point:
Click here for the graph image.
The data provided to this graph is = 190.12,185.53,186.22,186.71,185.87,185.57,186.50,186.58,190.71,191.41,190.12185
The data range is approx between 180 to 190 but graph drawn is between 198 and 200.
I have used chxr to scale the axis. and the link which I am dynamically updating through php is:
THIS

I believe the problem you've got is that you're scaling the axis labels, but not the axis itself. You want to change the chds parameter from a to the range you're dealing with.
This chart looks okay to me.

Related

I need to remove labels with 0 value [LibreOffice Calc]

I am creating a very basic dashboard in libreoffice Calc. Right now I am trying to create some piecharts and bar charts. I am facing similar problem with both this type of charts.
Piecharts: I have ALL the labels to the right of the chart, even if those labels have an actual value of 0. I want labels with 0 value not to be displayed.
Bar charts: Similar to Piecharts, I want the chart not to display those X values with 0.
I am using LibreOffice Calc 6.4.7.2
If anyone can help me.
Just filter the source data table
If you want to see the entire data table, you can put the filtering result in another place and build a diagram based on this trimmed data.

How to specify axis range without modifying dataset scale?

I would like to know how to set the axis range and achieve the same behavior that Google Image Charts had. Here is the example for the same request URL:
I.e., I have an y value on each 100th of x axis. Is there a way to easily define a dataset 'step' for Image Charts, or I have to create custom labels on x axis with chxl, which I would like to avoid?
Image-Charts founder here :)
Indeed, regarding axis range our documentation is (I hope) explicit:
In Google Image Charts specifying the chxr parameter changed the scale of the axis but not the dataset scale. In Image-Charts — because we think it's was the biggest usage issue with Google Image Charts — changing the axis scale through chxr also impact the whole dataset scale.
You must make an axis visible using the chxt parameter if you want to specify its range.
You will have to use axis range (chxr) to better specify what you want and the steps needed:
chxr=
<axis_index>,<start_val>,<end_val>,<opt_step>
|...|
<axis_index>,<start_val>,<end_val>,<opt_step>

Google image-charts x-axis lable not responding to the chxl attribute

I am trying to implement a chart into my website using image-charts, but no matter how I set the x-axis, the labels never works out the way I want it to be.
I read through their documentation, where it says that I can use chxl=<axis_index>:|<label_1>|...|<label_n> to set custome axis labels. I tried using chxl=0:|0|5|10|15|20|25|30|35|40|45|50|55|60 to label my x-axis, from 0 to 60 with the interval of 5, but it is incrementing by the interval of 10.
This is my graph: https://image-charts.com/chart?cht=lxy&chs=999x480&chd=t:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60|660,570,520,615,492,510,523,495,500,510,562,570,572,531,544,551,568,567,584,570,560,545,537,543,521,517,522,512,519,516,511,519,529,528,533,525,519,531,529,524,524,524,522,518,520,530,518,524,517,512,515,505,507,509,514,505,506,503,502,504,504|0,5,10,15,20,25,30,35,40,45,50,60|0,492,528,612,648,324,492,636,456,492,444,528,396&chco=ffbc8a,407bcb&chg=1,50&chxt=x,y&chls=3|3&chdl=Overall|Last%205%20seconds&chdlp=t&chxl=0:|0|5|10|15|20|25|30|35|40|45|50|55|60
As you can see from the last line of the url, I have chxl=0:|0|5|10|15|20|25|30|35|40|45|50|55|60, but if you click on the link and look at the image, the labels for the x-axis is incrementing by 10. I also tried changing the attribute to other values, but the labels always stay as 0 10 20 30 40 50 60.
Disclaimer: I'm Image-Charts founder.
Image-Charts.com was created in 2016 to be as close as possible as the now soon to be shutdown Google Image Charts API.
Here is our documentation regarding axis labels. Please use our documentation instead of the one from Google Image Charts.
Axis labels will be automatically skipped if they can't be displayed on screen.

Why is the axis label in R graphics dependent on the output picture size

I want to create figures that perfectly match the requirements of certain journals. They usually ask for a axis label between 6-8 points.
So far, I used the following commands within the png() command:
pointsize=1,width=8,height=6, units="cm", res=300
and within parameters par():
cex.axis=6,cex.lab=8, cex=1
My axis commands look like that:
axis(2,at=seq(0.7,1.1,0.1),labels=seq(0.7,1.1,0.1),
lwd=1.5,lwd.ticks=1.5,las=1,cex.axis=6)
The issue is the following:
When I create a smaller picture (like 4x6 cm) this set of commands works perfectly fine, e.g. I obtain a picture with an axis label in 6 points.
However, when I create bigger pictures like (16x9 cm) the axis labels are printed smaller than 6 points, which is super annoying. I do not have a clue what's happening.
Any Ideas? Thanks a lot

ASP.NET charts trend line

I have basic bar charts showing some value (1 value per chart) on each day. The charts are rendered using standard MS ASP.NET charts.
Now I would like to add a trend line. Has somebody done such thing and would be so kind to give me some hints how to approach this task? I know how to add a line to the chart, just would like to know whether someone already did such thing.
If I have understood the question correctly, you want to show a line graph using the same values that each bar is drawn.
You can do this by adding one more series with chart type as line to the same chart area.
Make the Y-axis for the series as secondary and keep X-axis as primary (to keep same X-axis values for both Bar & line graph). Or you can also make X-Axis of this new series as Secondary (this will show labels on top of chart area) .

Resources