Skip missing data on timeseries axis (candlestick or in general for timeseries charts)
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 124
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
based on the discussion from the discourse, I would like to suggest a parameter to skip missing datetime records (remove gaps between candles). `df.hvplot.ohlc(skip_missing_data=True)`.
original post: https://discourse.holoviz.org/t/skip-missing-data-on-timeseries-axis/6596/1
```py
import pandas as pd
import hvplot.pandas
from bokeh.sampledata.stocks import MSFT
df = pd.DataFrame(MSFT)[60:121][["open", "high", "low", "close", "date"]]
df["date"] = pd.to_datetime(df["date"])
df = df.set_index("date")
ohlc = df.hvplot.ohlc(skip_missing_data=True)
ohlc
```
Actual chart:

Actual workaround with a lot of unnecessary code (I think) has few disadvantages like plot is aligned on the left side instead of original `df.hvplot.ohlc()` is in the middle of the output cell:
```py
import pandas as pd
import hvplot.pandas
from bokeh.sampledata.stocks import MSFT
import holoviews as hv
from bokeh.io import show
df = pd.DataFrame(MSFT)[60:121][["open", "high", "low", "close", "date"]].reset_index(drop=True)
df["date"] = pd.to_datetime(df["date"])
ohlc = df.hvplot.ohlc()
fig = hv.render(ohlc)
fig.xaxis.major_label_overrides = df["date"].dt.strftime("%m/%d").to_dict()
show(fig)
```
Wanted chart:

*The workaround is not the best. On the x axis you must manually specify the format string, [DatetimeTickFormatter](https://docs.bokeh.org/en/latest/docs/reference/models/formatters.html#bokeh.models.DatetimeTickFormatter) has much more general functionality.*
Contributor guide
Assessment
This issue has not been assessed yet.