Skip to main content

Quickly display basic Plotly charts based on data inside a Pandas dataframe.

Project description

https://img.shields.io/pypi/l/PlotlyChartGenerator:alt:PyPI-License

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 import PlotlyChart
chart = PlotlyChart()

# 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()


# create chart
color_palette = chart.color_palette()

layout = chart.layout(color_palette=color_palette, width=500, height=400,
                    title='Sales per product (millions)',
                    title_size=16, xaxis_ticksize=14)

chart.bar(data, layout=layout, orientation='v', sort_by='Products',
            ascending=False, bar_width=0.4, textpos='inside', linewidth=1)

Disclaimer

Most of the descriptions of arguments have been copied form the Plotly Figure Reference Guide at https://plotly.com/python/reference/

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

plotly_chart_generator-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

plotly_chart_generator-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file plotly_chart_generator-0.1.0.tar.gz.

File metadata

  • Download URL: plotly_chart_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10

File hashes

Hashes for plotly_chart_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d12edf40b3278983ff3c2e006caef11925c28658513625f7da36412e49e975f1
MD5 3c8376ec84884de66d799d7151fe7a71
BLAKE2b-256 87d02ebc76d328ce5c891af0d0d721234208a07049afd35c079938dd7578a024

See more details on using hashes here.

File details

Details for the file plotly_chart_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plotly_chart_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25a0b49ba9f8e8b505a2fa342176b7bd02710a695b6fabbf9fe20e94c79d3875
MD5 723ddc02ec5b5b9bc07132fd49de8a2c
BLAKE2b-256 4b9faf9b4a819e2ffadcb7902732aa8d91ff88800647c654a2b5b50afdd8bdfc

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