Skip to main content

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 streamit_chartjs.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, onHover events.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_chart_js-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_chart_js-0.0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_chart_js-0.0.2.tar.gz.

File metadata

  • Download URL: streamlit_chart_js-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for streamlit_chart_js-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b5cf4f7d0fc1f19e6a59bfb4887cd8c30b047e5b77c9fbde443e9e35903ac076
MD5 ab42f899ff4c1cb25e4fdfe931cdf5f7
BLAKE2b-256 62034e70a0cbcf8aab5622a5f1f6358eefba533a96ab0e5100306fc733584577

See more details on using hashes here.

File details

Details for the file streamlit_chart_js-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_chart_js-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f7d66f0ffa8e53bd7e0f518a1ca6349a89c94fa5e6a0957a6c2020879d466bd
MD5 f174f4a25381d915ddf69128a24f884f
BLAKE2b-256 26070bbf3701fdbaca85bfbbfd8c0ec345f2cfbf9710b19fcd845fc3f2b39535

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page