2012-02-25 44 views
0

我使用Grails中的google-visualization并希望配置两件事情:谷歌可视化插件的Grails:如何设置hAxis最大值和颜色格式

1)如何设置的最大值沿水平轴?
2)如果条柱低于某个特定值,我该如何更改它?

这是我有:

<td> 
<div id="${mach.divtag}" style="display:block;">  
<gvisualization:columnCoreChart elementId="${mach.divtag}" width="${150}" 
    height="${120}" columns="${mac.columns}" data="${mach.datapoints}" 
    title="${mach.name}" /> 
</div> 

这里就是我希望的图表,更改的快照。

enter image description here

感谢。我非常感谢任何帮助。

回答

3

FAQ

问:如何设置值,如 列核心图表的“hAxis”可视化对象数据类型?

答:您可以通过使用Expando或自定义bean类轻松完成此操作。 “textColor”,“title”和“titleColor”是此对象的字段。

examples of the plugin

<gvisualization:columnCoreChart elementId="columnchart" title="Company Performance" width="${400}" height="${240}" hAxis="${new Expando(title: 'Year', titleColor: 'red')}" columns="${companyPerformanceColumns}" data="${companyPerformanceData}" /> 

因此,对于一个,使用在Expando并设置hAxis.maxValue,每Google API

hAxis="${new Expando(maxValue:100)}" 

b)中,您可能必须使用Google API自己使用Javascript执行此操作,以使用combination of getSelection() for all available bars and setSelection() with some kind of color modifier after you've interrogated its value。希望你能从这里处理它,否则寻求咨询帮助。