A custom Streamlit component for Chart.js
Project description
My Streamlit Chart Component
Welcome to My Streamlit Chart Component, a versatile charting library designed for the Streamlit framework. This component allows users to quickly and easily create a variety of interactive charts to visualize their data within a Streamlit application.
Installation
To install My Streamlit Chart Component, run the following command:
pip install my-streamlit-chart-component
Usage
After installation, you can use the component in your Streamlit app to render charts. Here's how to get started:
import streamlit as st
from my_streamlit_component.st_chart_component import my_chart_component
# Define your data
data = {
"labels": ["January", "February", "March", "April"],
"datasets": [
{
"label": "My Data",
"data": [10, 20, 30, 40],
# Further dataset properties...
}
],
}
# Render a chart
my_chart_component(data=data, chart_type="bar")
Supported Chart Types
- Bar Chart
- Line Chart
- Doughnut Chart
- Pie Chart
- Radar Chart
Parameters
data: (dict) The data for the chart, structured as per Chart.js documentation.chart_type: (str) The type of chart to display (e.g., 'bar', 'line').title: (str) The title of the chart.legend_position: (str) The position of the chart's legend (e.g., 'top', 'bottom').x_axis_title: (str) The title for the x-axis.y_axis_title: (str) The title for the y-axis.- Additional parameters will be added here...
Future Enhancements (TODO)
- Add axis display toggles to control the visibility of the x-axis and y-axis.
- Implement grid line configuration options.
- Provide chart padding adjustments within the chart area.
- Enable detailed animation options for the chart renderings.
- Offer tooltip configuration for improved interactivity.
- Include aspect ratio control for better layout management.
- Introduce responsive behavior toggles to cater to different display sizes.
- Create predefined and custom color schemes for charts.
- Allow detailed dataset customization for properties like
pointStyle,borderDash, etc. - Enable users to pass custom JavaScript functions for callback hooks such as
onClick,onHoverevents.
Contributing
Contributions to My Streamlit Chart Component are welcome! Please read our contribution guidelines for details on how to submit changes and how to set up a development environment for the project.
Thank you for using My Streamlit Chart Component!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file my_streamlit_component-0.1.1.tar.gz.
File metadata
- Download URL: my_streamlit_component-0.1.1.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a8397e04dd2d14bb4dbd8199facfa43bdff1b5ba1a17db08c75a6c3e2859bd
|
|
| MD5 |
1a37e403499028a829143c8dd1ce8631
|
|
| BLAKE2b-256 |
a8e03b5d336980fc30f16f0a67f12a60dbc78c9703eb9be1feb23d0541ab0633
|
File details
Details for the file my_streamlit_component-0.1.1-py3-none-any.whl.
File metadata
- Download URL: my_streamlit_component-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb1b0454d0a76a5b456c7663494efe07446ee320852ab92c034ab9e8af33736b
|
|
| MD5 |
2988fabf3f875e9032bb5c5e98bd92a1
|
|
| BLAKE2b-256 |
6a4be186ecadaa9405d2c3707717f235965ce3f99bd786d3d6c4a5ae430c565a
|