I am trying to customize the color for each point in an array based on its name and y value.
This is what I have so far:
(function(H) {
H.wrap(H.Series.prototype, 'getColor', function(proceed) {
this.color = generateColorForString(this.name);
});
}(Highcharts));
Currently, this method works with the following data structure:
{
"data": [
[
[
"2018",
"02",
"16",
"00",
"00"
],
4.9
],
...
],
"name": "MySeriesName"
}
However, it does not work with a different data structure used for a pie chart:
{
"type": "pie",
"name": "MySeriesName",
"data": [
[
"foo",
27
],
[
"foox",
112
],
[
"fooy",
4
]
...
]
}
Is there a way to set specific colors for each point based on its name?
Here is the link to my fiddle: http://jsfiddle.net/2nd8561k/2/