首页 文章

Google Chart - 带有标签的条形图

提问于
浏览
0

我正在尝试使用Google Chart API创建与此相近的内容:

what i'm trying to do

到目前为止,我有这个:

<img src="//chart.googleapis.com/chart?
chbh=a
&chs=461x337
&cht=bvg
&chco=323232,7bc247&c
&chd=e:zM,Mz" width="461" height="337" alt="" />

这产生了这个

http://jsfiddle.net/alexjamesbrown/c2VAP/

这几乎就在那里,但我无法弄清楚如何/如果我可以在酒吧下面添加标签?

1 回答

  • 1

    如果你想获得这样的标签,你必须做一些改变 . 设置以下图表参数:

    cht=bvs                // create a stacked chart
    chd=zM__,__Mz          // insert null values for the opposite data points
    chxt=x                 // create an x-axis
    hxl=0:|Label+1|Label+2 // set the labels on the x-axis ("+" translates to a space)
    

    见例子:http://jsfiddle.net/asgallant/c2VAP/2/

相关问题