Bar chart top axes and bottom axes identical

14 views
Skip to first unread message

Matt Bradley-Roberts

unread,
Sep 15, 2017, 9:00:04 AM9/15/17
to Google Visualization API
I'm looking to get the hAxis information I currently have to display both on the top and bottom of a bar char (as it could be a large chart!)

The chart currently looks like this (the data is fake by the way! The labels on the side have been 'redacted'):



Essentially I just want the -2m to +2m labels to show on the top as well.

Here's the code:

var chartHeight = (data.getNumberOfRows() * 20) + 100;
                var options = {
                    height: chartHeight,
                    titlePosition: 'none',
                    chartArea: {width: '50%', height: chartHeight-60},
                    bar: {groupWidth: "75%"},
                    isStacked: true,
                    fontSize: 12,
                    legend: { position: "none" },
                    hAxis: {
                      title: '{!$amount} ({!selectedCurrency})',
                      viewWindow: {
                        min: {!minVal},
                        max: {!maxVal}
                      },
                      ticks: [{!minVal},-{!tick},0,{!tick},{!maxVal}]
                    }
                };

I've attempted to use multiple series, but as there is only one data series, with negative and positive figures, it didn't seem to work. I may be overcomplicating this, so all suggestions welcome!
Reply all
Reply to author
Forward
0 new messages