question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for monthly time axis labels

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xiaoyvrcommented, 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.

1reaction
pissangcommented, Jan 10, 2020

Hi, @maliayas

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for monthly time axis labels · Issue #11997 - GitHub
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...
Read more >
Stata Tip 55: Better Axis Labeling for Time Points and Time ...
The axis labels and the axis ticks need not correspond to each other, and it might be good to have fewer labels than...
Read more >
Make axis labels to display on months in date time axis
In the HeatMap chart, using the showLabelOn property, it is possible to display the axis labels exactly on specific time intervals in date-time...
Read more >
Change axis labels in a chart - Microsoft Support
Right-click the category labels you want to change, and click Select Data. Right-click the category axis and Select Data. In the Horizontal (Category)...
Read more >
Organise X axis labels by month - regardl… - Apple Community
Make sure the date column is not a Header Column and insert a 2D Scatter instead of a 2D Line. Then set the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found