137
rated 0 times
[
141]
[
4]
/ answers: 1 / hits: 25376
/ 10 Years ago, thu, april 24, 2014, 12:00:00
How can you have a different color for each bar when using the categories mode in Flot?
This code makes every bar the first color in colors
array. I'd like each bar to be the corresponding color in the colors
array.
Current code:
var data = [[Red,1],[Yellow,2],[Green,3]];
$.plot(#placeholder1div,[data], {
series: {
bars: {
show: true,
barWidth: 0.3,
align: center,
lineWidth: 0,
fill:.75
}
},
xaxis: {
mode: categories,
},
colors: [#FF0000,#FFFF00,#00FF00]
});
More From » jquery