【发布时间】:2016-05-18 20:31:10
【问题描述】:
我正在使用带有引导主题的 Grails google 可视化 api 插件,它工作得很好,但我想让它以某种方式响应。有没有一种简单的方法可以通过插件或其他方法来做到这一点?我粘贴了一个示例图表(.gsp 的完整内容),我正在处理它显示正常,但是当我调整屏幕大小时它不起作用。 Grails 2.5.2 谢谢!!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
</head>
<body>
<gvisualization:columnCoreChart elementId="barchart"
hAxis="${[slantedTextAngle: '180', textStyle: [color: 'black', fontName: 'Arial', fontSize: 10]]}"
bar="${[groupWidth: '50%']}"
title="Sales per Month"
titleTextStyle="${[color: 'black', fontName: 'Arial', fontSize: 14]}"
legend="${[position: 'bottom']}"
isStacked="${false}"
height="${400}"
columns="${colData}" data="${chartData}"/>
<div id="barchart"></div>
</body>
</html>
【问题讨论】:
-
您需要监听
resize事件并相应地“重绘”图表——参见redrawCharthere 示例 -
是否需要按照示例将 gvisualization 标签设置为等于函数?
标签: twitter-bootstrap grails google-visualization grails-plugin responsiveness