Google图表图片,为X轴和Y轴添加标签

时间:2011-09-17 13:01:28

标签: google-visualization

我正在使用:

http://code.google.com/apis/chart/image/

我想描述X是“膳食号”而Y是“卡路里”

chs=440x220
chxt=y,x
cht=lc
chco=3072F3
chd=t:931.4,23.5,572.4,0,0,0,0
chds=0,2500
chxr=0,0,2500|1,1,7,1
chdl=Energi
chdlp=b
chls=2
chma=5,5,5,25
chm=o,000000,0,-1,5

你可以试试看这里:

http://code.google.com/apis/chart/image/docs/chart_playground.html

我已经有X和Y的标签.X轴1,2,3,4 ......和Y轴0,250,500 ......

我想在Y轴的顶部或底部添加:卡路里 在X轴上:膳食号

我发现了这个: http://www.lornajane.net/posts/2011/adding-multiple-axis-labels-to-a-google-chart

但我不知道如何在折线图上做到这一点

1 个答案:

答案 0 :(得分:0)

chxl参数可让您指定标签,chxp可让您定位标签,例如:

http://chart.apis.google.com/chart
   ?chxl=0:|Calories||1:|Hours
   &chxp=0,100|1,50
   &chxt=y,x
   &chbh=a
   &chs=300x225
   &cht=bvg
   &chco=A2C180,3D7930
   &chd=t:10,50,60,80,40,60,30|50,60,100,40,20,40,30
   &chtt=Vertical+bar+chart

更多细节(包括如何将样式应用于轴标签):