0
votes

I am using google line chart API but It seems like it does not render correctly when there is only one single data. Here's the URL. My value should be at X=50 and Y=5.0 but the point shows up at (0,5.0):

http://chart.apis.google.com/chart?chxl=0:|0|X|100|1:|0|Y|5.0&chxt=x,y&chs=560x240&cht=lxy&chco=5EB3FFFD&chds=0,100,0,5.0&chd=t:50|5&chg=25,50&chls=2&chm=o,3366CC,0,-1,8,1

1

1 Answers

0
votes

This apparently is a bug with the Google Charts API but I just figured a workaround. For those who may encounter the same issue, just double your single point by repeating the value twice:

in the URL change:

chd=t:50|5 (generates single point but in (0,5) position - WRONG)

to:

chd=t:50,50|5,5 (generates correct placement of the single point (50,5)

Here's the complete URL:

http://chart.apis.google.com/chart?chxl=0:|0|X|100|1:|0|Y|5.0&chxt=x,y&chs=560x240&cht=lxy&chco=5EB3FFFD&chds=0,100,0,5.0&chd=t:50,50|5,5&chg=25,50&chls=2&chm=o,3366CC,0,-1,8,1