禁用标签不带栏Highstock

时间:2015-07-09 08:57:12

标签: javascript jquery highcharts highstock

我有柱状图Highstock: http://jsfiddle.net/txfnsubb/

当我们将范围更改为较小的值时,有时它会向我们显示值为w / o的标签。例如,我看到30个条形,最后标签有31个。是否有可能将其关闭?将图表设置为仅使用条形显示标签。

$('#container').highcharts('StockChart', {
    chart: {
        marginTop: 140
    },
    credits: {
        enabled: false
    },
    plotOptions: {
        series: {
            dataGrouping: {
                approximation: "average"
            }
        }
    },
    scrollbar: {
        enabled: false
    },
    navigator: {
        top: 40,
        xAxis: {
            labels: {
                formatter: function () {
                    return x[this.value];
                }
            }
        }
    },
    xAxis: {
        labels: {
            y: 50,
            max: 150,
            formatter: function () {
                return x[this.value];
            }
        }
    },
    tooltip: {
        formatter: function () {
            var s = [];
            var next = this.x + this.points[0].series.pointRange;
            if ((this.x + 1) == next) {
                s.push("<b>Position: " + (this.x + 1));
            } else {
                s.push("<b>Position: " + (this.x + 1) + "-" + next);
            }
            $.each(this.points, function (i, point) {
                s.push('<span style="color:#D31B22;font-weight:bold;">' + point.series.name + ' : <span>' + point.y.toFixed(2));
            });
            return s.join('<br/>');
        },
        shared: true
    },
    series: [{
        type: 'column',
        name: 'reactivity',
        data: data,
        showInLegend: false,
        tooltip: {
            valueDecimals: 2,
            shared: true
        }
    }, {
        type: 'spline',
        name: 'experiment 1',
        data: data2,
        color: 'green',
        visible: false,
        tooltip: {
            valueDecimals: 2
        }
    }, {
        type: 'spline',
        name: 'experiment 2',
        data: data3,
        color: 'red',
        visible: false,
        tooltip: {
            valueDecimals: 2
        }
    }],
    legend: {
        enabled: true,
        margin: 0
    },
    rangeSelector: {
        buttons: [{
            type: 'millisecond',
            count: seqLength / 5,
            text: '0.25'
        }, {
            type: 'millisecond',
            count: seqLength / 3,
            text: '0.3'
        }, {
            type: 'millisecond',
            count: seqLength / 2,
            text: '0.5'
        }, {
            type: 'all',
            text: '1.0'
        }],
        inputEnabled: false, // it supports only days
        selected: 4 // all
    }
});

0 个答案:

没有答案