admin管理员组文章数量:1333690
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 field, which I want to load like colors: <?echo $myColors;?>
.
Actual state of my code is like this (it shows default colors with gradient):
colors: Highcharts.map(Highcharts.getOptions().colors, 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
]
};
})
How should I edit it so it would show my own colors in simple way? Also I didn´t find what is "stops" option for...
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 field, which I want to load like colors: <?echo $myColors;?>
.
Actual state of my code is like this (it shows default colors with gradient):
colors: Highcharts.map(Highcharts.getOptions().colors, 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
]
};
})
How should I edit it so it would show my own colors in simple way? Also I didn´t find what is "stops" option for...
Share Improve this question asked Feb 13, 2013 at 10:29 Michal SMichal S 1,1136 gold badges19 silver badges32 bronze badges1 Answer
Reset to default 7Use 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
]
};
})
本文标签: javascriptHighCharts How to combine custom colors with gradientStack Overflow
版权声明:本文标题:javascript - HighCharts: How to combine custom colors with gradient - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742355316a2459289.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论