Set series color

How to set the colors of all series in the fleet, how so?

+3
source share
2 answers

When you provide data, give them the same colorproperty or index .

For instance:

[ { 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, both of them will get color # 0 in the auto-generated color array that the fleet has.

+6
source

You can also pass an array of colors in the parameters:

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

Source: https://habr.com/ru/post/1753499/


All Articles