简体   繁体   English

Highcharts solidgauge 弧形,5 种不同的纯色(无渐变)

[英]Highcharts solidgauge arc shape with 5 diffrent solid color (no gradiant)

I have used a solid-gauge high chart arc shape in Y-axis stops I want to use 5 different colors like我在 Y 轴停止中使用了实心高图表弧形 我想使用 5 种不同的 colors

0 to 39 - #B31700
40 to 64 - #F22808 
65 to 79 - #F98928 
80 to 89 - #F3C50B 
90 to 100 - #27aae1

Problem is when giving the data like 90 the color is so much invisible of given color when the value is increase above to 95 or 97 or 100 then the actual color comes in chart.问题是当给出像 90 这样的数据时,当值增加到 95 或 97 或 100 以上时,给定颜色的颜色是如此不可见,然后实际颜色出现在图表中。

Please help me out how can I get the proper color in the starting of a stops in y axis.请帮助我如何在 y 轴的停止开始时获得正确的颜色。

Here is my example with fiddle:这是我的小提琴示例:

https://jsfiddle.net/9jsp08v7/1/ https://jsfiddle.net/9jsp08v7/1/

Try to use the dataClasses feature instead of stops .尝试使用dataClasses功能而不是stops

yAxis: [{
  ...,
  dataClasses: [{
    from: 0,
    to: 39,
    color: '#B31700'
  }, {
    from: 39,
    to: 64,
    color: '#F22808'
  }, {
    from: 64,
    to: 79,
    color: '#F98928'
  }, {
    from: 79,
    to: 89,
    color: '#F3C50B'
  }, {
    from: 89,
    to: 100,
    color: '#27aae1'
  }]
}],

Demo: https://jsfiddle.net/BlackLabel/vxgda85y/演示: https://jsfiddle.net/BlackLabel/vxgda85y/

At last I have found a solution.最后我找到了解决方案。

Here is the fiddle link:这是小提琴链接:

stops: [
    [39 / 100, '#B31700'],
    [40 / 100, '#F22808'],
    [64 / 100, '#F22808'],
    [65/100, '#F98928'],
    [79/100, '#F98928'],
    [80/100, '#F3C50B'],
    [89/100, '#F3C50B'],
    [90/100, '#27aae1'],
    [100/100, '#27aae1']
  ]

https://jsfiddle.net/avdq5rf6/1/ https://jsfiddle.net/avdq5rf6/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM