2014-03-30 23 views
0

我被困在了highstock v1.3.10的系列消失問題上。 我已經嘗試設置ignoreHiddenSeries爲false,調整minRange和最小/ maxPadding但調整範圍還是擦掉我的系列之一(稱爲raffData,myChart.series [3])消失的高爐系列

任何想法如何解決這個嗎?

問題再現步驟:

  1. 變化系列類型stepline。在檔位選擇

  2. 選擇2YR

  3. 拉夫通道時在寬屏幕分辨率(桌面)消失。

調整當x軸的範圍,當蠟燭或OHLC被重新選擇時,或當瀏覽器的寬度被最小化(與chart.reflow設置爲true)它們將重新出現。

jsfiddle

fullscreen result

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 
+0

你能簡化一點你的例子嗎?它的代碼700lines .. –

+0

感謝您的響應帕維爾。我已經刪除了腳本,但只能下降到400行以下來產生這個問題。 對於遲到的回覆很抱歉。擔 – danb201268326

回答

0

沒關係,我通過加載額外的隱藏系列僅包含日期和收盤價克服的問題。

所以對於線條,樣條線或區域類型,我只需隱藏OHLC系列並使用setVisible 顯示close-only系列,而不用重繪。參考myChart.get(id)的系列是指向正確系列的可靠方法。