apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.27k stars 19.61k forks source link

Time axis with gaps #12796

Open junxstudio opened 4 years ago

junxstudio commented 4 years ago

What problem does this feature solve?

We are displaying daily time series data for stock markets, the x-axis (time) is fixed in a day. Take China market as example, we want to show x-axis as 9:30 to 15:00, in addition, 11:30 to 15:00 is noon closing time so it should be skipped in axis.

So far, we haven't found out a way to skip 11:30-13:00 if we use "time" type for x-axis. Seems that no matter if we provide data between 11:30-13:00 or not, the time period can't be skipped.

Is there an API supporting it? Or alternative solution, release plan? Thanks in advance.

What does the proposed API look like?

an API which supports definition of multiple time period for axis.

echarts-bot[bot] commented 4 years ago

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! 🍵

Ovilia commented 4 years ago

"11:30 to 15:00 is noon closing time" Do you mean "11:30 to 13:00"? We are discussing about the interrupted axis like #12790 . This also seems to be a reasonable requirement.

junxstudio commented 4 years ago

@Ovilia thanks. Sorry for the type. I did mean 11:30 to 13:00. I think my request is same as #12790

dsmmcken commented 3 years ago

For reference, plotly.js implements this as "rangebreaks", and is common need for finance charts. https://plotly.com/javascript/reference/layout/xaxis/#layout-xaxis-rangebreaks

For time axis, it would be nice to be able to specify:

  1. Remove gap for certain hours from a day ex. closed 11:30 to 13:00
  2. Remove certain days from week ex. closed Saturday, Sunday
  3. Remove arbitrary ranges, ex. closed for holiday, or half-day holiday
agg23 commented 1 year ago

This would also be very useful in my data, where there are many discontinuities that probably shouldn't appear in the chart.

YassineElbouchaibi commented 1 year ago

This would be helpful for me as well! Are there any workarounds ?

agg23 commented 1 year ago

I don't know how well this scales (I've only tested it with ~500 points), but you can make a category chart and just dump your data in. You'll have to implement a custom xAxis formatter, but that's fairly easy (though you likely lose some optimization here as well).

image

You can still zoom in as you'd expect and view individual points; everything will just be evenly spaced.

nisori commented 11 months ago

I need this feature for several projects, too.