how to make specific labels outside gauge chart

混江龙づ霸主 提交于 2020-01-13 10:40:13

问题


The gauge graph is great!

I am looking for a way to label only 2 points outside the gauge chart. The first point being what the gauge value is (say $80,000) and the second being an industry standard (say $90,000) on a gauge that goes from 0 to $100,000. The needle would be pointing at $80,000 and the $90,000 would be at the appropriate position on the arc as well.

Please let me know what you recommend.

I have created a jsfiddle with everything but the 2 labels we are hoping for.

$('#container').highcharts({
  chart: {
    type: 'gauge',

http://jsfiddle.net/Fe6yJ/


回答1:


If I am understanding you correctly, you want two labels on the outside of the gauge at relevant points. This can be done with a the yAxis label options:

  yAxis: {
        labels: {
            enabled: true,
            x: 35, y: -10 // move them to the outside
        },
        tickPositions: [80, 90], // only draw them at 80, 980
        minorTickLength: 0,
        min: 0,
        max: 100,
       //etc...

Fiddle here.



来源:https://stackoverflow.com/questions/18515493/how-to-make-specific-labels-outside-gauge-chart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!