admin管理员组文章数量:1414856
I would like to know if is it possible to have a gradient that starts with green on the left (0 value), fading to yellow in the middle and then fading into red at the right side of the "solidGauge" chart.
I tried some configuration in the yAxis but they don't do what i want:
yAxis: {
plotBands: [{
color: {
linearGradient: [300, 300, 0, 0],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(150, 200, 155)']
]
},
from: 0,
to: 100
}],
},
yAxis: {
minColor:'#55BF3B',
maxColor:'#DF5353',
},
yAxis: {
minColor: gaugeValue >= 80 ? '#FF0000' : (gaugeValue >= 60 ? '#FFFF00' : '#00FF00'),
maxColor: gaugeValue >= 80 ? '#FF0000' : (gaugeValue >= 60 ? '#FFFF00' : '#00FF00'),
}
yAxis: {
stops: [
[0.1, '#55BF3B'], // green
[0.5, '#DDDF0D'], // yellow
[0.9, '#DF5353'] // red
],
},
Ok I know that images have different colours because I used different Hex value, btw the result is always the same: a solid color (based on the gaugeValue).
I would like that if my value is 90% I can see gradient green to yellow to red. Something like this:
Any suggestion is wele.
Thanks
I would like to know if is it possible to have a gradient that starts with green on the left (0 value), fading to yellow in the middle and then fading into red at the right side of the "solidGauge" chart.
I tried some configuration in the yAxis but they don't do what i want:
yAxis: {
plotBands: [{
color: {
linearGradient: [300, 300, 0, 0],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(150, 200, 155)']
]
},
from: 0,
to: 100
}],
},
yAxis: {
minColor:'#55BF3B',
maxColor:'#DF5353',
},
yAxis: {
minColor: gaugeValue >= 80 ? '#FF0000' : (gaugeValue >= 60 ? '#FFFF00' : '#00FF00'),
maxColor: gaugeValue >= 80 ? '#FF0000' : (gaugeValue >= 60 ? '#FFFF00' : '#00FF00'),
}
yAxis: {
stops: [
[0.1, '#55BF3B'], // green
[0.5, '#DDDF0D'], // yellow
[0.9, '#DF5353'] // red
],
},
Ok I know that images have different colours because I used different Hex value, btw the result is always the same: a solid color (based on the gaugeValue).
I would like that if my value is 90% I can see gradient green to yellow to red. Something like this:
Any suggestion is wele.
Thanks
Share Improve this question asked Mar 26, 2016 at 20:24 WoutVanAertTheBestWoutVanAertTheBest 8201 gold badge17 silver badges33 bronze badges2 Answers
Reset to default 7You need to set color for point as gradient, not for axis. For example: http://jsfiddle/n9gfeor2/
series: [{
name: 'Speed',
data: [{
color: {
linearGradient: [0, 0, 300, 0],
stops: [
[0.1, '#55BF3B'], // green
[0.5, '#DDDF0D'], // yellow
[0.9, '#DF5353'] // red
]
},
y: 80
}]
}]
This might be the answer: Highchart's gauge with gradient plotband
color: {
linearGradient: [300, 300, 0, 0],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(150, 200, 155)']
]
本文标签: javascriptHighcharts solidgauge with greenyellowred gradientStack Overflow
版权声明:本文标题:javascript - Highcharts solidgauge with greenyellowred gradient - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745212001a2647944.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论