2017-07-29 10 views
1

私は動的データ読み込みのローソク足チャートを持っています。新しいポイントを追加するためにaddPint APIを使用しています。私は私のツールチップにいくつかのカスタムデータを使用する必要があるので、私は以下のようにのようなオブジェクトとしてポイントを設定:HighChartエラー#20を修正するには?

chart.series[0].addPoint({ 
     x: time, 
     low: lowValue, 
     high: highValue, 
     open: openValue, 
     close: closeValue, 
     customParameter: myCustomPramameter 
}); 

が、私は言う、このエラーを取得:Can't add object point configuration to a long data series Highchartsエラー#20:私はしましたhttp://www.highcharts.com/errors/20

をObject構文をArray構文に変更しましたが、私の問題は解決されました。しかし私は、私のツールチップで使用するためにポイントにさらにデータを埋め込むことはできません。 この問題を解決するためにArray構文を使用する方法はありますか?また、ツールチップポイントで使用するためにカスタムデータを埋め込むことはできますか?ここで

が私の現在のチャートオプションで次のチケットによると

chart: { 
    renderTo: 'chart-container', 
    marginRight: 10, 
    zoomType: 'x' 
}, 
title: { 
    text: 'My Chart' 
}, 
xAxis: { 
    type: 'datetime', 
    dateTimeLabelFormats: { 
     day: '%b - %H:%M:%S', 
     second: '%b - %H:%M:%S' 
    } 
}, 
yAxis: { 
    tickInterval: 0.25, 
    opposite: false 
}, 
navigator: { 
    adaptToUpdatedData: false 
}, 
scrollbar: { 
    liveRedraw: false 
}, 
rangeSelector: { 
    buttons: [{ 
     count: 1, 
     type: 'minute', 
     text: '1M' 
    }, { 
     count: 5, 
     type: 'minute', 
     text: '5M' 
    }, { 
     count: 15, 
     type: 'minute', 
     text: '15M' 
    }, { 
     count: 30, 
     type: 'minute', 
     text: '30M' 
    }, { 
     count: 60, 
     type: 'minute', 
     text: '60M' 
    }, { 
     count: 2, 
     type: 'hour', 
     text: '2H' 
    }, { 
     count: 4, 
     type: 'hour', 
     text: '4H' 
    }, { 
     count: 8, 
     type: 'hour', 
     text: '8H' 
    }, { 
     count: 1, 
     type: 'day', 
     text: '1D' 
    }, { 
     count: 2, 
     type: 'day', 
     text: '2D' 
    }, { 
     count: 3, 
     type: 'day', 
     text: '3D' 
    }, { 
     count: 4, 
     type: 'day', 
     text: '4D' 
    }, { 
     count: 5, 
     type: 'day', 
     text: '5D' 
    }, { 
     count: 6, 
     type: 'day', 
     text: '6D' 
    }, { 
     count: 7, 
     type: 'day', 
     text: '7D' 
    }, { 
     type: 'all', 
     text: 'All' 
    }], 
    inputEnabled: false, 
    selected: 0 
}, 
tooltip: { 
    formatter: function (e) { 
     var point = this.points[0].point; 
     return '<div><b>#: </b><span>' + point.barNumber + '</span></div><br /><div><b>Open: </b><span>' + point.open + '</span></div><div><b> Close: </b><span>' + point.close + '</span></div><br /><div><b>High: </b><span>' + point.high + '</span></div><div><b> Low: </b><span>' + point.low + '</span></div><br /><div><b>Custom Param: </b><span>' + point.customParam + '</span></div>' 
    } 
}, 
legend: { 
    enabled: false 
}, 
exporting: { 
    enabled: false 
}, 
series: [ 
    { 
     name: 'My Chart', 
     type: 'candlestick', 
     data: [] 
    }, 
    { 
     name: 'Average', 
     type: 'spline', 
     data: [], 
     marker: { 
      lineWidth: 2, 
      lineColor: Highcharts.getOptions().colors[3], 
      fillColor: 'white' 
     }, 
     color: Highcharts.getOptions().colors[3] 
    }] 

答えて

0

How to embed more data to candlestick HighChart tooltip?

私は設定することでこの制限を無視することができることを発見した、(コメントをフォローアップ) turboThreshold0とします。

プロットオプションに設定する必要があることに注意してください。チャートオプションではありません。

plotOptions: { 
    candlestick: { 
     turboThreshold: 0 
    } 
関連する問題