You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
11th, 12th are not existed in the dataset (simply because they're weekdays/non-trading days), but candlesticks in the chart should be continued, i.e.: the breaks of 11th, 12th should be removed like what highcharts do.
This behaviour should be the default one for OHLC and Candlestick charts, otherwise it will become terrible for real world dataset.
https://codepen.io/mckelvin/pen/ygwMQz is my workaround by using tickvals and ticktext. But there's another problem: nticks doesn't work when tickmode=array as mentioned in docs, there will be too many tick labels if there're too many ticks.
This issue not only happens on dates, but also on other resolutions like 1min, 5min, 1h since the trading session in a day might be 08:00~16:00 (not full 24h). So I think the library should not care about the detailed holidays.
In my opinion - I think it is an overkill to expect Plotly having to retrieve holidays/trading sessions for all instruments. You will also have to handle scenarios where there is multiple calendars (ie a GBP swap).
Most data providers already take into account non-trading days/market sessions into account. That means the data has already been cleaned/adjusted.
The only thing required would be a layout parameter to create an axis that will omit the dates for which no values exist in the timeseries.
Reacted by John Wang, Andrew Clancy, etpinard, Paul Richards, Fealthas, Amol Khanolkar, GitHubLeakedPAN, GitHubLeakedMyautsai and yushaoli
Will the proposed solution simply omit any dates that have no data? It might be the case that we do have a non-holiday day with no data to show as a gap. Will there be a way to accomplish that?
We're actually going to close this issue as "resolved" with the new *axis.rangebreaks attribute available for date axes in the upcoming 1.53 release. If anyone has any additional requests in this vein, I'd ask that they please open a new issue after having had a chance to play with the new version :)
I'll also note that this was a sponsored feature and thank our anonymous sponsor for their generous support of open-source ❤️ 🙏
Activity
mckelvin commentedon Feb 16, 2017
jackparmer commentedon Mar 27, 2017
Current proposal is to either add a new axis type:
type: 'date-no-we'Or a flag for the axis object:
show_weekend: falsecc @jackwluo @cpsievert @santosjorge
Anyone out there interested in sponsoring this one? 🥂
https://plot.ly/products/consulting-and-oem/
(Or even better, submit a PR)
jackluo commentedon Mar 27, 2017
Implement is as a 'financial' flag for axis, since different markets have different holidays
jackparmer commentedon Mar 27, 2017
@jackwluo - That's an interesting point. Can you think of any online reference for which markets respect which holidays?
It looks like mpl and ggplot user have also come across this and have their own workarounds:
ggplot
mpl
jackluo commentedon Mar 27, 2017
Seems like NYTimes has a comprehensive database;
http://markets.on.nytimes.com/research/markets/holidays/holidays.asp?display=market&exchange=LSE
Or individual exchange links below
https://www.nyse.com/markets/hours-calendars
https://www.tsx.com/trading/calendars-and-trading-hours/calendar-and-events
http://www.jpx.co.jp/english/corporate/calendar/
mckelvin commentedon Mar 28, 2017
This issue not only happens on dates, but also on other resolutions like
1min,5min,1hsince the trading session in a day might be 08:00~16:00 (not full 24h). So I think the library should not care about the detailed holidays.SEE ALSO: https://www.tradingview.com
santosjorge commentedon Mar 30, 2017
In my opinion - I think it is an overkill to expect Plotly having to retrieve holidays/trading sessions for all instruments. You will also have to handle scenarios where there is multiple calendars (ie a GBP swap).
Most data providers already take into account non-trading days/market sessions into account. That means the data has already been cleaned/adjusted.
The only thing required would be a layout parameter to create an axis that will omit the dates for which no values exist in the timeseries.
Feng-Zihao commentedon Jun 2, 2017
It's not necessary to retrive all holidays. Every stock market, every country ,may have their own holidays.
Just treat the datetime x_Axis as 'string' instead of 'Date'.
etpinard commentedon Sep 27, 2017
mckelvin commentedon Sep 27, 2017
etpinard commentedon Sep 27, 2017
11 remaining items
gzadigo commentedon Jul 7, 2019
kevinheavey commentedon Sep 19, 2019
JavaScript is outside my wheelhouse but are we looking to incorporate something like d3fc-discontinuous-scale? Live demo here
amresh1495 commentedon Oct 16, 2019
pavitrakumar78 commentedon Jan 12, 2020
mofojed commentedon Feb 4, 2020
Will the proposed solution simply omit any dates that have no data? It might be the case that we do have a non-holiday day with no data to show as a gap. Will there be a way to accomplish that?
(Love the library!)
etpinard commentedon Mar 12, 2020
In
v1.53.0, users will be able to remove non-working days and non-working hours using the newaxis.breaksAPI fortype: 'date'cartesian axes.Some examples:
I'll leave this issue open as some folks here appear to prefer the "date as categories" approach - which is another planned feature of ours.
nicolaskruchten commentedon Mar 31, 2020
We're actually going to close this issue as "resolved" with the new
*axis.rangebreaksattribute available for date axes in the upcoming 1.53 release. If anyone has any additional requests in this vein, I'd ask that they please open a new issue after having had a chance to play with the new version :)I'll also note that this was a sponsored feature and thank our anonymous sponsor for their generous support of open-source ❤️ 🙏