2012-03-01 9 views
0

highsoft(http://highslide.com/)でハイストックを使用しています。高画質にアイテムを再描画するときにスクロールバーのプレビューが消える

私は、ユーザーがグラフの種類(スプライン、ライン、エリアラインなど)を変更できるようにしようとしています。私は、オプションをリセットし、シリーズからアイテムをポップしてシリーズに再追加することでこれをやっています。スクロールバーのプレビューが消えてしまうことを除けば、すべてを再追加するとうまくいきます。どんな助けでも大歓迎です。ここに私のコードだ:

createChart: function(seriesOptions){ 
     var cmp  = this; 
     var chart_type = this.collection.chart_type; 
     if(!chart_type){ 
      chart_type="line"; 
     } 
     if(!cmp.chart){ 
      var options = { 
       chart: { 
        renderTo: 'preview', 
        type: chart_type, 
        zoomType: 'x' 
       }, 

       rangeSelector: { 
        selected: 4 
       }, 
       plotOptions: { 
        series: { 
         point: { 
          events: { 
           click: function() { 
            console.log(this.config[0]); 
           } 
          } 
         } 
        } 
       }, 
       tooltip: { 
        pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>', 
        yDecimals: 2 
       }, 
       series: seriesOptions 
      }; 
      cmp.chart = new Highcharts.StockChart(options); 
     }else{ 
      while(cmp.chart.series.length>0){ 
       cmp.chart.series[0].remove(); 
      } 
      if(cmp.collection.compare_type=='percent'){ 
       cmp.chart.options.plotOptions.series.compare = 'percent'; 
       cmp.chart.options.tooltip.pointFormat = '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>'; 
      }else{ 
       cmp.chart.options.plotOptions.series.compare = undefined; 
       cmp.chart.options.tooltip.pointFormat = '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>'; 
      } 

      _.each(seriesOptions, function(option){ 
       option.type = cmp.collection.chart_type; 
       cmp.chart.addSeries(option, true, false); 
      }); 
      cmp.chart.redraw(); 
      //window.chart = cmp.chart; 
     } 
    }, 

答えて

0

[OK]を、私は「ナビゲーター」はシリーズの項目の一つとなっていることを認識し、私は、whileループでそれを削除...

それを考え出しました。だから、私はちょうど "ナビゲータ"ではないシリーズのすべてのアイテムをポップする必要があります。

関連する問題