Float chart eliminates the selected color
API
does not provide a way ofexclude
some color if itauto-generated
<s> I think you can easily edit the file jquery.colorhelpers.js
and leave a comment / delete auto-colors
that you don't need.
Like for example (untested)
var lookupColors = {
aqua:[0,255,255],
azure:[240,255,255],
beige:[245,245,220],
black:[0,0,0],
// blue:[0,0,255], // --> no blue
brown:[165,42,42],
cyan:[0,255,255],
...
};
Edit:
If you're not manually including the file jquery.colorhelpers.js
, note the author's comment in the jquery.flot.js
file on line 8:
8: // first an inline dependency, jquery.colorhelpers.js, we inline it here
9: // for convenience
inline code is on line 32:
32: (function($){$.color={};$.color.make=...
Edit 2:
Important clarification
After reading the code and author's comment for a bit jquery.flot.js
, I realize that the above suggestion was completely wrong ...
lookupColors
var is used to match the color name given
to the corresponding value RGB
...
Nothing to do with auto-generated colors for the chart.
Now ... In the same reading I found out this color theme
jquery.flot.js declaration line 516
516: // the color theme used for graphs
517: colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
And guess what ... If you change it ... will change the diagram, so I think this would be your best approach.
Example:
colors: [
// "#edc240", // --> this removes/disabled the dark-yellow
"#afd8f8",
"#cb4b4b",
"#4da74d",
"#9440ed"
],
So now you can not only exclude
add color but also create your own theme
.
nice;)
JsFiddle example: http://jsfiddle.net/gmolop/9u8tsfum/
source to share