holoviz / holoviz/hvplot

Document (x/y)formatter and the printf-style

Open
#1,215 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

I've been working on a chat interface for hvPlot. Its already available at Panel-Chat-Examples.

According to https://hvplot.holoviz.org/user_guide/Customization.html the `xformatter` argument should support a `str` argument.

![image](https://github.com/holoviz/hvplot/assets/42288570/eee0d3c4-639d-4de9-9ae1-b5bb156d3c02)

But when I try, the plot does not show and I see errors raised in the browser console.

```python
import pandas as pd
import hvplot.pandas
import bokeh.sampledata

bokeh.sampledata.download()
from bokeh.sampledata.stocks import MSFT

data = pd.DataFrame(MSFT)[60:120]
data["date"] = pd.to_datetime(data["date"])
data = data.sort_values(by="date", ascending=False).head(100)
plot = data.hvplot(
x='date',
y='close',
kind='line',
xformatter='%d-%Y',
xlabel='Date',
ylabel='Closing Price',
title='Closing Price Over Time',
responsive=True,
)
import panel as pn
pn.panel(plot).servable()
```

![image](https://github.com/holoviz/hvplot/assets/42288570/5223984b-f376-4f14-affc-e2ecab6363cc)

If I don't use the `xformatter`, then the plot shows.

```bash
bokeh==3.3.1 holoviews==1.18.1 hvplot==0.9.0 panel==1.3.4
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.