Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] echarts5的x轴type:time,能同时支持echarts 4.9.0的x轴type:time效果么? #20047

Closed
huihui925 opened this issue Jun 18, 2024 · 4 comments

Comments

@huihui925
Copy link

What problem does this feature solve?

期望结果: 希望echarts5版本,能支持旧版的效果。

能解决的问题:
一:echarts 4.9.0版本,设置x轴type:time且设置min和max后。得到的结果:

  1. x坐标轴 时间会自动设置且不会拥挤,文字不会重叠。
  2. echarts内部会根据不同情况,自动设置是精确到年月日或者时分秒等。
    如图:
    image
    image

目前echarts5不知道该如何达到旧版的效果,新功能分级模板的展示格式(无法满足自动根据min-max范围设置格式 且x轴每个刻度保持一致),另外x轴刻度还会重叠 拥挤,设置interval分割来达到不重叠效果,需要计算,感觉也有点问题。

What does the proposed API look like?

希望echarts5版本,能支持旧版的效果

@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Jun 18, 2024
Copy link

echarts-bot bot commented Jun 18, 2024

@huihui925 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Feature] Can the x-axis type:time of echarts5 also support the x-axis type:time effect of echarts 4.9.0?

BODY

What problem does this feature solve?

Expected results: It is hoped that the echarts5 version can support the effects of the old version.

Problems that can be solved:
1: echarts version 4.9.0, after setting x-axis type: time and setting min and max. The results obtained:

  1. The x-axis time will be automatically set without being crowded and the text will not overlap.
  2. echarts will automatically set the accuracy to the year, month, day or hour, minute, and second based on different situations.
    As shown in the picture:
    image
    image

At present, echarts5 does not know how to achieve the effect of the old version. The display format of the new function grading template (cannot automatically set the format according to the min-max range and keep each scale of the x-axis consistent). In addition, the x-axis scales will overlap and be crowded, so set the interval. Segmentation to achieve a non-overlapping effect requires calculation, which seems to be a bit problematic.

What does the proposed API look like?

I hope that the echarts5 version can support the effects of the old version

@Ovilia
Copy link
Contributor

Ovilia commented Jun 19, 2024

#19919 provides a callback that you can decide where to show the ticks for the time axis. This feature is supported since 5.5.1, which is under the process of releasing now. You can use the nightly version or wait for another few weeks for the new release.

@huihui925
Copy link
Author

#19919 provides a callback that you can decide where to show the ticks for the time axis. This feature is supported since 5.5.1, which is under the process of releasing now. You can use the nightly version or wait for another few weeks for the new release.

@Ovilia 感觉不太满足个人要求,如果想要指定min和max 中间刻度自适应 不拥挤重叠,该怎么做呢?

@Ovilia
Copy link
Contributor

Ovilia commented Jun 20, 2024

You can use the formatter in the form of "Cascading Templates" to set different templates according to different time granularity. The interval is calculated automatically by ECharts to make sure more important labels are displayed.

@Ovilia Ovilia added support waiting-for: author topic: axis-time and removed new-feature pending We are not sure about whether this is a bug/new feature. labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants