While working on Flot line charts and customizing their colors, I came across a strange issue. Once I set the first 3 colors, the plot started using the last color for all the remaining lines. This behavior was unexpected and not the norm.
What adds to the intrigue is that the legend shows the correct colors. Could this be a known bug?
var dataSet = [
{label: "d1", data: demand},
{label: "d2", data: demand2},
{label: "d3", data: demand3},
{label: "d4", data: demand4},
{label: "d5", data: demand5},
{label: "d6", data: demand6}
]
$.plot(placeholder2, dataSet, {
series: {
},
legend: {
noColumns: 0,
position: "nw"
},
colors:["#2980B9","#D35400","#F39C12","#7F8CFF","#C0392B","#7F8C8D"]
});
To double-check my sanity and confirm the issue, I ran the code again without specifying colors. Surprisingly, even with Flot's default colors, the last color continued to "stick."