Combo Chart display issue

24 views
Skip to first unread message

Henry Harrison

unread,
Jul 19, 2016, 10:42:13 AM7/19/16
to Google Visualization API
Hi Team

I have a combo chart with 104 weeks of sales data. WeekEndDate (date), Units (number), Price (number, currency).  We always send back 104 weeks of data.  If a new item is shown with 1 week of data the actual data set is 104 WeekEndDate (domain values) with nulls for price and units for non represented weeks.

eg.

new Date('2014/07/24'), null, null
new Date('2014/07/31'), null, null
..
...
new Date('2016/07/14'), 605.00, 4.01 <==== the only point with data for units and price.

This causes an issue in the way the chart gets displayed.  You can see in the image that the column for units spans multiple domain values.  Hovering over the data points shows no values in the tooltips for them but visually this is happening.  We use the viewWindow to only show the latest 13 weeks in this case but the problem persists no matter the viewWindow selected.



When there are 2 or more weeks then the chart renders without issue.

This might be limited information to go on but has anyone ever seen anything like this?  Any help will be appreciated.


Regards
Henry







Daniel LaLiberte

unread,
Jul 19, 2016, 11:17:21 AM7/19/16
to Google Visualization API
Henry,

Columns (and bars) are unusual compared to other chart types in that the width of columns is determined by how many can fit in the chart area rather than any correspondence to the data.  With only one data item, the column width is therefore computed to be much larger.

There is a new option to specify bar: { width: n }, as a generalization of the bar: { groupWidth: n } option.  If you can specify a fixed width in pixels that works in all cases, that will keep the size manageable.   You'll probably want to also constrain the chartArea.width as well so that the two work together.

Another alternative is to use discrete domain values (strings rather than dates), in which case the width of columns will be constrained to the width of one discrete domain value.

--
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/1f0d7b57-cd9e-4e4e-8a45-9470d6a4900b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages