score:2

Highcharts.map is nothing more than simple for which can be replaced by for(var i = 0; i < colors.length; i++) { ... }.

Highcharts.Color create color object. You don't need to use that, just create two arrays for colors, one for starting colors, one for end colors:

var startColors = ["#55BF3B", "#DF5353", "#DDDF0D", "#7798BF"];
var endColors = ["#7798BF", "#DDDF0D", "#DF5353", '#55BF3B' ];

Then loop over them to set colors:

$scope.chartConfig.options.colors[0] = {
    radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
    stops: [
        [0, startColors[0]],
        [1, endColors[0]] 
    ]
}

Related Articles