从仪表图中删除中间标记

时间:2014-11-09 09:15:38

标签: jquery highcharts gauge

我正在使用High chart gauge solid模块,并且我想隐藏它的图表上会显示一个中间标记,我该怎么做?附加图像是购物车呈现的输出。 sample output I want to remove that 5M from the middle

这是我的代码:

(".graph-container").highcharts({        
    chart: {
        type: 'solidgauge',
        plotBorderWidth: 0,
        borderColor: "#fff",
        backgroundColor: "#fff",
        height: this.get_body_height() - this.get_body().find(".graph-header").height() * 1.5,
        marginLeft: 0,
        marginRight: 0,
        plotShadow: false
    },
    title: null,
tooltip: { enabled: false},
    plotOptions: {solidgauge: { dataLabels: {borderWidth: 0, y: 5, useHTML: true}}},
    pane: {
        center: ['50%', '75%'],
        size: '100%',
        startAngle: -90,
        endAngle: 90,
        borderWidth: 0,
        borderColor: "#fff",
        background: {
            backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE',
            innerRadius: '60%',
            outerRadius: '100%',
            shape: 'arc'
        }
    },
    yAxis: {
        min: data.min_value,
        max: data.max_value,
        title: {
            y: -60,
            //text: data.name
        },
        labels: { y: 16 },
        stops: data.stops,
        lineWidth: 0,
        minorTickInterval: null,
        tickPixelInterval: 400,
        tickWidth: 0,
    },
    credits: {
        enabled: false
    },
    series: [{
        name: data.name,
        data: [data.value],
        dataLabels: {
    formatter: function () {
                var d = this.point;
                return '<div style="text-align:center"><span style="font-size:14px;color:' +
        ((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black') + '">' + d.y.toPrecision(3) + '</span></div>'
    }
        },
        tooltip: {
            valueSuffix: ' ' + data.unit
        }
    }]
});

2 个答案:

答案 0 :(得分:2)

您可以在示例中设置tickPixelIntervalhttp://jsfiddle.net/unxx4f3e/

答案 1 :(得分:1)

您可以添加:

yAxis: {
    tickInterval:10000000 // max amount of the gauge
}

这将使仪表从此点开始作为结束的刻度,因此不会显示其他点。