0
votes

This is my chart:

http://chart.apis.google.com/chart?chxr=0,-20,20&chxs=0,676767,11.5,0.5,l,676767&chxt=y&chbh=23,1&chs=300x150&cht=bvg&chco=C35A21,99877D&chds=-20,20,-20,20&chd=t:-12.8,11,-10.4,-0.7,-0.3|-11.7,13.6,-6.9,0.4,-1.2&chg=20,-1,0,0

You'll notice how 0 is in the middle (which is correct) and that it ranges from -20 to 20 (which is also correct).

I need the number spacing to be in increments of 5 instead of 10. It needs to read -20 -15 -10 -5 0 5 10 15 20

Does anyone know how I can accomplish this? I tried messing with CHXR property and it was adjusting the number spacing but moving the 0 away from the middle and screwing everything up.

1

1 Answers

2
votes

Like this?

http://chart.apis.google.com/chart?chxr=0,-20,20,5&chxs=0,676767,11.5,0.5,l,676767&chxt=y&chbh=23,1&chs=300x150&cht=bvg&chco=C35A21,99877D&chds=-20,20,-20,20&chd=t:-12.8,11,-10.4,-0.7,-0.3|-11.7,13.6,-6.9,0.4,-1.2&chg=20,-1,0,0

Axis Range chxr

You can specify the range of values that appear on each axis independently, using the chxr parameter. Note that this does not change the scale of the chart elements, only the scale of the axis labels. If you want to make the axis numbers describe the actual data values, set and to the lower and upper values of your data format range, respectively. See Axis Scaling for more information.

You must make an axis visible using the chxt parameter if you want to specify its range.

To specify custom axis values, use the chxl parameter.

Syntax

Separate multiple axis label ranges using the pipe character ( | ).

chxr=
,,, |...| ,,,

Which axis to apply the labels to. This is a zero-based index into the axis array specified by chxt. For example, the r-axis would be 1 in chxt=x,r,y. A number, defining the low value for this axis. A number, defining the high value for this axis. [Optional] The count step between ticks on the axis. There is no default step value; the step is calculated to try to show a set of nicely spaced labels.

http://code.google.com/apis/chart/docs/gallery/bar_charts.html#axis_range