Nisanth Kumar
Nisanth Kumar

Reputation: 5715

Set series color

How to set colors of all series in flot as same?

Upvotes: 3

Views: 5793

Answers (2)

jgillich
jgillich

Reputation: 76209

You can pass an array of colors in the options as well:

$.plot($("#plot"), [plotData], { colors: ['#0000FF'] });

Upvotes: 3

Nick Craver
Nick Craver

Reputation: 630379

When you're providing the data, give them the same color property or index.

For example:

[ { color: 0, label: "Foo", data: [ [10, 1], [17, -14], [30, 5] ] },
  { color: 0, label: "Bar", data: [ [11, 13], [19, 11], [30, -7] ] } ]

In this case they'd both get color #0 in the auto-generated color array Flot has.

Upvotes: 6

Related Questions