Stacking only two columns using google charts

Using the Google Charts tool, is there a way to fit only two (out of four) columns in my dataset?

On the google website, this is an example of them:

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 could I do this if I only wanted to bed, for example, "Romance and Mystery / Crime"?

+3


source to share





All Articles