Last week at the Streamlit Hackathon I was planning on building an app with some cool chart snippets for you to copy/paste. But then I realized I could just as easily make it into a Streamlit Component
You can’t do that yet, but I’ve been meaning to add it.
I was considering adding support for overlaying lines and/or text onto the charts. Is this what you had in mind?
As a side note, my goal here isn’t to make a comprehensive library where everything is possible but rather one where the most commonly needed things are trivial. I think annotations fit the bill, but I’ll likely stop there. The only other major thing I expect to add are a couple types of common charts that Plost is still missing.
For complex charts you can always copy/paste the Vega-Lite specs from Plost (see the “…” menu next to the chart in the Streamlit UI) and use them as a starting point for further customizations.
I use the plost.line_chart for some stock values, but if i change the stock, the chart will not be updated.
The line_chart from streamlit shows me the new chart, while plost still shows the old chart.
This is happening because the Quartal column is not being interpreted as a date. To fix it, either change the values to actual dates or change to the column type to ordinal.
To interpret as dates:
Make the values look like ISO dates: for example, ‘2020-12-31’ instead of ‘4Q2020’.
Use Altair-style notation to tell Plost that ‘Quartal’ should be interpreted as a temporal axis, by adding ':T" at the end of the column:
plost.bar_chart(
...
bar='Quartal:T',
...
)
To interpret as ordinal: (simpler, but less semantically correct)
Use Altair-style notation to tell Plost that ‘Quartal’ should be interpreted as an ordinal axis, by adding ':O" at the end of the column:
My idea with Plost is to build only the bare minimum, and to send people to Vega-Lite/Altair/Plotly/etc if they want more. And here you’re approaching the boundaries of that bare minimum
But it’s possible to do! (with some caveats around how the legend would behave, etc) You’d have to split your dataframe column into two: one with positive values and another with negatives.
hi thiago! thanks for sharing the repo and documentation.
sorry if this is beyond the bare minimum you reference in other comments. is there a way to graph variables / data that have different scales? would you suggest adjusting the scale before graphing?
i would like to have a line graph of one variable / column that is in the tens and another that is in the hundreds.