簡體   English   中英

Highstock僅在用戶放大時顯示系列

[英]Highstock is only showing series when user zooms in

我遇到了一個高圖異常問題。 我正在使用圖表繪制具有多個系列的圖表。 每個系列的得分都在100以上。 這是生成圖表的代碼。

$('#chart').highcharts('StockChart', {
    chart: {
        zoomType: 'x',
        alignTicks: false,
        backgroundColor: 'rgba(255, 255, 255, 0.1)'
    },
    title: {
        text: 'Google SERP Chart'
    },
    credits: {
        enabled: false
    },
    rangeSelector: {
        buttons: [{
            type: 'hour',
            count: 1,
            text: '1h'
        }, {
            type: 'day',
            count: 1,
            text: '1d'
        }, {
            type: 'month',
            count: 1,
            text: '1m'
        }, {
            type: 'year',
            count: 1,
            text: '1y'
        }, {
            type: 'all',
            text: 'All'
        }],
        inputEnabled: false, // it supports only days
        selected: 4 // all
    },

    xAxis: {
        type: 'datetime',
        title: {
            text: null
        },
        lineWidth: 2,
        minRange: 3600 * 1000,
        labels: {
            formatter: function () {
                return Highcharts.dateFormat('%a %d %b', this.value);
            }
        }
    },
    yAxis: {
        tickInterval: 1,
        title: {
            text: 'Ranking Position'
        }

    },
    series: series
});

這是我得到的圖。 請注意,僅繪制了一個系列,而未繪制其他系列。 我一直在嘗試做這樣的事情http://www.highcharts.com/stock/demo/compare可能是因為圖表上有很多點嗎? 我嘗試進行dataGrouping,但這沒有用。

任何想法可能是什么原因造成的?

這是一個JSFiddle復制問題

http://jsfiddle.net/4kz7r/

好吧,我想通了。 我不得不將groupingWidthPixels設置得更高。 這是小提琴修復程序。

series: {
    dataGrouping: {
        groupPixelWidth: 50
    }
}
}

http://jsfiddle.net/rHC8h/ :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM