I have a page with a number of pie and bar charts on it. Most of the bar charts need to be stacked, one doesn't - but it still is.
I've set stack to null and false but it makes no difference.
I've found jsfiddles that are for stacked charts and I've tried turning them back into regular bar charts but they wouldn't do it either so my method must be wrong.
Any ideas?
var prodData4 = [[2, 28],[3, 24],[4, 16],[5, 15],[6, 11]];
var prodData5 = [[2, 25],[3, 13],[4, 10],[5, 4],[6, 8]];
var prodData7 = [[4, 51],[5, 3],[6, 18]];
var prodData8 = [[5, 28],[6, 14]];
var prodData9 = [[6, 4]];
var productTicks = [[2, 'Feb-16'],[3, 'Mar-16'],[4, 'Apr-16'],[5, 'May-16'],[6, 'Jun-16']];
var productSeries = {
bars: { show: true, barWidth: 0.16, series_spread: true, align: "center"},
xaxis: { ticks: productTicks, autoscaleMargin: .10 },
grid: { hoverable: true, clickable: true }
};
var productDataset = [
{label: 'Product4', data: prodData4},
{label: 'Product5', data: prodData5},
{label: 'Product7', data: prodData7},
{label: 'Product8', data: prodData8},
{label: 'Product9', data: prodData9},
];
$.plot($("#productChart"), productDataset, productSeries);
I've created a demo https://jsfiddle.net/oseyxv17/1/
Aucun commentaire:
Enregistrer un commentaire