Repository navigation
Closed
Labels
bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.waiting-for: community
Description
Version
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
Metadata
Metadata
Assignees
Labels
bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.waiting-for: community

Activity
jiawulin001 commentedon May 14, 2022
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.echarts/src/scale/Time.ts
Lines 371 to 378 in 84b9578
However you can try setting
xAxis.minIntervalto one month to show only the month ticks.Ovilia commentedon May 16, 2022
You can also set
xAxis.minInterval.teuf22 commentedon May 16, 2022
Thank you for the tips. Great library
StimioAnthonyLeRoy commentedon Sep 12, 2022
What do you put to see only days and to not see the months ?
StimioAnthonyLeRoy commentedon Sep 12, 2022