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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.