[Bug] Too many splitlines on time axis
See original GitHub issueVersion
5.3.2
Link to Minimal Reproduction
No response
Steps to Reproduce
option = {
series: [
{ data: [
[ "2022-02-11", "0" ], [ "2022-02-14", "-0.005" ], [ "2022-02-15", "0.286" ], [ "2022-02-16", "0.462" ],
[ "2022-02-17", "0.162" ], [ "2022-02-18", "0.033" ], [ "2022-02-21", "0.033" ], [ "2022-02-22", "-0.128" ],
[ "2022-02-23", "-0.366" ], [ "2022-02-24", "0.104" ], [ "2022-02-25", "0.503" ], [ "2022-02-28", "1.015" ],
[ "2022-03-01", "1.669" ], [ "2022-03-02", "2.689" ], [ "2022-03-03", "2.457" ], [ "2022-03-04", "2.893" ],
[ "2022-03-07", "2.766" ], [ "2022-03-08", "3.595" ], [ "2022-03-09", "2.237" ], [ "2022-03-10", "1.988" ],
[ "2022-03-11", "1.763" ], [ "2022-03-14", "0.519" ], [ "2022-03-15", "0.341" ], [ "2022-03-16", "0.935" ],
[ "2022-03-17", "2.164" ], [ "2022-03-18", "2.457" ], [ "2022-03-21", "2.838" ], [ "2022-03-22", "2.861" ],
[ "2022-03-23", "3.104" ], [ "2022-03-24", "3.158" ], [ "2022-03-25", "3.293" ], [ "2022-03-28", "2.364" ],
[ "2022-03-29", "3.069" ], [ "2022-03-30", "3.033" ], [ "2022-03-31", "2.236" ], [ "2022-04-01", "2.507" ],
[ "2022-04-04", "2.755" ], [ "2022-04-05", "1.842" ], [ "2022-04-06", "1.306" ], [ "2022-04-07", "1.201" ],
[ "2022-04-08", "1.212" ], [ "2022-04-11", "0.738" ], [ "2022-04-12", "1.308" ], [ "2022-04-13", "2.167" ],
[ "2022-04-14", "2.057" ], [ "2022-04-15", "2.057" ], [ "2022-04-18", "2.065" ], [ "2022-04-19", "1.85" ],
[ "2022-04-20", "2.082" ], [ "2022-04-21", "1.307" ], [ "2022-04-22", "0.284" ], [ "2022-04-25", "0.04" ],
[ "2022-04-26", "-0.527" ], [ "2022-04-27", "-0.577" ], [ "2022-04-28", "-0.089" ], [ "2022-04-29", "-0.836" ],
[ "2022-05-02", "-0.727" ], [ "2022-05-03", "-0.647" ], [ "2022-05-04", "0.662" ], [ "2022-05-05", "-0.493" ],
[ "2022-05-06", "-0.844" ], [ "2022-05-09", "-2.828" ], [ "2022-05-10", "-2.779" ], [ "2022-05-11", "-3.038" ]
],
type: "line"
}
],
xAxis: {
type: "time",
axisLine: { show: true },
splitLine: { show: true, lineStyle: { color: "#999" } }
},
yAxis: {
type: "value",
axisLabel: { formatter: "{value}%" },
axisLine: { show: true },
splitLine: { show: false }
}
}
Current Behavior
The splitline at April 29 causes a label overlap.
Also, the chart is difficult to read because splitlines are not distributed at regular time intervals.
Expected Behavior
Suggested solutions
- display splitlines on days or on months, but not both at the same time
- for each month, skip the last splitline on days if too close to month start
Environment
No response
Any additional comments?
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Axis tick auto align on multiaxis · Issue #10928 · apache/echarts
i.e. I have 2 yAxis, but the auto ticks calculation gives me 6 ticks ... The difference creates irregular spacings between the split...
Read more >commits - The Mail Archive
... [Bug] Too many splitlines on time axis GitBox; 2022/09/12 [GitHub] [echarts] StimioAnthonyLeRoy commented on issue #17023: [Bug] Too many splitlines on ......
Read more >Fixing too many ticks — Matplotlib 3.6.2 documentation
One common cause for unexpected tick behavior is passing a list of strings instead of numbers or datetime objects. This can easily happen...
Read more >Confused about interaction between unique count and buckets
One of the fields in my documents is user_id. If I then change the y-axis to do a Count of user_id in that...
Read more >October | 2014 - Off Camber Data
This is what the new graph looks like. Most of the changes are in how it interacts, but you can already see the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can also set
xAxis.minInterval
.The time interval designed in Echarts is decided by
axis.splitNumber
, and when it’s (7.5,16], the tick interval is returned as 7 days. https://github.com/apache/echarts/blob/84b957855ba6fc7f5d81fdd11b58d85f16089998/src/scale/Time.ts#L371-L378 However you can try settingxAxis.minInterval
to one month to show only the month ticks.