开发者

Google Charts - How to have axis label and values?

I am currently working on displaying 2 lines of data on a XY linechart using Google Charts. I have it nearly finished but I need to put labels on both the X and Y axis.

Along the vertical Y axis I want to replace the 0 to 100 with 'Minutes' and along the horizontal X axis I want to replace the 0 to 100 with 'Hours'.

I have been messing around with the for ages and can't figure it out just this tiny thing. Here is my current code at the moment. Can someone please save my brain from melting? Here is my code so you can view the chart, thanks.

<img src="http://chart.apis.google.com/chart
?chxr=0,0,24|1,0,60
&chxt=x,y,x,y
&chs=800x350
&cht=lxy
&chco=3072F3,FF0000
&chds=0,24,0,60,0,24,0,60
&chd=t:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18开发者_C百科,19,20,21,22,23|20,30,40,20,30,40,20,30,40,20,30,40,20,30,40,20,30,40,20,30,40,20,30,40|
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23|5,10,22,35,5,10,22,35,5,10,22,35,5,10,22,35,5,10,22,35,5,10,22,35
&chdl=Active|Sedentary
&chls=2,4,1|1
&chma=5,5,5,25
&chtt=Physical+Activity+Chart" 
width="800" height="350" alt="Physical Activity Chart" />


Ok I figured it out almost straight away then, pain!
Anyways, i had to add in this code and it worked then, assigning values to each axis label-

&chxl=0:|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|
1:|0|5|10|15|20|25|30|35|40|45|50|55|60|
2:|Hours|
3:|Minutes
&chxp=2,50|3,50
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜