I have recently been getting the following warning message indicating that Highcharts.map is deprecated
Highcharts warning: Deprecated member - Highcharts.map: use Array.map
I am using the current Highcharts codeline (from https://code.highcharts.com)
However I cannot find any indication or examples as to how to replace Highcharts.map with Array.map.
Annoyingly the Highcharts demo (from the official Highcharts website) still shows the use of Highcharts.map and displays the same message about deprecation.
The offending call is in my plotOptions:
plotOptions: {
bar: {
dataLabels: {
enabled: true,
formatter: function () {
return bardynamicdatalabel.call(this);
}
},
colors: Highcharts.map(Highcharts.getOptions().colors, function(color) {
return {
linearGradient: { cx: 0.5, cy: 0.5, r: 0.7 },
stops: [
[0.6,new Highcharts.Color(color).brighten(-0.3).get('rgb')], // darken
[1, color]
]
};
})
},
Highcharts.map
and Array.map
are similar and it is very easy to convert one into another, example:
colors: Highcharts.getOptions().colors.map(function(color) {
return {
linearGradient: {
cx: 0.5,
cy: 0.5,
r: 0.7
},
stops: [
[0.6, new Highcharts.Color(color).brighten(-0.3).get('rgb')], // darken
[1, color]
]
};
})
Live demo: http://jsfiddle.net/BlackLabel/krm2evc7/