v-charts
v-charts copied to clipboard
Could not set max time in line chart
Hello V-Charts Team,
I am using a dynamic line chart with a time period. I want to set max time for the x axis. In the documentiation it seems to be setting xAxis.max value. But I could not done it. My code is as follows:
<template>
<ve-line :data="chartData" theme-name="dark" :settings="chartSettings" judge-width>
</ve-line>
</template>
<script>
import VeLine from 'v-charts/lib/line.common'
import 'echarts/lib/component/axis'
...
data() {
return {
i: 0,
chartData: {columns: ['date', 'r'], rows: []},
chartSettings: {}
}
}
...
methods: {
...
addData(data) { // this method called from another place
this.chartData.rows.push(data);
if (this.i === 0)
this.extend['xAxis.max'] = '2021-01-29 18:00:00' // this value will be dynamic but for this example set as static
this.i++;
},
}
...
</script>
The pushed data's time format is the same with max time value. When data starts to flow to linechart I want to set max time as in the code.
Is there something I am missing, can you help me to solve this issue?
Best regards, Erhan Saydam