click: function() {
if (!hasPlotLine) {
chart.xAxis[0].addPlotLine({
value: 5.5,
color: '#FF0000',
width: 2,
id: 'plot-line-1'
});
} else {
chart.xAxis[0].removePlotLine('plot-line-1');
}
hasPlotLine = !hasPlotLine;
}
クリックイベントでプロットラインを追加および削除しようとすると、「未定義のプロパティxAxisを読み取れません」というエラーが発生しました