jquery - Javascript flot not showing data series -
i'm using flot display data on bar graph. data isn't displaying reason, , have no idea why.
my data series correct far can see, still won't show.
jsfiddle: http://jsfiddle.net/9jhpyne4/1/
code:
var plotdata = [ [1, 12.35], [2, 34.6], [3, 56.7], [4, 4.35] ]; $.plot($("#main-chart"), plotdata, { bars: { show: true, linewidth: 0, fill: true, fillcolor: { colors: [{ opacity: 0.8 }, { opacity: 0.1 }] } } });
data pass plot function needs have metadata (like label , color):
var data = [ [1, 12.35], [2, 34.6], [3, 56.7], [4, 4.35] ]; var dataset = [{ label: "a label", data: data, color: "red" }];
Comments
Post a Comment