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

Support for monthly time axis labels #11997

Closed
maliayas opened this issue Jan 8, 2020 · 8 comments
Closed

Support for monthly time axis labels #11997

maliayas opened this issue Jan 8, 2020 · 8 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature. stale Inactive for a long time. Will be closed in 7 days.

Comments

@maliayas
Copy link

maliayas commented Jan 8, 2020

What problem does this feature solve?

When I create a time axis which the values are on a monthly basis, echarts creates labels in Y-M-D format, which I'd expect Y-M format. See this JSFiddle: https://jsfiddle.net/up0hq4zL/

Data is like:

"data": [
    ["2019-01", "400"],
    ["2019-02", "500"],
    ["2019-05", "600"],
]

And the outcome is:

Ekran görüntüsü (2020 01 08, 16_29_32) - Kopya

And this is the proposed look:

Ekran görüntüsü (2020 01 08, 16_29_32)

Normally I could make this happen using the xAxis.axisLabel.formatter function; however the timestamps it receives don't correspond to the first day of each month. For example it receives a timestamp for "2019-03-25" which I wouldn't format as YEAR-MONTH because that would mislocate March tick on the x axis because you'd think a tick would mark the beginning of the month.

@echarts-bot
Copy link

echarts-bot bot commented Jan 8, 2020

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 8, 2020
@pissang
Copy link
Contributor

pissang commented Jan 10, 2020

Hi, @maliayas

I'd suggest using category type axis. And fill the month missing data with value '-'

@maliayas
Copy link
Author

I'll think about that as a workaround, thanks. You may prefer to keep the issue open for future work.

@Ovilia Ovilia closed this as completed Jan 15, 2020
@xiaoyvr
Copy link

xiaoyvr commented Oct 16, 2020

Month is not a fixed interval. using category will not work if we need an accurate axis.
image

I'd suggest to add this kind of support or provide a way to customize the split behavior.

@haskelcurry
Copy link

haskelcurry commented Jan 10, 2021

Hi, I agree to @xiaoyvr , this functionality is quite commonly required. Can this ticket be reopened?

@pissang
Copy link
Contributor

pissang commented Jan 10, 2021

Hi, we've refactored our time axis in 5.0. We will keep this issue open, please let us know if there are other problems.

https://jsfiddle.net/8tkhcvy4/

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

@github-actions github-actions bot added the stale Inactive for a long time. Will be closed in 7 days. label Jan 10, 2023
@github-actions
Copy link
Contributor

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature. stale Inactive for a long time. Will be closed in 7 days.
Projects
None yet
Development

No branches or pull requests

5 participants