3

Using the Google Charts tool, is there a way to only stack two (of the four) columns in my data set?

On Google's website, this is their example:

var data = google.visualization.arrayToDataTable([
  ['Genre', 'Fantasy & Sci Fi', 'Romance', 'Mystery/Crime', 'General','Western', 'Literature', { role: 'annotation' } ],
  ['2010', 10, 24, 20, 32, 18, 5, ''],
  ['2020', 16, 22, 23, 30, 16, 9, ''],
  ['2030', 28, 19, 29, 30, 12, 13, '']
]);

var options = {
  width: 600,
  height: 400,
  legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '75%' },
  isStacked: true,
};

How would I do this if I only wanted to stack, for example, Romance and Mystery/Crime?

  • I believe this question is essentially answered here: http://stackoverflow.com/questions/19490942/column-stacked-chart-by-groups – Cato Minor Apr 09 '15 at 12:25
  • Another similar question: https://stackoverflow.com/questions/17925722/stacked-column-chart-for-two-data-sets-google-charts – Damien Sep 01 '16 at 04:30

0 Answers0