Plotly Chart Generator
Description
This package allows the user to quickly generate plotly charts with customized styling and formatting from Pandas dataframes and other data structures with as little as one line of code.
The following chart types can be created:
Bar charts (from dataframe)
Line charts (from dataframe)
Scatter charts (from dictionary)
Pie charts (from lists, numpy arrays, Pandas series)
Histograms (from lists, numpy arrays, Pandas series)
Dot charts (from dataframe)
Box charts (from lists, numpy arrays, Pandas series)
Sunburst charts (from lists, numpy arrays, Pandas series)
Scatter charts subplots (from dictionary)
Pie chats subplots (from dictionary)
Chart examples are available at https://github.com/PrebenHesvik/Plotly-Chart-Generator
Installation
pip install plotly_chart_generator
Usage
from plotly_chart_generator.display_chart import display_chart
from plotly_chart_generator.bar_chart import bar_chart
from plotly_chart_generator.chart_styles import chart_styles
# create data
index = ['Product A', 'Product B', 'Product C']
values = {'Products': [37.5, 40.2, 27.8]}
data = pd.DataFrame(data=values, index=index).transpose()
# layout
layout = chart_styles(
width=500,
height=600,
title='Product sales (millions)',
title_size=16,
xaxis_ticksize=14)
# set colors
idmax = data.idxmax(axis=1)[0]
max_val_idx = data.columns.get_loc(idmax)
colors = ['lightslategray',] * len(data.values[0])
colors[max_val_idx] = 'crimson'
# traces
traces = bar_chart(
df=data,
bar_width=0.4,
textpos='inside',
linewidth=1,
marker_color=colors)
display_chart(traces=traces, layout=layout)
Disclaimer
Most of the descriptions of arguments have been copied form the Plotly Figure Reference Guide at https://plotly.com/python/reference/
Metadata
Release files for plotly-chart-generator 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plotly_chart_generator-0.4.0.tar.gz | 16.1 kB | Without provenance | Details for plotly_chart_generator-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plotly_chart_generator-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for plotly_chart_generator-0.4.0-py3-none-any.whl |
Total release size: 40.5 kB
Release files / plotly_chart_generator-0.4.0.tar.gz
| Download URL | plotly_chart_generator-0.4.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7788083cab75563a921c690b81586be6c47f9269de2ca8f852cb02799b46dd6c
|
|
BLAKE2b-256 checksum How to use checksums |
62f56717ecc9ccb543645adf36929973388e98da85c9757bac060253178cbc07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.0 Windows/10
|
Release files / plotly_chart_generator-0.4.0-py3-none-any.whl
| Download URL | plotly_chart_generator-0.4.0-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc3fdb5391fecb7fa4e74a9e3cbd083a5db1359130fc6944ab73ea3f3126d563
|
|
BLAKE2b-256 checksum How to use checksums |
ccc52cd598ca69cc1b5234aa6aa8f73e09a19d13f227d8483e9a07e912144315
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.0 Windows/10
|
Security for plotly-chart-generator 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.