Closed arsitek closed 7 years ago
Use setupOptions
property - set setupOption['color']
to text of js function (from your example)
You should use yii\web\JsExpression
echo Highcharts::widget([
'scripts' => [
'modules/exporting', // adds Exporting button/menu to chart
],
'setupOption' => ['color' => new yii\web\JsExpression(<<<JSE
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
]
};
}
JSE
)],
'options' => ...
]);
Thanks for helping out, @bscheshirwork.
using this gives the following error: Setting unknown property: miloschuman\highcharts\Highcharts::setupOption
Any example to create pie chart with gradient color like this http://www.highcharts.com/demo/pie-gradient?
Thank you for help