具有梯度情节带的Highchart的测量仪 [英] Highchart's gauge with gradient plotband
问题描述
我以为我可以为每个停止点1-100生成单独的plotband部分,但是如果有一种方法可以设置一个更清洁的线性外观。任何一个人都知道一个方法吗?
是的,这是可能的。尝试如下所示:
yAxis:{
min:0,
max:100,
plotBands:[{
color:{
linearGradient:[300,300,0,0],
stops:[
[0,'rgb(255,255, 255)'],
[1,'rgb(150,200,155)']
]
},
从:0,
到:100
}],
},
通过仔细选择颜色,linearGradients和从/到,你应该能够结合几个情节带来做你想做的事。
I am trying to use the Highcharts gauge. Is there a way to set the plotband to a linear gradient? If my gauge has a value from 0-100, I want the plot band to shift from red at 0 to yellow at 50 to green at 100.
I thought that I could just generate the indiviual plotband sections for each stop point, 1-100 but if there was a way to set a linear grandient that would be so much cleaner. Any one know a way?
Yes, it is possible. Try something like this:
yAxis: {
min: 0,
max: 100,
plotBands: [{
color: {
linearGradient: [300, 300, 0, 0],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(150, 200, 155)']
]
},
from: 0,
to: 100
}],
},
By carefully chosing your colours, linearGradients and from/to, you should be able to combine several plotbands to do what you want.
这篇关于具有梯度情节带的Highchart的测量仪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!