javascript - Changing Google Stacked Bar Chart colors (Material Bar Chart) -
var data = google.visualization.arraytodatatable(stats_data); var options = { width: 1400, height: 400, legend: { position: 'top', maxlines: 3 }, bar: { groupwidth: '75%' }, isstacked: true, bars: 'vertical', colors:['#999','#346ac9', '#279423', '#fc9826'], }; var chart = new google.charts.bar(document.getelementbyid('chart-recent')); chart.draw(data, google.charts.bar.convertoptions(options));
i've got stacked bar chart , want each of colors different (grey, blue, green, orange). however, colors of sections take first color (grey) in multiple brightnesses.
i tried in options
:
series: [ {color: '#999'}, {color: '#346ac9'}, {color: '#279423'}, {color: '#fc9826'} ]
how each of series have different color?
i able colors working here
when generating graph had use: new google.visualization.columnchart(...)
instead of new google.charts.bar(...)
otherwise not stack properly.
you may want make sure using latest version of google charts. in fiddle above, used samples developer docs using: https://www.google.com/jsapi
autoload things.
Comments
Post a Comment