Why does my stacked column chart occasionally show very narrow bars?

11 views
Skip to first unread message

Steve Morris

unread,
May 26, 2016, 4:41:31 AM5/26/16
to Google Visualization API
I have a stacked column chart. The bars are set at 75%.

var defaultGraphOptions = {
legend: { position: 'top', maxLines: 2 },
title: '',
height:400,
width:800,
chartArea: {left:"15%",top:40,width:"90%",height:"80%"},
isStacked: true,
bar: { groupWidth: '75%' },
hAxis: { title:"", titleTextStyle: { bold: true, italic: false, }, slantedText: false, viewWindow: { min: [5, 0, 0], max:[20, 0, 0]}},
vAxis: { title:"", textPosition:"out", titleTextStyle: { bold: true, italic: false, }, viewWindow: { min: 0, }, },
colors: [],
};
 The bars almost always show correctly 

 However, every so often the bars appear very narrow.


 The default options are set once when the application starts and the "faulty" graph may suddenly show several times after viewing the "correct" graph many times with different data and then revert to normal.


Any ideas?



Daniel LaLiberte

unread,
May 26, 2016, 10:01:04 AM5/26/16
to Google Visualization API
The width of the bars is computed from the minimum distance between any two adjacent bars, so I would expect that somewhere in your data you have two domain values that are closer than you expected.  This is true even before the viewWindow constraints are applied, I believe.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/004400e9-9f43-42b3-8c05-dc04844f2570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages