Skip to content Skip to sidebar Skip to footer

Highcharts: How To Combine Custom Colors With Gradient

For some while now Im playing with coloring of my pie chart... And either I got my custom colors without gradient, or default colors with gradient... My colors are stored in php fi

Solution 1:

Use your colors in map instead of Highcharts built-in ones:

colors: Highcharts.map(<?echo $myColors;?>, function(color) {
    return {
        radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
        stops: [
                [0, color],
                [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
        ]
    };
})

Post a Comment for "Highcharts: How To Combine Custom Colors With Gradient"