开发者

Google Visualization Spacing

开发者 https://www.devze.com 2022-12-30 08:18 出处:网络
I have a chart similar to the one below using the Google Visualization API. My problem is that on the right side of where the key is for this chart(where it says low, medium, high) there is too much w

I have a chart similar to the one below using the Google Visualization API. My problem is that on the right side of where the key is for this chart(where it says low, medium, high) there is too much white space. 开发者_StackOverflowHow can I get rid of this white space?

Google Visualization Spacing

(source: securitymonks.com)


You can play around with width and height percentages & width and height values in options variable and even push the legend to bottom as one single line. Then pass the options to the chart you are drawing.

var options2 = { width: 265, height: 200,
            chartArea: { left: 60, top: 20, width: "100%", height: "60%" }, 
            isStacked: true, allowHtml: true, 'legend': 'bottom', titleTextStyle: { color: 'green', fontFamily: 'Arial', fontSize: 16 }, legendTextStyle: { color: '#666666' },
            vAxis: { title: 'Liters', titleTextStyle: { color: 'blue', fontName: 'Arial', fontSize: 10 }, textStyle: { fontSize: 9} },


As a kind of work around I ended up just making the graph wider and using overflow:hidden on the containing Div. If anyone knows if the API allows to make the white space smaller please let me know.

0

精彩评论

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