Fix null type error

This commit is contained in:
Matthias 2022-08-24 20:49:53 +02:00
parent d6e494ba64
commit ee86dbdf29

View File

@ -496,8 +496,9 @@ export default defineComponent({
}
console.log('chartOptions', chartOptions.value);
candleChart.value.setOption(chartOptions.value);
if (candleChart.value) {
candleChart.value.setOption(chartOptions.value);
}
};
const initializeChartOptions = () => {
@ -653,13 +654,14 @@ export default defineComponent({
: props.sliderPosition.startValue + props.dataset.timeframe_ms * 80,
'yyyy-MM-dd HH:mm:ss',
);
candleChart.value.dispatchAction({
type: 'dataZoom',
dataZoomIndex: 0,
startValue: start,
endValue: end,
});
if (candleChart.value) {
candleChart.value.dispatchAction({
type: 'dataZoom',
dataZoomIndex: 0,
startValue: start,
endValue: end,
});
}
};
// createSignalData(colDate: number, colOpen: number, colBuy: number, colSell: number): void {