Add empty candles at end to allow scroll past

This commit is contained in:
Matthias 2022-06-05 14:46:35 +02:00
parent f8918db078
commit 8b78a87e06

View File

@ -175,12 +175,16 @@ export default defineComponent({
});
}
}
const dataset = props.heikinAshi
? heikinashi(datasetColumns.value, props.dataset.data)
: props.dataset.data.slice();
// Add new rows to end to allow slight "scroll past"
const newArray = Array(dataset[dataset.length - 2].length);
newArray[colDate] = dataset[dataset.length - 1][colDate] + props.dataset.timeframe_ms * 3;
dataset.push(newArray);
const options: EChartsOption = {
dataset: {
source: props.heikinAshi
? heikinashi(datasetColumns.value, props.dataset.data)
: props.dataset.data,
source: dataset,
},
grid: [
{