簡體   English   中英

消失的高庫存系列

[英]disappearing highstock series

我在highstock v1.3.10上遇到了一系列消失的問題。 我嘗試將ignoreHiddenSeries設置為false,調整minRange和min / maxPadding,但調整范圍仍會抹掉我的系列之一(稱為raffData,myChart.series [3])

關於如何解決這個問題有什么想法嗎?

問題復制步驟:

  1. 將系列類型更改為階梯線。

  2. 在范圍選擇器中選擇2年

  3. 當以寬屏分辨率顯示時,抽獎頻道會消失(桌面)。

當調整xAxis范圍,重新選擇Candle或ohlc或最小化瀏覽器寬度(chart.reflow設置為true)時,它們將重新出現。

jsfiddle

全屏結果

myChart = new Highcharts.StockChart({
    chart : {
        panning: false,
        ignoreHiddenSeries: false,
        renderTo : 'container',
        alignTicks: false,
        marginLeft : 25
    },

    plotOptions : {
        line : {
            lineWidth : 0.7
        },
        series : {animation : true}
    },

    rangeSelector : {
        inputDateFormat: '%e %b, %Y',
        inputEditDateFormat: '%d/%m/%Y',
        //selected : 1,
        buttons: [{
            type: 'month',
            count: 6,
            text: '6m'
        }, {
            type: 'year',
            count: 1,
            text: '1y'
        }, {
            type: 'year',
            count: 2,
            text: '2y'
        }, {
            type: 'year',
            count: 3,
            text: '3y'
        }, {
            type: 'year',
            count: 5,
            text: '5y'
        },  {
            type: 'year',
            count: 10,
            text: '10y'
        },  {
            type: 'all',
            text: 'All'
        }]
    },

    title : {
        text : getTick
    },

    tooltip : {
        valueDecimals : 2
    },

    navigator : {
        enabled : true
    },          

    yAxis : [{                      
        gridLineWidth : 0.8,
        height : 410
    }],

    series : [{
        type : series_type, // ohlc, candlestick, spline...
        step : true,
        name : getTick,
        data : data,
        lineWidth : 1,
        dataGrouping : {
            enabled : false,
            units : [[
            'week',
                [1]
            ], [
                'month', 
                [1, 2, 3, 4, 6]
            ],[
                'year',
                null
            ]]
        }

    },
    {
        type: 'spline',
        name : 'linReg',
        data : lrData,
        enableMouseTracking : true,
        color : '#F0F0F0',
        dashStyle : 'Dash',
        lineWidth : 1
    },
    {
        type: 'areasplinerange',
        name : 'RaffChannel',
        data : raffData,
        enableMouseTracking : false,
        color : '#839bfc',
        dashStyle : 'Dash',
        fillOpacity : 0.2,
        lineWidth : 1,
        yAxis : 0
    }] //end series
}); //ends chart

沒關系,我通過加載僅包含日期和收盤價的其他隱藏系列來克服了這個問題。

因此,對於線型,樣條線或區域類型,我僅隱藏OHLC系列,並使用setVisible顯示僅封閉系列, 而無需重繪。 通過myChart.get(id)引用該系列是一種指向正確系列的可靠方法。

暫無
暫無

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

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