[Feature] Show days on Xaxis that are not in the dataset
What problem does this feature solve?
I would like to be able to show all days on the xAxis, even these that do not have an entry in the data. Is that already possible via an option or do I need to add them manually into the data array with 0 value?
What does the proposed API look like?
An option for showing all days on the xAxis
An example would be helpful to clear up any uncertainty about your use case.
As it is I would suggest taking a look at interval or minInterval / maxInterval
['01-01-2024', '03-01-2024', '05-01-2024'] -> dataList for xAxis, I will see only these specific dates, is there a way to show the other dates like '02-01-2024' on the xAxis without adding them manually to the dataList?
Still not a very elaborate example. But from that I am now guessing that you are using axis type 'category'. Here is an example using axis type 'time'.
basically my idea was to have a point for days which are not in the data and to assign them value 0 but I guess that's not possible unless I manually create entries with 0 value in the data array
I dont understand why the solution I provided is not applicable. You can also use the label formatter function to bring the dates into a format of your choice: Example
In your solution, only dates that are in const data are displayed, ['01-01-2024', '03-01-2024', '05-01-2024']
I would like to show all the missing dates from 01-01-2024 to 05-01-2024 like 02-01 or 04-01 with value '0'. So I was wondering whether there's an option to do that but it doesn't look like there is.
an option to do that but it doesn't look like there is.
Correct, ECharts, like any other charting software, does not create data points, just displays them.
NB: 📌 please close issue if problem solved.
same issue I met, when I use duration days as a data value, it seems hard to set every day as label.
I am in bar type
Seems like Echarts, in line mode, is not able to understand a missing time point, it just connects the line.
const data = [ { name: '2024-04-13', value: ['2024-04-13', '100'] }, { name: '2024-04-15', value: ['2024-04-15', '400'] }, { name: '2024-04-17', value: ['2024-04-17', '500'] }, { name: '2024-04-18', value: ['2024-04-18', '600'] }, ];
line type
The ‘bar’ type .
If I display the graph with a line, it would be nice to be able to choose whether or not to connect/disconnect the line.
It would be very nice to solve this similar to how Grafana solves this problem: https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/time-series/#disconnect-values (using never or with a Threshold )