简体   繁体   English

Highcharts-带有间隙的量规图表

[英]Highcharts - Gauge chart with breaks

I am trying to get breaks on a gauge chart along the axis. 我试图在沿轴的量表上休息。 It looks like below - 看起来像下面-

在此处输入图片说明

I have my jsfiddle setup to achieve the above chart but the breaks aren't quite working - JSFiddle link - http://jsfiddle.net/arj_ary/1g0v9Lhg/42/ 我有我的jsfiddle设置来实现上述图表,但中断效果不佳-JSFiddle链接-http: //jsfiddle.net/arj_ary/1g0v9Lhg/42/

The notable part in the code is - 代码中值得注意的部分是-

breaks: [{
          from: 100,
          to: 120,
          breakSize: 20,
          repeat: 10
      }]

Can someone help me in figuring out what exactly i am missing or how to get those 3 breaks in the chart. 有人可以帮助我弄清楚我到底缺少什么,或者如何在图表中获得这3个中断。

Thanks in advance !. 提前致谢 !。

EDIT: i was missing a broken-axis module. 编辑:我缺少一个断轴模块。 Loaded it now, still cant get 3 different breaks on the axes. 现在加载它,仍然无法在轴上获得3个不同的中断。

<script src="https://code.highcharts.com/modules/broken-axis.js">

Set tick positions at 25, 50 and 75 and that should work in conjunction with pane object on a solidgauge chart - 将刻度位置设置为25、50和75,并且应与立体表上的窗格对象一起使用-

var chartOptions = {
            chart: {
                type: 'solidgauge',
                renderTo: this.el,
                width: this.chartWidth,
                height: this.chartHeight,
                margin: [0, 0, 0, 0]
            },
            title: null,
            tooltip: {
                enabled: false
            },
            pane: {
                size: '100%',
                center: ['50%', '60%'],
                startAngle: -135,
                endAngle: 135,
                background: {
                    borderWidth: 13,
                    backgroundColor: 'transparent',
                    shape: 'arc',
                    borderColor: '#E6E6E6',
                    outerRadius: '90%',
                    innerRadius: '90%'
                }
            },
            yAxis: {
                min: 0,
                max: 100,
                labels: {
                    enabled: false
                },
                lineWidth: 0,
                tickPositions: [25, 50, 75],
                minorTickWidth: 0,
                tickWidth: 10,
                tickLength: 28,
                tickColor: 'white',
                zIndex: 6,
            },

            plotOptions: {
                solidgauge: {
                    animation: false,
                }
            }
}

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

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