如何打破highcharts x-Axis类别

时间:2015-02-26 11:07:09

标签: javascript highcharts highstock

我创建了一个示例dateTime Highchart,如图所示。但是我想要从值" 03/24/2014"中断x轴。重视" 12/15/2014"。这有可能打破吗? Highchart为数字类别提供中断功能,您可以从Here引用它。所以我需要帮助,并提前感谢.Below是代码片段

$('#container').highcharts({
    chart:{type:'scatter'},
    xAxis: {
        tickInterval:24 * 3600 * 1000*7 ,


        type: 'datetime',
        labels:
        {

            rotation: -90,
            formatter:
           function () {
               return Highcharts.dateFormat('%m/%d/%Y', this.value)
            }
        }
    },
    tooltip:{ hideDelay: 100, headerFormat: '<b>{point.x:%m/%d/%Y} - {point.key}</b><br/>', pointFormat: '{series.name}:{point.y}'},
    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
        pointStart: Date.UTC(2014, 0, 1),
        pointInterval: 24 * 3600 * 1000*7 
    },{
        data: [9.9, 7.5, 16.4, 12.2, 44.0, 16.0, 35.6, 18.5, 16.4, 14.1, 9.6, 4.4],
        pointStart: Date.UTC(2015, 0, 1),
    pointInterval: 24 * 3600 * 1000*7 
    }]
});

Highchart

1 个答案:

答案 0 :(得分:2)

究竟什么不适合你?工作演示:http://jsfiddle.net/LLExL/4188/

        breaks: [{
            from: Date.UTC(2014, 0, 1) + 12 * 24 * 3600 * 1000 * 7, //12 points
            to: Date.UTC(2015, 0, 1),
            breakSize: 24 * 3600 * 1000 * 7
        }],