├── .gitattributes ├── .github └── workflows │ ├── publish-to-pypi.yml │ └── testing.yml ├── .gitignore ├── .readthedocs.yaml ├── LICENSE ├── MANIFEST.in ├── README.md ├── docs ├── Makefile ├── _misc │ ├── compile.py │ └── examples │ │ ├── chart-1.py │ │ ├── chart-10.py │ │ ├── chart-11.py │ │ ├── chart-12.py │ │ ├── chart-13.py │ │ ├── chart-14.py │ │ ├── chart-15.py │ │ ├── chart-16.py │ │ ├── chart-17.py │ │ ├── chart-18.py │ │ ├── chart-19.py │ │ ├── chart-2.py │ │ ├── chart-20.py │ │ ├── chart-21.py │ │ ├── chart-22.py │ │ ├── chart-23.py │ │ ├── chart-24.py │ │ ├── chart-25.py │ │ ├── chart-26.py │ │ ├── chart-27.py │ │ ├── chart-28.py │ │ ├── chart-29.py │ │ ├── chart-3.py │ │ ├── chart-30.py │ │ ├── chart-31.py │ │ ├── chart-32.py │ │ ├── chart-33.py │ │ ├── chart-34.py │ │ ├── chart-35.py │ │ ├── chart-36.py │ │ ├── chart-37.py │ │ ├── chart-38.py │ │ ├── chart-39.py │ │ ├── chart-4.py │ │ ├── chart-40.py │ │ ├── chart-41.py │ │ ├── chart-42.py │ │ ├── chart-43.py │ │ ├── chart-44.py │ │ ├── chart-45.py │ │ ├── chart-46.py │ │ ├── chart-47.py │ │ ├── chart-48.py │ │ ├── chart-49.py │ │ ├── chart-5.py │ │ ├── chart-50.py │ │ ├── chart-51.py │ │ ├── chart-52.py │ │ ├── chart-53.py │ │ ├── chart-54.py │ │ ├── chart-55.py │ │ ├── chart-56.py │ │ ├── chart-57.py │ │ ├── chart-58.py │ │ ├── chart-59.py │ │ ├── chart-6.py │ │ ├── chart-60.py │ │ ├── chart-61.py │ │ ├── chart-62.py │ │ ├── chart-63.py │ │ ├── chart-64.py │ │ ├── chart-65.py │ │ ├── chart-66.py │ │ ├── chart-7.py │ │ ├── chart-8.py │ │ └── chart-9.py ├── conf.py ├── contents │ ├── API │ │ ├── Chart.rst │ │ ├── Grid.rst │ │ ├── Plot.rst │ │ ├── index.rst │ │ └── utilities │ │ │ ├── heatmap.rst │ │ │ ├── index.rst │ │ │ ├── new.rst │ │ │ ├── plot.rst │ │ │ └── render.rst │ ├── about.rst │ ├── colormaps.rst │ ├── dimensions.rst │ ├── examples │ │ ├── example-1.rst │ │ ├── example-10.rst │ │ ├── example-11.rst │ │ ├── example-12.rst │ │ ├── example-13.rst │ │ ├── example-14.rst │ │ ├── example-15.rst │ │ ├── example-16.rst │ │ ├── example-17.rst │ │ ├── example-18.rst │ │ ├── example-19.rst │ │ ├── example-2.rst │ │ ├── example-20.rst │ │ ├── example-21.rst │ │ ├── example-22.rst │ │ ├── example-23.rst │ │ ├── example-24.rst │ │ ├── example-27.rst │ │ ├── example-28.rst │ │ ├── example-3.rst │ │ ├── example-30.rst │ │ ├── example-31.rst │ │ ├── example-33.rst │ │ ├── example-34.rst │ │ ├── example-35.rst │ │ ├── example-36.rst │ │ ├── example-37.rst │ │ ├── example-38.rst │ │ ├── example-39.rst │ │ ├── example-4.rst │ │ ├── example-40.rst │ │ ├── example-41.rst │ │ ├── example-5.rst │ │ ├── example-6.rst │ │ ├── example-7.rst │ │ └── index.rst │ ├── introduction.rst │ ├── plotting-with-pandas.rst │ ├── rendering.rst │ ├── streamlit.rst │ └── themes.rst ├── fragments │ └── badges.rst ├── index.rst ├── make.bat ├── requirements.txt └── static │ ├── charts │ ├── chart-1.json │ ├── chart-10.json │ ├── chart-11.json │ ├── chart-12.json │ ├── chart-13.json │ ├── chart-14.json │ ├── chart-15.json │ ├── chart-16.json │ ├── chart-17.json │ ├── chart-18.json │ ├── chart-19.json │ ├── chart-2.json │ ├── chart-20.json │ ├── chart-21.json │ ├── chart-22.json │ ├── chart-23.json │ ├── chart-24.json │ ├── chart-25.json │ ├── chart-26.json │ ├── chart-27.json │ ├── chart-28.json │ ├── chart-29.json │ ├── chart-3.json │ ├── chart-30.json │ ├── chart-31.json │ ├── chart-32.json │ ├── chart-33.json │ ├── chart-34.json │ ├── chart-35.json │ ├── chart-36.json │ ├── chart-37.json │ ├── chart-38.json │ ├── chart-39.json │ ├── chart-4.json │ ├── chart-40.json │ ├── chart-41.json │ ├── chart-42.json │ ├── chart-43.json │ ├── chart-44.json │ ├── chart-45.json │ ├── chart-46.json │ ├── chart-47.json │ ├── chart-48.json │ ├── chart-49.json │ ├── chart-5.json │ ├── chart-50.json │ ├── chart-51.json │ ├── chart-52.json │ ├── chart-53.json │ ├── chart-54.json │ ├── chart-55.json │ ├── chart-56.json │ ├── chart-57.json │ ├── chart-58.json │ ├── chart-59.json │ ├── chart-6.json │ ├── chart-60.json │ ├── chart-61.json │ ├── chart-62.json │ ├── chart-63.json │ ├── chart-64.json │ ├── chart-65.json │ ├── chart-66.json │ ├── chart-7.json │ ├── chart-8.json │ └── chart-9.json │ ├── colormaps │ ├── accent.png │ ├── afmhot.png │ ├── autumn.png │ ├── binary.png │ ├── blues.png │ ├── bone.png │ ├── brbg.png │ ├── brg.png │ ├── bugn.png │ ├── bupu.png │ ├── bwr.png │ ├── cividis.png │ ├── cmrmap.png │ ├── cool.png │ ├── coolwarm.png │ ├── copper.png │ ├── cubehelix.png │ ├── dark2.png │ ├── flag.png │ ├── gist_earth.png │ ├── gist_gray.png │ ├── gist_heat.png │ ├── gist_ncar.png │ ├── gist_rainbow.png │ ├── gist_stern.png │ ├── gist_yarg.png │ ├── gnbu.png │ ├── gnuplot.png │ ├── gnuplot2.png │ ├── gray.png │ ├── greens.png │ ├── greys.png │ ├── hot.png │ ├── hsv.png │ ├── inferno.png │ ├── jet.png │ ├── magma.png │ ├── nipy_spectral.png │ ├── ocean.png │ ├── oranges.png │ ├── orrd.png │ ├── paired.png │ ├── pastel1.png │ ├── pastel2.png │ ├── pink.png │ ├── piyg.png │ ├── plasma.png │ ├── prgn.png │ ├── prism.png │ ├── pubu.png │ ├── pubugn.png │ ├── puor.png │ ├── purd.png │ ├── purples.png │ ├── rainbow.png │ ├── rdbu.png │ ├── rdgy.png │ ├── rdpu.png │ ├── rdylbu.png │ ├── rdylgn.png │ ├── reds.png │ ├── seismic.png │ ├── set1.png │ ├── set2.png │ ├── set3.png │ ├── spectral.png │ ├── spring.png │ ├── summer.png │ ├── tab10.png │ ├── tab20.png │ ├── tab20b.png │ ├── tab20c.png │ ├── terrain.png │ ├── turbo.png │ ├── twilight.png │ ├── twilight_shifted.png │ ├── viridis.png │ ├── winter.png │ ├── wistia.png │ ├── ylgn.png │ ├── ylgnbu.png │ ├── ylorbr.png │ └── ylorrd.png │ ├── demo (1).svg │ ├── index-eefeb6a3.js │ ├── logo.svg │ └── style.css ├── easychart ├── __init__.py ├── colormaps │ ├── __init__.py │ ├── accent.json │ ├── afmhot.json │ ├── autumn.json │ ├── binary.json │ ├── blues.json │ ├── bone.json │ ├── brbg.json │ ├── brg.json │ ├── bugn.json │ ├── bupu.json │ ├── bwr.json │ ├── cividis.json │ ├── cmrmap.json │ ├── cool.json │ ├── coolwarm.json │ ├── copper.json │ ├── cubehelix.json │ ├── dark2.json │ ├── flag.json │ ├── gist_earth.json │ ├── gist_gray.json │ ├── gist_heat.json │ ├── gist_ncar.json │ ├── gist_rainbow.json │ ├── gist_stern.json │ ├── gist_yarg.json │ ├── gnbu.json │ ├── gnuplot.json │ ├── gnuplot2.json │ ├── gray.json │ ├── greens.json │ ├── greys.json │ ├── hot.json │ ├── hsv.json │ ├── inferno.json │ ├── jet.json │ ├── magma.json │ ├── nipy_spectral.json │ ├── ocean.json │ ├── oranges.json │ ├── orrd.json │ ├── paired.json │ ├── pastel1.json │ ├── pastel2.json │ ├── pink.json │ ├── piyg.json │ ├── plasma.json │ ├── prgn.json │ ├── prism.json │ ├── pubu.json │ ├── pubugn.json │ ├── puor.json │ ├── purd.json │ ├── purples.json │ ├── rainbow.json │ ├── rdbu.json │ ├── rdgy.json │ ├── rdpu.json │ ├── rdylbu.json │ ├── rdylgn.json │ ├── reds.json │ ├── seismic.json │ ├── set1.json │ ├── set2.json │ ├── set3.json │ ├── spectral.json │ ├── spring.json │ ├── summer.json │ ├── tab10.json │ ├── tab20.json │ ├── tab20b.json │ ├── tab20c.json │ ├── terrain.json │ ├── turbo.json │ ├── twilight.json │ ├── twilight_shifted.json │ ├── viridis.json │ ├── winter.json │ ├── wistia.json │ ├── ylgn.json │ ├── ylgnbu.json │ ├── ylorbr.json │ └── ylorrd.json ├── config.py ├── datasets │ ├── S&P500.csv │ ├── __init__.py │ ├── diamonds.csv │ ├── electricity.csv │ ├── olympics.csv │ ├── populations.csv │ ├── stocks.csv │ └── unemployment.csv ├── encoders.py ├── extensions │ ├── __init__.py │ └── racechart │ │ ├── __init__.py │ │ └── template.jinja ├── internals.py ├── ipynb.py ├── models │ ├── __init__.py │ ├── chart.py │ ├── grid.py │ ├── plot.py │ └── series.py ├── rendering.py ├── template.jinja └── themes │ ├── 538.json │ ├── __init__.py │ ├── alone.json │ ├── bloom.json │ ├── db.json │ ├── easychart.json │ ├── economist.json │ ├── elementary.json │ ├── ffx.json │ ├── flat.json │ ├── flatdark.json │ ├── ft.json │ ├── ggplot2.json │ ├── google.json │ ├── highcharts.json │ ├── monokai.json │ ├── null.json │ ├── smpl.json │ ├── superheroes.json │ ├── tufte.json │ └── tufte2.json ├── pytest.ini ├── requirements.txt ├── setup.py └── tests ├── __init__.py ├── conftest.py ├── regression-tests ├── README.md ├── conftest.py ├── data │ ├── chart-1.regtest.json │ ├── chart-10.regtest.json │ ├── chart-11.regtest.json │ ├── chart-12.regtest.json │ ├── chart-13.regtest.json │ ├── chart-14.regtest.json │ ├── chart-15.regtest.json │ ├── chart-17.regtest.json │ ├── chart-18.regtest.json │ ├── chart-19.regtest.json │ ├── chart-2.regtest.json │ ├── chart-20.regtest.json │ ├── chart-21.regtest.json │ ├── chart-22.regtest.json │ ├── chart-23.regtest.json │ ├── chart-24.regtest.json │ ├── chart-25.regtest.json │ ├── chart-26.regtest.json │ ├── chart-27.regtest.json │ ├── chart-28.regtest.json │ ├── chart-29.regtest.json │ ├── chart-3.regtest.json │ ├── chart-30.regtest.json │ ├── chart-31.regtest.json │ ├── chart-32.regtest.json │ ├── chart-33.regtest.json │ ├── chart-34.regtest.json │ ├── chart-35.regtest.json │ ├── chart-36.regtest.json │ ├── chart-37.regtest.json │ ├── chart-38.regtest.json │ ├── chart-39.regtest.json │ ├── chart-40.regtest.json │ ├── chart-41.regtest.json │ ├── chart-42.regtest.json │ ├── chart-43.regtest.json │ ├── chart-44.regtest.json │ ├── chart-45.regtest.json │ ├── chart-46.regtest.json │ ├── chart-47.regtest.json │ ├── chart-48.regtest.json │ ├── chart-49.regtest.json │ ├── chart-5.regtest.json │ ├── chart-50.regtest.json │ ├── chart-51.regtest.json │ ├── chart-52.regtest.json │ ├── chart-53.regtest.json │ ├── chart-54.regtest.json │ ├── chart-55.regtest.json │ ├── chart-56.regtest.json │ ├── chart-57.regtest.json │ ├── chart-58.regtest.json │ ├── chart-59.regtest.json │ ├── chart-6.regtest.json │ ├── chart-7.regtest.json │ ├── chart-8.regtest.json │ └── chart-9.regtest.json └── tests │ ├── chart-1.py │ ├── chart-10.py │ ├── chart-11.py │ ├── chart-12.py │ ├── chart-13.py │ ├── chart-14.py │ ├── chart-15.py │ ├── chart-17.py │ ├── chart-18.py │ ├── chart-19.py │ ├── chart-2.py │ ├── chart-20.py │ ├── chart-21.py │ ├── chart-22.py │ ├── chart-23.py │ ├── chart-24.py │ ├── chart-25.py │ ├── chart-26.py │ ├── chart-27.py │ ├── chart-28.py │ ├── chart-29.py │ ├── chart-3.py │ ├── chart-30.py │ ├── chart-31.py │ ├── chart-32.py │ ├── chart-33.py │ ├── chart-34.py │ ├── chart-35.py │ ├── chart-36.py │ ├── chart-37.py │ ├── chart-38.py │ ├── chart-39.py │ ├── chart-40.py │ ├── chart-41.py │ ├── chart-42.py │ ├── chart-43.py │ ├── chart-44.py │ ├── chart-45.py │ ├── chart-46.py │ ├── chart-47.py │ ├── chart-48.py │ ├── chart-49.py │ ├── chart-5.py │ ├── chart-50.py │ ├── chart-51.py │ ├── chart-52.py │ ├── chart-53.py │ ├── chart-54.py │ ├── chart-55.py │ ├── chart-56.py │ ├── chart-57.py │ ├── chart-58.py │ ├── chart-59.py │ ├── chart-6.py │ ├── chart-7.py │ ├── chart-8.py │ └── chart-9.py └── unit-tests ├── encoders.py ├── extensions └── __init__.py ├── functions.py ├── internals.py └── models.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/publish-to-pypi.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | workflow_dispatch: 15 | 16 | permissions: 17 | contents: read 18 | 19 | jobs: 20 | deploy: 21 | 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - uses: actions/checkout@v3 26 | - name: Set up Python 27 | uses: actions/setup-python@v3 28 | with: 29 | python-version: '3.x' 30 | - name: Install dependencies 31 | run: | 32 | python -m pip install --upgrade pip 33 | pip install build 34 | - name: Build package 35 | run: python -m build 36 | - name: Publish package 37 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 38 | with: 39 | user: __token__ 40 | password: ${{ secrets.PYPI_API_TOKEN }} 41 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | version: 2 6 | 7 | build: 8 | os: "ubuntu-22.04" 9 | tools: 10 | python: "3.11" 11 | 12 | # Build documentation in the docs/ directory with Sphinx 13 | sphinx: 14 | configuration: docs/conf.py 15 | 16 | python: 17 | install: 18 | - requirements: docs/requirements.txt 19 | - requirements: requirements.txt 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-24 David Schenck 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include easychart/template.jinja 2 | include easychart/datasets/* 3 | include easychart/themes/* 4 | include easychart/colormaps/* 5 | include easychart/extensions/racechart/template.jinja -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_misc/compile.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | import os 3 | 4 | os.chdir(os.path.dirname(os.path.realpath(__file__))) 5 | 6 | import sys 7 | 8 | sys.path.append("../../../easychart") # add the easychart path 9 | 10 | import re 11 | import json 12 | import easychart 13 | 14 | directory = os.path.join(os.path.dirname(os.path.realpath(__file__)), "examples") 15 | 16 | for filename in os.listdir(directory): 17 | if not filename.endswith(".py"): 18 | continue 19 | 20 | with open(os.path.join(directory, filename), "r") as file: 21 | contents = file.read().strip() 22 | contents += "\n" 23 | contents += f"chart.save(\"../static/charts/{filename.replace('py','json')}\", indent=4)" 24 | try: 25 | exec(contents) 26 | except Exception as e: 27 | print(f"Error compiling {filename} ({e})") 28 | 29 | # run the make html 30 | os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) 31 | os.system("make clean") 32 | os.system("make html") 33 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-1.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.title = "France Olympic medals" 5 | chart.subtitle = "by year and by medal class" 6 | chart.categories = ["Gold", "Silver", "Bronze"] 7 | chart.yAxis.title.text = "medals" 8 | chart.plot([7, 16, 18], name=2008) 9 | chart.plot([11, 11, 13], name=2012) 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-10.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # data is a pd.DataFrame with world population by continent 4 | # in 1950, 2017, 2030, 2050 and 2100 5 | data = easychart.datasets.load("populations") 6 | 7 | chart = easychart.new() 8 | chart.title = "Distribution of world population by continent" 9 | chart.subtitle = "UN World Population Prospect (2017)" 10 | chart.stacking = "percent" 11 | chart.yAxis.labels.format = "{value}%" 12 | chart.tooltip = ("shared", "{value:.1}%") 13 | for column in data.columns[::-1]: 14 | chart.plot(data[column], index=data.index, type="area", marker=False) 15 | chart.vband( 16 | 2020, 17 | 2100, 18 | color="rgba(200,200,200,0.2)", 19 | zIndex=20, 20 | label={"text": "forecast", "style": {"color": "white"}}, 21 | ) 22 | chart 23 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-11.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | # data is a pd.DataFrame of stock prices 5 | data = easychart.datasets.load("stocks") 6 | data = data[:"20200430"].resample("M").last().pct_change()[1:] 7 | 8 | stats = 100 * pd.concat( 9 | [ 10 | data.quantile(0.10).rename("10%"), 11 | data.quantile(0.25).rename("25%"), 12 | data.quantile(0.75).rename("75%"), 13 | data.quantile(0.90).rename("90%"), 14 | data.iloc[-1].rename("last"), 15 | ], 16 | axis=1, 17 | ) 18 | 19 | chart = easychart.new() 20 | chart.title = "Normal monthly stock movements" 21 | chart.subtitle = ( 22 | "April 2020 change vs 10% and 25% quantile percentage changes since 2003" 23 | ) 24 | chart.categories = stats.index 25 | chart.yAxis.labels.format = "{value}%" 26 | chart.tooltip = ("shared", "{value:.1}%") 27 | chart.plotOptions.columnrange.grouping = False 28 | chart.plotOptions.line.states.hover.enabled = False 29 | chart.plot( 30 | zip(stats["10%"], stats["90%"]), 31 | name="10%-90% range", 32 | type="columnrange", 33 | color="rgba(20, 20, 20, 0.1)", 34 | ) 35 | chart.plot( 36 | zip(stats["25%"], stats["75%"]), 37 | name="25%-75% range", 38 | type="columnrange", 39 | color="rgba(20, 20, 20, 0.3)", 40 | ) 41 | chart.plot(stats["last"], name="April 2020", lineWidth=0, allowPointSelect=False) 42 | 43 | chart 44 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-12.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | [0, 15], 5 | [10, -50], 6 | [20, -56.5], 7 | [30, -46.5], 8 | [40, -22.1], 9 | [50, -2.5], 10 | [60, -27.7], 11 | [70, -55.7], 12 | [80, -76.5], 13 | ] 14 | 15 | chart = easychart.new() 16 | chart.title = "Atmosphere Temperature by Altitude" 17 | chart.subtitle = "According to the Standard Atmosphere Model" 18 | chart.chart = {"type": "spline", "inverted": True} 19 | 20 | with chart.xAxis as axis: 21 | axis.reversed = False 22 | axis.title.text = "Altitude" 23 | axis.labels.format = "{value} km" 24 | 25 | with chart.yAxis as axis: 26 | axis.labels.format = "{value}°" 27 | axis.title.text = "Temperature" 28 | axis.title.rotation = 0 29 | 30 | chart.tooltip.headerFormat = "{series.name}
" 31 | chart.tooltip.pointFormat = "{point.x} km: {point.y}°C" 32 | 33 | chart.legend.enabled = False 34 | chart.append(data, name="temperature") 35 | chart 36 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-13.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new(tooltip="shared") 4 | chart.title = "Average Monthly Temperature and Rainfall in Tokyo" 5 | chart.subtitle = "Source: WorldClimate.com" 6 | chart.categories = [ 7 | "Jan", 8 | "Feb", 9 | "Mar", 10 | "Apr", 11 | "May", 12 | "Jun", 13 | "Jul", 14 | "Aug", 15 | "Sep", 16 | "Oct", 17 | "Nov", 18 | "Dec", 19 | ] 20 | 21 | # add two axes 22 | chart.yAxis.append(title={"text": "Temperature"}, labels={"format": "{value}°C"}) 23 | chart.yAxis.append( 24 | title={"text": "Rainfall"}, labels={"format": "{value} mm"}, opposite=True 25 | ) 26 | 27 | chart.plot( 28 | [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], 29 | name="Rainfall", 30 | type="column", 31 | yAxis=1, 32 | tooltip={"valueSuffix": "mm"}, 33 | ) 34 | chart.plot( 35 | [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], 36 | name="Temperature", 37 | type="spline", 38 | yAxis=0, 39 | tooltip={"valueSuffix": "°C"}, 40 | ) 41 | chart 42 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-14.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # min, Q1, median, Q3, max 4 | data = [ 5 | [760, 801, 848, 895, 965], 6 | [733, 853, 939, 980, 1080], 7 | [714, 762, 817, 870, 918], 8 | [724, 802, 806, 871, 950], 9 | [834, 836, 864, 882, 910], 10 | ] 11 | 12 | chart = easychart.new(type="boxplot") 13 | chart.categories = ["A", "B", "C", "D", "E"] 14 | chart.plot(data, name="distribution of values") 15 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-15.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new() 4 | chart.chart.type = "line" 5 | chart.chart.polar = True 6 | chart.categories = [ 7 | "Sales", 8 | "Marketing", 9 | "Development", 10 | "Support", 11 | "Technology", 12 | "Administration", 13 | ] 14 | chart.plot( 15 | [43000, 19000, 60000, 35000, 17000, 10000], pointPlacement="on", name="budget" 16 | ) 17 | chart.plot( 18 | [50000, 39000, 42000, 31000, 26000, 14000], pointPlacement="on", name="actual" 19 | ) 20 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-16.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import random 3 | 4 | x = [random.random() for _ in range(100)] 5 | y = [-5 + 7.5 * i + random.random() for i in x] 6 | 7 | chart = easychart.new() 8 | chart.plot(y, index=x, type="scatter") 9 | chart.regress(y, x) 10 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-17.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | [-9.9, 10.3], 5 | [-8.6, 8.5], 6 | [-10.2, 11.8], 7 | [-1.7, 12.2], 8 | [-0.6, 23.1], 9 | [3.7, 25.4], 10 | [6.0, 26.2], 11 | [6.7, 21.4], 12 | [3.5, 19.5], 13 | [-1.3, 16.0], 14 | [-8.7, 9.4], 15 | [-9.0, 8.6], 16 | ] 17 | 18 | chart = easychart.new("columnrange") 19 | chart.title = "Temperature variation by month" 20 | chart.subtitle = "Observed in Vik i Sogn, Norway, 2017" 21 | chart.tooltip = "{value}°C" 22 | chart.yAxis.title.text = "Temperature ( °C )" 23 | chart.legend = False 24 | chart.inverted = True 25 | chart.categories = [ 26 | "Jan", 27 | "Feb", 28 | "Mar", 29 | "Apr", 30 | "May", 31 | "Jun", 32 | "Jul", 33 | "Aug", 34 | "Sep", 35 | "Oct", 36 | "Nov", 37 | "Dec", 38 | ] 39 | chart.plot(data, name="Temperature") 40 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-18.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import easychart 3 | 4 | data = pd.DataFrame( 5 | [ 6 | [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], 7 | [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8], 8 | ], 9 | index=["Tokyo", "London"], 10 | columns=[ 11 | "Jan", 12 | "Feb", 13 | "Mar", 14 | "Apr", 15 | "May", 16 | "Jun", 17 | "Jul", 18 | "Aug", 19 | "Sep", 20 | "Oct", 21 | "Nov", 22 | "Dec", 23 | ], 24 | ) 25 | 26 | chart = easychart.new("line") 27 | chart.title = "Monthly Average Temperature" 28 | chart.subtitle = "Source: WorldClimate.com" 29 | chart.categories = data.columns 30 | chart.yAxis.title.text = "Temperature (°C)" 31 | for city in data.index: 32 | chart.plot(data.loc[city], name=city, labels="{point.y}°C") 33 | chart 34 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-19.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # some data 4 | data = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] 5 | 6 | chart = easychart.new("line") 7 | chart.title = "Logarithmic series" 8 | chart.yAxis.type = "logarithmic" 9 | chart.plot(data) 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-2.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # data is a pd.Series of the US unemployment rate 4 | data = easychart.datasets.load("unemployment") 5 | 6 | chart = easychart.new(datetime=True, title="US unemployment rate", zoom="x") 7 | chart.subtitle = "Source: Federal Reserve (FRED)" 8 | chart.yAxis.labels.format = "{value}%" 9 | chart.plot(data, name="unemployment rate") 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-20.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.stacked = True 5 | chart.title = "Total fruit consumption, grouped by gender" 6 | chart.categories = ["Apples", "Oranges", "Pears", "Grapes", "Bananas"] 7 | with chart.yAxis as axis: 8 | axis.allowDecimals = False 9 | axis.min = 0 10 | axis.title.text = "Number of fruits" 11 | chart.tooltip = "{value:.0f}" 12 | chart.plot([5, 3, 4, 7, 2], name="John", stack="male") 13 | chart.plot([3, 4, 4, 2, 5], name="Joe", stack="male") 14 | chart.plot([2, 5, 6, 2, 1], name="Jane", stack="female") 15 | chart.plot([3, 0, 4, 4, 3], name="Janet", stack="female") 16 | chart 17 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-23.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | data = pd.DataFrame( 5 | [ 6 | [107, 31, 635, 203, 2], 7 | [133, 156, 947, 408, 6], 8 | [814, 841, 3714, 727, 31], 9 | [1216, 1001, 4436, 738, 40], 10 | ], 11 | index=[1800, 1900, 2000, 2016], 12 | columns=["Africa", "America", "Asia", "Europe", "Oceania"], 13 | ) 14 | 15 | chart = easychart.new("bar") 16 | chart.title = "Historic World Population by Region" 17 | chart.subtitle = ( 18 | "Source: Wikipedia.org" 19 | ) 20 | chart.categories = data.columns 21 | chart.yAxis.title = {"text": "Population (millions)", "align": "high"} 22 | chart.tooltip = "{value:.0f}m" 23 | for year in data.index: 24 | chart.plot(data.loc[year], name=year, datalabels=(year == 2016)) 25 | chart 26 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-24.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import datetime 3 | 4 | # fancy fibonacci one-liner 5 | fib = lambda x: 1 if x < 2 else fib(x - 1) + fib(x - 2) 6 | 7 | x = [datetime.time(x) for x in range(14)] 8 | y = [fib(x + 1) for x in range(14)] 9 | 10 | chart = easychart.new(datetime=True) 11 | chart.plot(y, index=x, name="example") 12 | chart 13 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-25.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import datetime 3 | 4 | # fancy fibonacci one-liner 5 | fib = lambda x: 1 if x < 2 else fib(x - 1) + fib(x - 2) 6 | 7 | x = [datetime.time(x) for x in range(14)] 8 | y = [fib(x + 1) for x in range(14)] 9 | 10 | chart = easychart.new(datetime=True) 11 | chart.xAxis.labels.format = "{value:%H:%M}" 12 | chart.tooltip.xDateFormat = "%H:%M" 13 | chart.plot(y, index=x, name="another example") 14 | chart 15 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-26.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | labels = ["O", "A", "B", "AB"] 4 | values = [45, 40, 11, 4] 5 | 6 | chart = easychart.new("pie", title="Distribution of blood type in the US") 7 | chart.subtitle = "Source: American Red Cross" 8 | chart.tooltip = "{point.percentage:.0f}%" 9 | chart.plot(values, index=labels, labels="{point.name} ({point.y}%)") 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-27.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["Brazil", "Portugal", 5], 5 | ["Brazil", "France", 1], 6 | ["Canada", "Portugal", 1], 7 | ["Canada", "France", 5], 8 | ["Mexico", "Portugal", 1], 9 | ["Mexico", "France", 1], 10 | ["USA", "Portugal", 1], 11 | ["USA", "France", 1], 12 | ["Portugal", "Angola", 2], 13 | ["Portugal", "Senegal", 1], 14 | ["France", "Angola", 1], 15 | ["France", "Senegal", 3], 16 | ["Spain", "Senegal", 1], 17 | ["Spain", "Morocco", 3], 18 | ["England", "Morocco", 2], 19 | ["England", "South Africa", 7], 20 | ["South Africa", "China", 5], 21 | ["Angola", "Japan", 3], 22 | ["Senegal", "India", 1], 23 | ["Senegal", "Japan", 3], 24 | ["Mali", "India", 1], 25 | ["Morocco", "India", 1], 26 | ["Morocco", "Japan", 3], 27 | ] 28 | 29 | chart = easychart.new(type="sankey") 30 | chart.title = "Sankey diagram" 31 | chart.subtitle = ( 32 | "Flow diagram in which the width of the arrows is proportional to the flow rate" 33 | ) 34 | chart.plot(data, keys=["from", "to", "weight"]) 35 | chart 36 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-28.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["Austria", 69, 82], 5 | ["Belgium", 70, 81], 6 | ["Bulgaria", 69, 75], 7 | ["Croatia", 65, 78], 8 | ["Cyprus", 70, 81], 9 | ["Czech Republic", 70, 79], 10 | ["Denmark", 72, 81], 11 | ["Estonia", 68, 78], 12 | ["Finland", 69, 81], 13 | ["France", 70, 83], 14 | ["Greece", 68, 81], 15 | ["Spain", 69, 83], 16 | ["Netherlands", 73, 82], 17 | ["Ireland", 70, 82], 18 | ["Lithuania", 70, 75], 19 | ["Luxembourg", 68, 83], 20 | ["Latvia", 70, 75], 21 | ["Malta", 69, 82], 22 | ["Germany", 69, 81], 23 | ["Poland", 68, 78], 24 | ["Portugal", 63, 81], 25 | ["Romania", 66, 75], 26 | ["Slovakia", 70, 77], 27 | ["Slovenia", 69, 81], 28 | ["Sweden", 73, 82], 29 | ["Hungary", 68, 76], 30 | ["Italy", 69, 83], 31 | ["UK", 71, 81], 32 | ] 33 | 34 | chart = easychart.new(type="dumbbell") 35 | chart.title = "Change in Life Expectancy" 36 | chart.subtitle = "1960 vs 2018" 37 | chart.chart.inverted = True 38 | chart.xAxis.type = "category" 39 | chart.yAxis.title.text = "Life expectancy (years)" 40 | chart.plot(data, keys=["name", "low", "high"], legend=False) 41 | chart 42 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-29.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | {"name": "Chrome", "y": 61.41, "sliced": True}, 5 | {"name": "Internet Explorer", "y": 11.84}, 6 | {"name": "Firefox", "y": 10.85}, 7 | {"name": "Edge", "y": 4.67}, 8 | {"name": "Safari", "y": 4.18}, 9 | {"name": "Other", "y": 7.05}, 10 | ] 11 | 12 | chart = easychart.new("pie") 13 | chart.title = "Browser market shares in January, 2018" 14 | chart.tooltip = "{point.name}: {point.percentage:.1f}%" 15 | chart.plot(data, name="browser") 16 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-3.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | labels = ["O", "A", "B", "AB"] 4 | values = [45, 40, 11, 4] 5 | 6 | chart = easychart.new("pie", title="Distribution of blood type in the US") 7 | chart.subtitle = "Source: American Red Cross" 8 | chart.tooltip = "{point.percentage:.0f}%" 9 | chart.plot([{"name": label, "y": value} for label, value in zip(labels, values)]) 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-30.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("pie") 4 | chart.plot( 5 | [ 6 | ["Chrome", 58.9], 7 | ["Firefox", 13.29], 8 | ["Internet Explorer", 13], 9 | ["Edge", 3.78], 10 | ["Safari", 3.42], 11 | ["Safari", 7.61], 12 | ], 13 | innerSize="50%", 14 | ) 15 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-31.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["Chrome", 58.9], 5 | ["Firefox", 13.29], 6 | ["Internet Explorer", 13], 7 | ["Edge", 3.78], 8 | ["Safari", 3.42], 9 | ["Safari", 7.61], 10 | ] 11 | 12 | chart = easychart.new("pie") 13 | chart.plot(data) 14 | 15 | with chart.plotOptions.pie as options: 16 | options.startAngle = -90 17 | options.endAngle = 90 18 | 19 | # recenter the plot in the middle of the plot area 20 | options.center = ["50%", "75%"] 21 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-32.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["Chrome", 58.9], 5 | ["Firefox", 13.29], 6 | ["Internet Explorer", 13], 7 | ["Edge", 3.78], 8 | ["Safari", 3.42], 9 | ["Safari", 7.61], 10 | ] 11 | 12 | chart = easychart.new("pie") 13 | chart.plot(data, innerSize="50%") 14 | 15 | with chart.plotOptions.pie as options: 16 | options.startAngle = -90 17 | options.endAngle = 90 18 | options.center = ["50%", "75%"] 19 | 20 | chart 21 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-33.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | {"name": "Spain", "y": 505370, "z": 92.9}, 5 | {"name": "France", "y": 551500, "z": 118.7}, 6 | {"name": "Poland", "y": 312685, "z": 124.6}, 7 | {"name": "Czech Republic", "y": 78867, "z": 137.5}, 8 | {"name": "Italy", "y": 301340, "z": 201.8}, 9 | {"name": "Switzerland", "y": 41277, "z": 214.5}, 10 | {"name": "Germany", "y": 357022, "z": 235.6}, 11 | ] 12 | 13 | chart = easychart.new("variablepie") 14 | chart.title = "Countries compared by population density and total area" 15 | chart.plot(data, zMin=0, name="countries") 16 | chart 17 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-34.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | data = pd.Series([45, 40, 11, 4], index=["O", "A", "B", "AB"]) 5 | 6 | chart = easychart.new("pie", title="Distribution of blood type in the US") 7 | chart.subtitle = "Source: American Red Cross" 8 | chart.tooltip = "{point.percentage:.0f}%" 9 | chart.plot(data) 10 | chart 11 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-35.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | data = pd.DataFrame( 5 | [[7, 16, 18], [11, 11, 13]], 6 | columns=["Gold", "Silver", "Bronze"], 7 | index=[2008, 2012], 8 | ).T 9 | 10 | chart = easychart.new("column") 11 | 12 | chart.title = "France Olympic medals" 13 | chart.subtitle = "by year and by medal class" 14 | chart.categories = data.index 15 | chart.yAxis.title.text = "medals" 16 | 17 | for column in data: 18 | chart.plot(data[column]) 19 | 20 | chart 21 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-36.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | data = pd.DataFrame( 5 | [[5, 3, 4, 7, 2], [2, 2, 3, 2, 1], [3, 4, 4, 2, 5]], 6 | index=["John", "Jane", "Joe"], 7 | columns=["Apples", "Oranges", "Pears", "Grapes", "Bananas"], 8 | ) 9 | 10 | chart = easychart.new("bar") 11 | chart.stacked = True 12 | chart.categories = data.columns 13 | 14 | for person, row in data.iterrows(): 15 | chart.plot(row, name=person) 16 | 17 | chart 18 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-37.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | import requests 4 | 5 | # data is a pd.Series of the US unemployment rate 6 | data = easychart.datasets.load("unemployment") 7 | 8 | # recessions is a pd.DataFrame of the peak and trough dates 9 | # of US recessions since 1854, from the NBER 10 | res = requests.get("http://data.nber.org/data/cycles/business_cycle_dates.json") 11 | recessions = pd.DataFrame(res.json()).applymap(lambda d: pd.Timestamp(d))[1:] 12 | 13 | chart = easychart.new(datetime=True, title="US unemployment rate", zoom="x") 14 | chart.subtitle = "Source: Federal Reserve (FRED)" 15 | chart.yAxis.labels.format = "{value}%" 16 | chart.plot(data, name="unemployment rate") 17 | 18 | for i, recession in recessions.iterrows(): 19 | chart.vband(recession.peak, recession.trough) 20 | 21 | chart 22 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-38.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import easychart 3 | 4 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 5 | 6 | chart = easychart.new() 7 | chart.plot(data) 8 | chart 9 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-39.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import easychart 3 | 4 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 5 | 6 | chart = easychart.new() 7 | chart.plot(data, index=range(100, 130)) 8 | chart 9 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-4.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # data is a pd.DataFrame about 54k diamonds 4 | data = easychart.datasets.load("diamonds").sample(10000) 5 | 6 | chart = easychart.new(title="Diamond prices", zoom="xy") 7 | chart.subtitle = "by carat (weight) and by clarity" 8 | chart.xAxis.title.text = "carat" 9 | chart.yAxis.title.text = "price (USD)" 10 | for clarity in ["VS1", "VVS2", "VVS1", "IF"]: 11 | # isolate the diamonds with the given level of clarity 12 | sample = data[data["clarity"] == clarity] 13 | chart.plot(sample["price"], index=sample["carat"], type="scatter", name=clarity) 14 | chart 15 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-40.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import easychart 3 | 4 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 5 | 6 | chart = easychart.new() 7 | chart.plot(data.values) 8 | chart 9 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-41.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | grades = pd.DataFrame( 5 | [[68, 87], [71, 85]], columns=["min", "max"], index=["male", "female"] 6 | ) 7 | 8 | chart = easychart.new("columnrange") 9 | chart.categories = grades.index 10 | chart.plot(grades, name="min-max range of grades") 11 | chart 12 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-42.py: -------------------------------------------------------------------------------- 1 | import math 2 | import pandas as pd 3 | import easychart 4 | 5 | numbers = pd.DataFrame([[x, math.cos(x)] for x in range(-100, 100)]) 6 | 7 | chart = easychart.new("scatter") 8 | chart.plot(numbers.values) # 2 columns only (no index) 9 | chart 10 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-43.py: -------------------------------------------------------------------------------- 1 | import math 2 | import pandas as pd 3 | import easychart 4 | 5 | numbers = pd.DataFrame( 6 | [[math.cos(x), math.sin(x)] for x in range(-10, 10)], index=range(-10, 10) 7 | ) 8 | 9 | chart = easychart.new("bubble") 10 | chart.plot(numbers) # index + 2 columns 11 | chart 12 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-44.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.stacked = True 5 | chart.title = "Total fruit consumption, grouped by gender" 6 | chart.categories = ["Apples", "Oranges", "Pears", "Grapes", "Bananas"] 7 | with chart.yAxis as axis: 8 | axis.allowDecimals = False 9 | axis.min = 0 10 | axis.title.text = "Number of fruits" 11 | 12 | chart.tooltip = "{value:.0f}" 13 | chart.plot( 14 | [5, 3, 4, 7, 2], 15 | name="John", 16 | stack="male", 17 | labels="{point.y} fruits
({point.percentage:.0f}%)", 18 | ) 19 | chart.plot([3, 4, 4, 2, 5], name="Joe", stack="male", labels="{point.series.name}") 20 | chart.plot([2, 5, 6, 2, 1], name="Jane", stack="female", labels="{point.category}") 21 | chart.plot( 22 | [3, 0, 4, 4, 3], 23 | name="Janet", 24 | stack="female", 25 | labels="{point.y} out of {point.total}", 26 | ) 27 | chart 28 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-45.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import pandas as pd 3 | 4 | # data retrieved from https://apps.fas.usda.gov/psdonline/app/index.html#/app/advQuery 5 | data = pd.DataFrame( 6 | [ 7 | [19661, 16595, 21334, 18036, 30321, 28929, 23864, 27000, 15500], 8 | [11269, 17431, 18107, 17775, 16019, 21016, 16851, 18844, 11000], 9 | ], 10 | columns=[ 11 | "MY14/15", 12 | "MY15/16", 13 | "MY16/17", 14 | "MY17/18", 15 | "MY18/19", 16 | "MY19/20", 17 | "MY20/21", 18 | "MY21/22", 19 | "MY22/23", 20 | ], 21 | index=["corn", "wheat"], 22 | ) 23 | 24 | chart = easychart.new("column") 25 | chart.title = "Ukraine grain exports, by marketing year (MY)" 26 | chart.subtitle = "thousand metric tons" 27 | chart.stacked = True 28 | chart.categories = data.columns 29 | 30 | for row in data.index: 31 | chart.plot(data.loc[row], name=row) 32 | 33 | chart.caption.text = "Source: USDA FAS, accessed 30 November 2022" 34 | 35 | # move the legend to the right of the chart 36 | # each item stacked vertically 37 | # the whole of it centered in the middle 38 | # with some margin between each legend entry 39 | with chart.legend as legend: 40 | legend.align = "right" 41 | legend.layout = "vertical" 42 | legend.verticalAlign = "middle" 43 | legend.itemMarginTop = 15 44 | legend.title.text = "Legend" 45 | 46 | chart 47 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-46.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("area") 4 | chart.plotOptions.area.fillOpacity = 0.5 5 | chart.plot([10, 9, 11, 11, 8, 13, 12, 14], name="Arvid") 6 | chart.plot([13, 9, 10, 10, 8, None, 8, 6], name="Yasin", color="#5A5A5A") 7 | chart 8 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-47.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new() 4 | chart.plot([50, 33, 68, 35, 46, 4, 35, 6, 19, 75, 22, 11]) 5 | chart.annotate( 6 | "Lowest point is here ({point.x}:{point.y})", x=5, y=4, width=100, yOffset=75 7 | ) 8 | chart.annotate("Highest point is here", x=9, y=75, width=100, xOffset=65) 9 | chart 10 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-48.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("scatter") 4 | chart.xAxis.min = 0 5 | chart.xAxis.max = 6 6 | chart.plot([(1, 5), (3, 5), (5, 5)]) 7 | 8 | chart.annotate("Callout is the default shape", x=1, y=5) 9 | 10 | chart.annotate("Connector is akin to floating text", x=3, y=5, shape="connector") 11 | 12 | chart.annotate( 13 | "You may want to set a width to a long-text annotation to avoid it growing too large", 14 | x=5, 15 | y=5, 16 | width=100, 17 | ) 18 | 19 | chart 20 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-49.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [10, 30, {"isIntermediateSum": True}, -4, -8, {"isSum": True}] 4 | 5 | chart = easychart.new("waterfall", legend=False) 6 | chart.categories = [ 7 | "Opening stocks", 8 | "Production", 9 | "Total domestic supply", 10 | "Net exports", 11 | "Consumption", 12 | "Closing stocks", 13 | ] 14 | chart.plot(data) 15 | chart 16 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-5.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # data is a pd.DataFrame about 54k diamonds 4 | data = easychart.datasets.load("diamonds") 5 | 6 | # count number of diamonds by cut and color 7 | data = data.groupby(["color", "cut"])["price"].count().unstack() 8 | 9 | chart = easychart.new("column", title="Diamond inventories by cut and color") 10 | chart.categories = data.index 11 | chart.xAxis.title.text = "Diamond color" 12 | chart.yAxis.title.text = "Count" 13 | chart.stacking = "normal" 14 | for cut in data: 15 | chart.plot(data[cut], name=cut) 16 | chart 17 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-50.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | {"y": 120000, "color": "#059669"}, 5 | {"y": 569000, "color": "#059669"}, 6 | {"y": 231000, "color": "#059669"}, 7 | {"isIntermediateSum": True}, 8 | {"y": -342000, "color": "#ef4444"}, 9 | {"y": -233000, "color": "#ef4444"}, 10 | {"isSum": True}, 11 | ] 12 | 13 | 14 | chart = easychart.new("waterfall") 15 | chart.categories = [ 16 | "Services revenues", 17 | "Product revenues", 18 | "Licensing revenues", 19 | "Total revenues", 20 | "Fixed costs", 21 | "Variable costs", 22 | "Profit (loss)", 23 | ] 24 | 25 | chart.plot(data, labels="{point.y:,:0f}", legend=False) 26 | chart 27 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-51.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import easychart 3 | 4 | chart = easychart.new("line", datetime=True) 5 | chart.plot( 6 | [1, 3, 5, 4, 3, 5, 2], 7 | index=[pd.Timestamp(2022, 12, 8) + pd.Timedelta(days=i) for i in range(7)], 8 | ) 9 | 10 | chart.xAxis.labels.format = "Midnight on {value:%d %b}" 11 | chart 12 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-52.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | datalabels = { 4 | "enabled": True, 5 | "format": "{point.y} {point.series.name} in {point.category} ({point.color})", 6 | "filter": {"property": "y", "operator": ">", "value": 0}, 7 | } 8 | 9 | chart = easychart.new("column") 10 | chart.stacked = True 11 | chart.title = "Adoptions per month, by animal" 12 | chart.categories = ["June", "July", "August"] 13 | chart.plot([1, 3, 5], name="cats", datalabels=datalabels) 14 | chart.plot([1, 0, 4], name="dogs", datalabels=datalabels) 15 | 16 | chart 17 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-53.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | datalabels = { 4 | "enabled": True, 5 | "format": "{point.name}", 6 | "filter": {"property": "y", "operator": ">", "value": 0}, 7 | } 8 | 9 | 10 | def pluralize(quantity, label): 11 | """ 12 | Pluralize a category if quantity > 2 13 | """ 14 | if quantity < 2: 15 | return label 16 | return label + "s" 17 | 18 | 19 | def label(quantity, category): 20 | """ 21 | Create a data label for a given point (y) and category (category) 22 | """ 23 | return str(quantity) + " " + pluralize(quantity, category) 24 | 25 | 26 | chart = easychart.new("column") 27 | chart.stacked = True 28 | chart.title = "Adoptions per month, by animal" 29 | chart.categories = ["June", "July", "August"] 30 | chart.plot( 31 | [{"y": y, "name": label(y, "cat")} for y in [1, 3, 5]], 32 | name="cats", 33 | datalabels=datalabels, 34 | ) 35 | chart.plot( 36 | [{"y": y, "name": label(y, "dog")} for y in [2, 1, 5]], 37 | name="dogs", 38 | datalabels=datalabels, 39 | ) 40 | 41 | chart 42 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-54.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["A", "D", 9, "#BCD4DE"], # gray 5 | ["A", "C", 2, "#FFD675"], # light yellow 6 | ["D", "E", 4, "#BCD4DE"], # gray 7 | ["D", "F", 4, "#BCD4DE"], # gray 8 | ["B", "C", 4, "#FFD675"], # light yellow 9 | ["B", "D", 4, "#BCD4DE"], # gray 10 | ["C", "E", 3, "#F7BA2D"], # darker yellow 11 | ["C", "F", 3, "#BCD4DE"], # gray 12 | ] 13 | 14 | chart = easychart.new(type="sankey") 15 | chart.plot(data, keys=["from", "to", "weight", "color"]) 16 | chart 17 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-55.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = [ 4 | ["A", "D", 9, "#BCD4DE"], # gray 5 | ["A", "C", 2, "#FFD675"], # light yellow 6 | ["D", "E", 4, "#BCD4DE"], # gray 7 | ["D", "F", 4, "#BCD4DE"], # gray 8 | ["B", "C", 4, "#FFD675"], # light yellow 9 | ["B", "D", 4, "#BCD4DE"], # gray 10 | ["C", "E", 3, "#F7BA2D"], # darker yellow 11 | ["C", "F", 3, "#BCD4DE"], # gray 12 | ] 13 | 14 | nodes = [ 15 | {"id": "A", "color": "#457b9d"}, # blue 16 | {"id": "B", "color": "#2a9d8f"}, # green 17 | {"id": "C", "color": "#e9c46a"}, # yellow 18 | {"id": "D", "color": "#f4a261"}, # orange 19 | {"id": "E", "color": "#e76f51"}, # red 20 | {"id": "F", "color": "#1d3557"}, # night 21 | ] 22 | 23 | chart = easychart.new(type="sankey") 24 | chart.plot(data, keys=["from", "to", "weight", "color"], nodes=nodes) 25 | chart 26 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-56.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | labels = { 4 | "format": "{point.from} -> {point.to} {point.weight}km", 5 | "nodeFormat": "Node {point.name}", 6 | } 7 | 8 | data = [ 9 | ["A", "D", 9], 10 | ["A", "C", 2], 11 | ["D", "E", 4], 12 | ["D", "F", 4], 13 | ["B", "C", 4], 14 | ["B", "D", 2], 15 | ["C", "E", 3], 16 | ["C", "F", 3], 17 | ] 18 | 19 | chart = easychart.new(type="sankey") 20 | chart.plot(data, keys=["from", "to", "weight"], labels=labels) 21 | chart 22 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-57.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | labels = [ 4 | { 5 | "format": "{point.from} -> {point.to} {point.weight}km", 6 | "filter": {"property": "weight", "operator": ">", "value": 3}, 7 | }, 8 | {"nodeFormat": "Point {point.name}"}, 9 | ] 10 | 11 | data = [ 12 | ["A", "D", 9], 13 | ["A", "C", 2], 14 | ["D", "E", 4], 15 | ["D", "F", 4], 16 | ["B", "C", 4], 17 | ["B", "D", 2], 18 | ["C", "E", 3], 19 | ["C", "F", 3], 20 | ] 21 | 22 | chart = easychart.new(type="sankey") 23 | chart.plot(data, keys=["from", "to", "weight"], labels=labels) 24 | chart 25 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-58.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | 5 | chart.plotOptions.column = { 6 | "groupPadding": 0.10, 7 | "pointPadding": 0.05 8 | } 9 | 10 | chart.plot([1, 3, 2, 4, 3], name="Series A") 11 | chart.plot([8, 1, 0, 3, 1], name="Series B") 12 | chart 13 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-60.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import requests 3 | 4 | # load the map 5 | # see collection here https://code.highcharts.com/mapdata/ 6 | topo = requests.get( 7 | "https://code.highcharts.com/mapdata/countries/fr/fr-all.topo.json" 8 | ).json() 9 | 10 | # data 11 | data = [ 12 | ["fr-cor", 10], 13 | ["fr-bre", 11], 14 | ["fr-pdl", 12], 15 | ["fr-pac", 13], 16 | ["fr-occ", 14], 17 | ["fr-naq", 15], 18 | ["fr-bfc", 16], 19 | ["fr-cvl", 17], 20 | ["fr-idf", 18], 21 | ["fr-hdf", 19], 22 | ["fr-ara", 20], 23 | ["fr-ges", 21], 24 | ["fr-nor", 22], 25 | ["fr-lre", 23], 26 | ["fr-may", 24], 27 | ["fr-gf", 25], 28 | ["fr-mq", 26], 29 | ["fr-gua", 27], 30 | ] 31 | 32 | chart = easychart.new("map") 33 | chart.chart.map = topo 34 | chart.colorAxis = {} # required 35 | chart.plot(data, joinBy="hc-key") 36 | chart 37 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-61.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.cAxis = "reds" 5 | chart.plot([1, 2, 3, 4, 5, 6]) 6 | chart 7 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-62.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.cAxis = "reds.reversed" 5 | chart.plot([1, 2, 3, 4, 5, 6]) 6 | chart 7 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-63.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.cAxis = "reds.symmetric" 5 | chart.plot([1, 2, 3, 4, 5, 6, 7]) 6 | chart 7 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-64.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new("column") 4 | chart.cAxis = "reds.reversed.symmetric" 5 | chart.plot([1, 2, 3, 4, 5, 6, 7]) 6 | chart 7 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-65.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | data = easychart.datasets.load("stocks") 4 | matrix = data.resample("M").last().pct_change().corr() 5 | 6 | chart = easychart.heatmap( 7 | matrix, colormap="reds", labels="{(multiply point.value 100):.0f}%" 8 | ) 9 | chart.title = "Monthly return correlation" 10 | chart.subtitle = f"Data from {data.index[0]:%d %b %y} to {data.index[-1]:%d %b %y}" 11 | chart 12 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-66.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # ensure the module is available 4 | script = "https://code.highcharts.com/modules/dumbbell.js" 5 | 6 | if script not in easychart.config.scripts: 7 | easychart.config.scripts.append(script) 8 | 9 | 10 | chart = easychart.new("dumbbell", categories=["A", "B"], legend=False) 11 | chart.plot( 12 | [[-2, 8], [4, 6]], 13 | labels="{#if (le point.y 0)}{point.y:,.0f}USD{else}+{point.y}USD{/if}", 14 | ) 15 | chart 16 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-7.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | # compute the annual high, low and last value of the S&P since 2010 4 | data = easychart.datasets.load("S&P500")["Close"]["20100101":] 5 | data = data.groupby(data.index.year).agg(["min", "max", "last"]) 6 | 7 | chart = easychart.new(title="S&P 500 annual trading range", tooltip="shared") 8 | chart.plot( 9 | data[["min", "max"]], 10 | type="arearange", 11 | color="#eeeeee", 12 | name="annual range", 13 | marker={"enabled": False}, 14 | ) 15 | chart.plot(data["last"], name="end of year") 16 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-8.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new() 4 | chart.plot([1, 1, 2, 3, 5, 8], name="Fibonacci series") 5 | chart 6 | -------------------------------------------------------------------------------- /docs/_misc/examples/chart-9.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | 3 | chart = easychart.new( 4 | title="US 2016 Presidential election results", ytitle="", yformat="{value}%" 5 | ) 6 | chart.categories = ["Electoral vote", "Popular vote"] 7 | chart.plot([46.1, 48.2], name="Hillary Clinton", type="column", color="rgb(18,8,55)") 8 | chart.plot([57.3, 42.7], name="Donald Trump", type="column", color="rgb(202,0,4)") 9 | chart 10 | -------------------------------------------------------------------------------- /docs/contents/API/Chart.rst: -------------------------------------------------------------------------------- 1 | easychart.Chart 2 | --------------- 3 | 4 | .. autoclass:: easychart.Chart 5 | :members: 6 | categories, 7 | datalabels, 8 | datetime, 9 | draw, 10 | decimals, 11 | exporting, 12 | height, 13 | inverted, 14 | legend, 15 | marker, 16 | stacked, 17 | subtitle, 18 | title, 19 | tooltip, 20 | type, 21 | width, 22 | zoom, 23 | annotate, 24 | export, 25 | hband, 26 | hline, 27 | plot, 28 | serialize, 29 | save, 30 | export, 31 | show, 32 | vband, 33 | vline -------------------------------------------------------------------------------- /docs/contents/API/Grid.rst: -------------------------------------------------------------------------------- 1 | easychart.Grid 2 | -------------- 3 | 4 | .. autoclass:: easychart.Grid 5 | :members: __init__, add 6 | -------------------------------------------------------------------------------- /docs/contents/API/Plot.rst: -------------------------------------------------------------------------------- 1 | easychart.Plot 2 | -------------- 3 | 4 | .. autoclass:: easychart.Plot 5 | :members: __init__ 6 | -------------------------------------------------------------------------------- /docs/contents/API/index.rst: -------------------------------------------------------------------------------- 1 | API 2 | ==== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | :caption: Table of contents 7 | 8 | utilities/new 9 | utilities/plot 10 | utilities/render 11 | Chart 12 | Plot 13 | Grid -------------------------------------------------------------------------------- /docs/contents/API/utilities/heatmap.rst: -------------------------------------------------------------------------------- 1 | easychart.heatmap 2 | ================= 3 | 4 | .. autofunction:: easychart.heatmap -------------------------------------------------------------------------------- /docs/contents/API/utilities/index.rst: -------------------------------------------------------------------------------- 1 | Utility functions 2 | ----------------- 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | :caption: Table of contents 7 | 8 | new 9 | heatmap 10 | plot 11 | render -------------------------------------------------------------------------------- /docs/contents/API/utilities/new.rst: -------------------------------------------------------------------------------- 1 | easychart.new 2 | ============= 3 | 4 | .. autofunction:: easychart.new -------------------------------------------------------------------------------- /docs/contents/API/utilities/plot.rst: -------------------------------------------------------------------------------- 1 | easychart.plot 2 | ============== 3 | 4 | .. autofunction:: easychart.plot -------------------------------------------------------------------------------- /docs/contents/API/utilities/render.rst: -------------------------------------------------------------------------------- 1 | easychart.render 2 | ================ 3 | 4 | .. autofunction:: easychart.render -------------------------------------------------------------------------------- /docs/contents/examples/example-1.rst: -------------------------------------------------------------------------------- 1 | Column chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | .. literalinclude:: /_misc/examples/chart-1.py 9 | 10 | Column spacing 11 | -------------- 12 | You can control the space between columns (i.e. between series) and between groups of columns (i.e. values) by setting the :code:`groupPadding` and :code:`pointPadding` values respectively under :code:`chart.plotOptions.column`. 13 | 14 | .. note:: 15 | 16 | The padding is expressed in units of the x-axis, not pixels 17 | 18 | .. raw:: html 19 | 20 |
21 | 22 | .. literalinclude:: /_misc/examples/chart-58.py 23 | -------------------------------------------------------------------------------- /docs/contents/examples/example-10.rst: -------------------------------------------------------------------------------- 1 | Stacked area chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-10.py -------------------------------------------------------------------------------- /docs/contents/examples/example-11.rst: -------------------------------------------------------------------------------- 1 | Column range chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-11.py -------------------------------------------------------------------------------- /docs/contents/examples/example-12.rst: -------------------------------------------------------------------------------- 1 | Inverted spline chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-12.py -------------------------------------------------------------------------------- /docs/contents/examples/example-13.rst: -------------------------------------------------------------------------------- 1 | Dual axes chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-13.py -------------------------------------------------------------------------------- /docs/contents/examples/example-14.rst: -------------------------------------------------------------------------------- 1 | Boxplot chart 2 | ===================================================== 3 | As found on the Highcharts `demo `_ 4 | 5 | .. note:: 6 | Requires the `highcharts-more` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/highcharts-more.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | .. raw:: html 15 | 16 |
17 | 18 | 19 | .. literalinclude:: /_misc/examples/chart-14.py -------------------------------------------------------------------------------- /docs/contents/examples/example-15.rst: -------------------------------------------------------------------------------- 1 | Spiderweb chart 2 | ===================================================== 3 | As found on the Highcharts `demo `_ 4 | 5 | .. note:: 6 | Requires the `highcharts-more` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/highcharts-more.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | 20 | .. literalinclude:: /_misc/examples/chart-15.py -------------------------------------------------------------------------------- /docs/contents/examples/example-16.rst: -------------------------------------------------------------------------------- 1 | Simple linear regression 2 | ===================================================== 3 | 4 | .. note:: 5 | New in version 0.1.8 6 | 7 | .. raw:: html 8 | 9 |
10 | 11 | 12 | .. literalinclude:: /_misc/examples/chart-16.py -------------------------------------------------------------------------------- /docs/contents/examples/example-17.rst: -------------------------------------------------------------------------------- 1 | Inverted column range 2 | ===================================================== 3 | As found on the Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-17.py -------------------------------------------------------------------------------- /docs/contents/examples/example-18.rst: -------------------------------------------------------------------------------- 1 | Line with datalabels 2 | ===================================================== 3 | As found on the Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-18.py -------------------------------------------------------------------------------- /docs/contents/examples/example-19.rst: -------------------------------------------------------------------------------- 1 | Logarithmic scale 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-19.py -------------------------------------------------------------------------------- /docs/contents/examples/example-2.rst: -------------------------------------------------------------------------------- 1 | Time series 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-2.py 10 | 11 | With vertical bands 12 | ------------------- 13 | .. raw:: html 14 | 15 |
16 | 17 | 18 | .. literalinclude:: /_misc/examples/chart-37.py -------------------------------------------------------------------------------- /docs/contents/examples/example-20.rst: -------------------------------------------------------------------------------- 1 | Stacked and grouped column 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-20.py 11 | 12 | With various label options enabled 13 | 14 | .. raw:: html 15 | 16 |
17 | 18 | 19 | .. literalinclude:: /_misc/examples/chart-44.py -------------------------------------------------------------------------------- /docs/contents/examples/example-21.rst: -------------------------------------------------------------------------------- 1 | Bubble chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. note:: 6 | Requires the `highcharts-more` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/highcharts-more.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | .. raw:: html 15 | 16 |
17 | 18 | 19 | .. literalinclude:: /_misc/examples/chart-21.py -------------------------------------------------------------------------------- /docs/contents/examples/example-22.rst: -------------------------------------------------------------------------------- 1 | Heatmap 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. note:: 6 | Requires the `heatmap` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/heatmap.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | .. note:: 15 | New in version 0.1.25: a helper function to make creating heatmaps easier! 16 | 17 | .. raw:: html 18 | 19 |
20 | 21 | 22 | .. literalinclude:: /_misc/examples/chart-65.py 23 | 24 | Alternatively 25 | 26 | .. raw:: html 27 | 28 |
29 | 30 | 31 | .. literalinclude:: /_misc/examples/chart-22.py -------------------------------------------------------------------------------- /docs/contents/examples/example-23.rst: -------------------------------------------------------------------------------- 1 | Bar chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-23.py -------------------------------------------------------------------------------- /docs/contents/examples/example-28.rst: -------------------------------------------------------------------------------- 1 | Dumbbell charts 2 | ===================================================== 3 | Inspired from this `Highcharts `_ demo. 4 | 5 | .. note:: 6 | Requires the `dumbbell` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/dumbbell.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | 20 | .. literalinclude:: /_misc/examples/chart-28.py 21 | 22 | Custom labels 23 | ------------- 24 | 25 | .. raw:: html 26 | 27 |
28 | 29 | 30 | .. literalinclude:: /_misc/examples/chart-66.py -------------------------------------------------------------------------------- /docs/contents/examples/example-3.rst: -------------------------------------------------------------------------------- 1 | Pie chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-3.py 11 | 12 | With data labels 13 | ---------------- 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | 20 | .. literalinclude:: /_misc/examples/chart-26.py 21 | 22 | With slice 23 | ---------- 24 | 25 | .. raw:: html 26 | 27 |
28 | 29 | 30 | .. literalinclude:: /_misc/examples/chart-29.py 31 | 32 | With pandas Series 33 | ------------------ 34 | 35 | .. raw:: html 36 | 37 |
38 | 39 | 40 | .. literalinclude:: /_misc/examples/chart-34.py -------------------------------------------------------------------------------- /docs/contents/examples/example-30.rst: -------------------------------------------------------------------------------- 1 | Donut chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-30.py -------------------------------------------------------------------------------- /docs/contents/examples/example-31.rst: -------------------------------------------------------------------------------- 1 | Semi-circle chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-31.py 10 | 11 | As donut 12 | -------- 13 | 14 | .. raw:: html 15 | 16 |
17 | 18 | 19 | .. literalinclude:: /_misc/examples/chart-32.py -------------------------------------------------------------------------------- /docs/contents/examples/example-33.rst: -------------------------------------------------------------------------------- 1 | Variable pie 2 | ===================================================== 3 | Inspired from this `Highcharts `_ demo. 4 | 5 | .. note:: 6 | Requires the `variablepie` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/variable-pie.js") 10 | easychart.config.save() 11 | 12 | See section on `extensions `_ for more details. 13 | 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | 20 | .. literalinclude:: /_misc/examples/chart-33.py -------------------------------------------------------------------------------- /docs/contents/examples/example-34.rst: -------------------------------------------------------------------------------- 1 | Stacked bar chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-36.py -------------------------------------------------------------------------------- /docs/contents/examples/example-35.rst: -------------------------------------------------------------------------------- 1 | Legend placement 2 | ===================================================== 3 | .. raw:: html 4 | 5 |
6 | 7 | 8 | .. literalinclude:: /_misc/examples/chart-45.py -------------------------------------------------------------------------------- /docs/contents/examples/example-36.rst: -------------------------------------------------------------------------------- 1 | Area with missing points 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. note:: 6 | By default, Highcharts treats null (None) values as missing data, and will allow for gaps in datasets. 7 | 8 | .. raw:: html 9 | 10 |
11 | 12 | 13 | .. literalinclude:: /_misc/examples/chart-46.py -------------------------------------------------------------------------------- /docs/contents/examples/example-37.rst: -------------------------------------------------------------------------------- 1 | Annotations 2 | ===================================================== 3 | .. note:: 4 | New in version 0.1.15 5 | 6 | .. note:: 7 | Requires the `annotations` module: 8 | :: 9 | 10 | easychart.config.scripts.append("https://code.highcharts.com/modules/annotations.js") 11 | easychart.config.save() 12 | 13 | See section on `extensions `_ for more details. 14 | 15 | .. raw:: html 16 | 17 |
18 | 19 | 20 | .. literalinclude:: /_misc/examples/chart-47.py -------------------------------------------------------------------------------- /docs/contents/examples/example-38.rst: -------------------------------------------------------------------------------- 1 | Waterfall 2 | ===================================================== 3 | .. note:: 4 | 5 | Requires the `highcharts-more` module (loaded by default): 6 | :: 7 | 8 | easychart.config.scripts.append("https://code.highcharts.com/highcharts-more.js") 9 | easychart.config.save() 10 | 11 | See section on `extensions `_ for more details. 12 | 13 | .. raw:: html 14 | 15 |
16 | 17 | 18 | .. literalinclude:: /_misc/examples/chart-49.py 19 | 20 | Customizing colors 21 | ------------------ 22 | 23 | .. raw:: html 24 | 25 |
26 | 27 | 28 | .. literalinclude:: /_misc/examples/chart-50.py -------------------------------------------------------------------------------- /docs/contents/examples/example-39.rst: -------------------------------------------------------------------------------- 1 | Datalabels 2 | ===================================================== 3 | Custom datalabel policy with filter 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-52.py 11 | 12 | Using named points with datalabel filter 13 | 14 | .. raw:: html 15 | 16 |
17 | 18 | 19 | .. literalinclude:: /_misc/examples/chart-53.py 20 | 21 | 22 | With various label options enabled 23 | 24 | .. raw:: html 25 | 26 |
27 | 28 | 29 | .. literalinclude:: /_misc/examples/chart-44.py 30 | 31 | Labeled pie chart 32 | 33 | .. raw:: html 34 | 35 |
36 | 37 | 38 | .. literalinclude:: /_misc/examples/chart-26.py -------------------------------------------------------------------------------- /docs/contents/examples/example-4.rst: -------------------------------------------------------------------------------- 1 | Scatter chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-4.py -------------------------------------------------------------------------------- /docs/contents/examples/example-40.rst: -------------------------------------------------------------------------------- 1 | Violin plot 2 | ===================================================== 3 | Inspired from this `blog `_ post 4 | 5 | .. note:: 6 | Requires the `streamgraph` module: 7 | :: 8 | 9 | easychart.config.scripts.append("https://code.highcharts.com/modules/streamgraph.js") 10 | easychart.config.save() 11 | 12 | .. raw:: html 13 | 14 |
15 | 16 | 17 | .. literalinclude:: /_misc/examples/chart-59.py 18 | -------------------------------------------------------------------------------- /docs/contents/examples/example-41.rst: -------------------------------------------------------------------------------- 1 | Map chart 2 | ===================================================== 3 | 4 | .. danger:: 5 | Experimental 6 | 7 | .. warning:: 8 | New in version 0.1.8 9 | 10 | .. note:: 11 | Requires the `map` module: 12 | :: 13 | 14 | easychart.config.scripts.append("https://code.highcharts.com/maps/modules/map.js") 15 | easychart.config.save() # optional 16 | 17 | .. raw:: html 18 | 19 |
20 | 21 | 22 | .. literalinclude:: /_misc/examples/chart-60.py 23 | -------------------------------------------------------------------------------- /docs/contents/examples/example-5.rst: -------------------------------------------------------------------------------- 1 | Stacked column chart 2 | ===================================================== 3 | Inspired from this Highcharts `demo `_ 4 | 5 | .. raw:: html 6 | 7 |
8 | 9 | 10 | .. literalinclude:: /_misc/examples/chart-5.py -------------------------------------------------------------------------------- /docs/contents/examples/example-6.rst: -------------------------------------------------------------------------------- 1 | Area range chart (advanced) 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-6.py -------------------------------------------------------------------------------- /docs/contents/examples/example-7.rst: -------------------------------------------------------------------------------- 1 | Area range chart 2 | ===================================================== 3 | 4 | .. raw:: html 5 | 6 |
7 | 8 | 9 | .. literalinclude:: /_misc/examples/chart-7.py -------------------------------------------------------------------------------- /docs/contents/examples/index.rst: -------------------------------------------------------------------------------- 1 | Examples 2 | ============== 3 | The `Highcharts demo page `_ is rich with examples, which should be generally readable for non-javascript coders. In addition, here are some additional python-based examples. 4 | 5 | The `Highcharts API documentation `_ is also a fantastic resource to help construct charts. 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | :caption: Table of contents 10 | 11 | example-1 12 | example-2 13 | example-3 14 | example-4 15 | example-23 16 | example-5 17 | example-34 18 | example-7 19 | example-36 20 | example-13 21 | example-6 22 | example-10 23 | example-11 24 | example-12 25 | example-14 26 | example-15 27 | example-16 28 | example-17 29 | example-20 30 | example-19 31 | example-18 32 | example-21 33 | example-22 34 | example-24 35 | example-27 36 | example-28 37 | example-30 38 | example-31 39 | example-33 40 | example-35 41 | example-37 42 | example-38 43 | example-39 44 | example-40 45 | example-41 -------------------------------------------------------------------------------- /docs/contents/streamlit.rst: -------------------------------------------------------------------------------- 1 | Integration with Streamlit 2 | ========================== 3 | 4 | Charts made with easychart can be rendered on Streamlit. This `demo `_ application shows you how. 5 | :: 6 | 7 | import streamlit as st 8 | import easychart 9 | 10 | # this is to ensure the chart takes 100% of the available width 11 | # otherwise it will default to 600px (not responsive) 12 | easychart.config.rendering.responsive = True 13 | 14 | chart = easychart.new("column") 15 | chart.title = "France Olympic medals" 16 | chart.subtitle = "by year and by medal class" 17 | chart.categories = ["Gold", "Silver", "Bronze"] 18 | chart.yAxis.title.text = "medals" 19 | chart.plot([7, 16, 18], name=2008) 20 | chart.plot([11, 11, 13], name=2012) 21 | 22 | st.components.v1.html(easychart.rendering.render(chart), height=400) 23 | 24 | 25 | .. note:: 26 | 27 | To ensure the charts are rendered *responsively*, set the :code:`easychart.config.rendering.responsive = True` 28 | 29 | -------------------------------------------------------------------------------- /docs/fragments/badges.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue 2 | :target: https://pypi.org/project/easychart 3 | 4 | .. image:: https://github.com/dschenck/easychart/workflows/testing/badge.svg 5 | :target: https://github.com/dschenck/easychart/actions 6 | 7 | .. image:: https://badge.fury.io/py/easychart.svg 8 | :target: https://badge.fury.io/py/easychart 9 | 10 | .. image:: https://readthedocs.org/projects/easychart/badge/?version=latest 11 | :target: https://easychart.readthedocs.io/en/latest/?badge=latest 12 | 13 | .. image:: https://img.shields.io/badge/code%20style-black-000000.svg 14 | :target: https://github.com/psf/black 15 | 16 | .. image:: https://codecov.io/gh/dschenck/easychart/graph/badge.svg?token=15YL7WJJAT 17 | :target: https://codecov.io/gh/dschenck/easychart -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | easychart 2 | ====================================== 3 | Highcharts meets python in your jupyter notebook 4 | 5 | .. include:: fragments/badges.rst 6 | 7 | Quickstart 8 | ------------------------------------- 9 | Installing :code:`easychart` is simple with pip: 10 | :: 11 | 12 | pip install easychart 13 | 14 | Open up a new Jupyter notebook and start creating your charts: 15 | :: 16 | 17 | import easychart 18 | 19 | chart = easychart.new("column") 20 | chart.title = "France Olympic medals" 21 | chart.subtitle = "by year and by medal class" 22 | chart.yAxis.title.text = "medals" 23 | chart.categories = ["Gold","Silver","Bronze"] 24 | chart.plot([7, 16, 18], name=2008) 25 | chart.plot([11, 11, 13], name=2012) 26 | chart 27 | 28 | .. raw:: html 29 | 30 |
loading...
31 | 32 | .. toctree:: 33 | :maxdepth: 2 34 | :caption: Table of contents 35 | 36 | contents/introduction 37 | contents/examples/index 38 | contents/plotting-with-pandas 39 | contents/dimensions 40 | contents/themes 41 | contents/rendering 42 | contents/colormaps 43 | contents/streamlit 44 | contents/API/index 45 | contents/about 46 | 47 | Source 48 | ------------------------------------- 49 | Code is hosted on `github `_ -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx 2 | furo 3 | easychart 4 | sphinx-prompt -------------------------------------------------------------------------------- /docs/static/charts/chart-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 7, 6 | 16, 7 | 18 8 | ], 9 | "name": 2008 10 | }, 11 | { 12 | "data": [ 13 | 11, 14 | 11, 15 | 13 16 | ], 17 | "name": 2012 18 | } 19 | ], 20 | "chart": { 21 | "type": "column", 22 | "zoomType": "x" 23 | }, 24 | "title": { 25 | "text": "France Olympic medals" 26 | }, 27 | "subtitle": { 28 | "text": "by year and by medal class" 29 | }, 30 | "xAxis": { 31 | "categories": [ 32 | "Gold", 33 | "Silver", 34 | "Bronze" 35 | ] 36 | }, 37 | "yAxis": { 38 | "title": { 39 | "text": "medals" 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-14.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | 760, 7 | 801, 8 | 848, 9 | 895, 10 | 965 11 | ], 12 | [ 13 | 733, 14 | 853, 15 | 939, 16 | 980, 17 | 1080 18 | ], 19 | [ 20 | 714, 21 | 762, 22 | 817, 23 | 870, 24 | 918 25 | ], 26 | [ 27 | 724, 28 | 802, 29 | 806, 30 | 871, 31 | 950 32 | ], 33 | [ 34 | 834, 35 | 836, 36 | 864, 37 | 882, 38 | 910 39 | ] 40 | ], 41 | "name": "distribution of values" 42 | } 43 | ], 44 | "chart": { 45 | "type": "boxplot", 46 | "zoomType": "x" 47 | }, 48 | "xAxis": { 49 | "categories": [ 50 | "A", 51 | "B", 52 | "C", 53 | "D", 54 | "E" 55 | ] 56 | } 57 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-15.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 43000, 6 | 19000, 7 | 60000, 8 | 35000, 9 | 17000, 10 | 10000 11 | ], 12 | "pointPlacement": "on", 13 | "name": "budget" 14 | }, 15 | { 16 | "data": [ 17 | 50000, 18 | 39000, 19 | 42000, 20 | 31000, 21 | 26000, 22 | 14000 23 | ], 24 | "pointPlacement": "on", 25 | "name": "actual" 26 | } 27 | ], 28 | "chart": { 29 | "zoomType": "x", 30 | "type": "line", 31 | "polar": true 32 | }, 33 | "xAxis": { 34 | "categories": [ 35 | "Sales", 36 | "Marketing", 37 | "Development", 38 | "Support", 39 | "Technology", 40 | "Administration" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-19.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 2, 7 | 4, 8 | 8, 9 | 16, 10 | 32, 11 | 64, 12 | 128, 13 | 256, 14 | 512 15 | ] 16 | } 17 | ], 18 | "chart": { 19 | "type": "line", 20 | "zoomType": "x" 21 | }, 22 | "title": { 23 | "text": "Logarithmic series" 24 | }, 25 | "yAxis": { 26 | "type": "logarithmic" 27 | } 28 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-26.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "O", 7 | 45 8 | ], 9 | [ 10 | "A", 11 | 40 12 | ], 13 | [ 14 | "B", 15 | 11 16 | ], 17 | [ 18 | "AB", 19 | 4 20 | ] 21 | ], 22 | "dataLabels": { 23 | "enabled": true, 24 | "format": "{point.name} ({point.y}%)" 25 | } 26 | } 27 | ], 28 | "chart": { 29 | "type": "pie", 30 | "zoomType": "x" 31 | }, 32 | "title": { 33 | "text": "Distribution of blood type in the US" 34 | }, 35 | "subtitle": { 36 | "text": "Source: American Red Cross" 37 | }, 38 | "tooltip": { 39 | "valueDecimals": 0, 40 | "valueSuffix": "%" 41 | } 42 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-29.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "Chrome", 7 | "y": 61.41, 8 | "sliced": true 9 | }, 10 | { 11 | "name": "Internet Explorer", 12 | "y": 11.84 13 | }, 14 | { 15 | "name": "Firefox", 16 | "y": 10.85 17 | }, 18 | { 19 | "name": "Edge", 20 | "y": 4.67 21 | }, 22 | { 23 | "name": "Safari", 24 | "y": 4.18 25 | }, 26 | { 27 | "name": "Other", 28 | "y": 7.05 29 | } 30 | ], 31 | "name": "browser" 32 | } 33 | ], 34 | "chart": { 35 | "type": "pie", 36 | "zoomType": "x" 37 | }, 38 | "title": { 39 | "text": "Browser market shares in January, 2018" 40 | }, 41 | "tooltip": { 42 | "valuePrefix": "{point.name}: ", 43 | "valueDecimals": 1, 44 | "valueSuffix": "%" 45 | } 46 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "O", 7 | "y": 45 8 | }, 9 | { 10 | "name": "A", 11 | "y": 40 12 | }, 13 | { 14 | "name": "B", 15 | "y": 11 16 | }, 17 | { 18 | "name": "AB", 19 | "y": 4 20 | } 21 | ] 22 | } 23 | ], 24 | "chart": { 25 | "type": "pie", 26 | "zoomType": "x" 27 | }, 28 | "title": { 29 | "text": "Distribution of blood type in the US" 30 | }, 31 | "subtitle": { 32 | "text": "Source: American Red Cross" 33 | }, 34 | "tooltip": { 35 | "valueDecimals": 0, 36 | "valueSuffix": "%" 37 | } 38 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-30.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ], 30 | "innerSize": "50%" 31 | } 32 | ], 33 | "chart": { 34 | "type": "pie", 35 | "zoomType": "x" 36 | } 37 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-31.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ] 30 | } 31 | ], 32 | "chart": { 33 | "type": "pie", 34 | "zoomType": "x" 35 | }, 36 | "plotOptions": { 37 | "pie": { 38 | "startAngle": -90, 39 | "endAngle": 90, 40 | "center": [ 41 | "50%", 42 | "75%" 43 | ] 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-32.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ], 30 | "innerSize": "50%" 31 | } 32 | ], 33 | "chart": { 34 | "type": "pie", 35 | "zoomType": "x" 36 | }, 37 | "plotOptions": { 38 | "pie": { 39 | "startAngle": -90, 40 | "endAngle": 90, 41 | "center": [ 42 | "50%", 43 | "75%" 44 | ] 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-33.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "Spain", 7 | "y": 505370, 8 | "z": 92.9 9 | }, 10 | { 11 | "name": "France", 12 | "y": 551500, 13 | "z": 118.7 14 | }, 15 | { 16 | "name": "Poland", 17 | "y": 312685, 18 | "z": 124.6 19 | }, 20 | { 21 | "name": "Czech Republic", 22 | "y": 78867, 23 | "z": 137.5 24 | }, 25 | { 26 | "name": "Italy", 27 | "y": 301340, 28 | "z": 201.8 29 | }, 30 | { 31 | "name": "Switzerland", 32 | "y": 41277, 33 | "z": 214.5 34 | }, 35 | { 36 | "name": "Germany", 37 | "y": 357022, 38 | "z": 235.6 39 | } 40 | ], 41 | "zMin": 0, 42 | "name": "countries" 43 | } 44 | ], 45 | "chart": { 46 | "type": "variablepie", 47 | "zoomType": "x" 48 | }, 49 | "title": { 50 | "text": "Countries compared by population density and total area" 51 | } 52 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-34.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "O", 7 | 45 8 | ], 9 | [ 10 | "A", 11 | 40 12 | ], 13 | [ 14 | "B", 15 | 11 16 | ], 17 | [ 18 | "AB", 19 | 4 20 | ] 21 | ], 22 | "name": null 23 | } 24 | ], 25 | "chart": { 26 | "type": "pie", 27 | "zoomType": "x" 28 | }, 29 | "title": { 30 | "text": "Distribution of blood type in the US" 31 | }, 32 | "subtitle": { 33 | "text": "Source: American Red Cross" 34 | }, 35 | "tooltip": { 36 | "valueDecimals": 0, 37 | "valueSuffix": "%" 38 | } 39 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-35.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Gold", 7 | 7 8 | ], 9 | [ 10 | "Silver", 11 | 16 12 | ], 13 | [ 14 | "Bronze", 15 | 18 16 | ] 17 | ], 18 | "name": 2008 19 | }, 20 | { 21 | "data": [ 22 | [ 23 | "Gold", 24 | 11 25 | ], 26 | [ 27 | "Silver", 28 | 11 29 | ], 30 | [ 31 | "Bronze", 32 | 13 33 | ] 34 | ], 35 | "name": 2012 36 | } 37 | ], 38 | "chart": { 39 | "type": "column", 40 | "zoomType": "x" 41 | }, 42 | "title": { 43 | "text": "France Olympic medals" 44 | }, 45 | "subtitle": { 46 | "text": "by year and by medal class" 47 | }, 48 | "xAxis": { 49 | "categories": [ 50 | "Gold", 51 | "Silver", 52 | "Bronze" 53 | ] 54 | }, 55 | "yAxis": { 56 | "title": { 57 | "text": "medals" 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-40.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 103, 6 | 84, 7 | 67, 8 | 52, 9 | 39, 10 | 28, 11 | 19, 12 | 12, 13 | 7, 14 | 4, 15 | 3, 16 | 4, 17 | 7, 18 | 12, 19 | 19, 20 | 28, 21 | 39, 22 | 52, 23 | 67, 24 | 84 25 | ] 26 | } 27 | ], 28 | "chart": { 29 | "zoomType": "x" 30 | } 31 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-41.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "male", 7 | 68, 8 | 87 9 | ], 10 | [ 11 | "female", 12 | 71, 13 | 85 14 | ] 15 | ], 16 | "name": "min-max range of grades" 17 | } 18 | ], 19 | "chart": { 20 | "type": "columnrange", 21 | "zoomType": "x" 22 | }, 23 | "xAxis": { 24 | "categories": [ 25 | "male", 26 | "female" 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-46.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 10, 6 | 9, 7 | 11, 8 | 11, 9 | 8, 10 | 13, 11 | 12, 12 | 14 13 | ], 14 | "name": "Arvid" 15 | }, 16 | { 17 | "data": [ 18 | 13, 19 | 9, 20 | 10, 21 | 10, 22 | 8, 23 | null, 24 | 8, 25 | 6 26 | ], 27 | "name": "Yasin", 28 | "color": "#5A5A5A" 29 | } 30 | ], 31 | "chart": { 32 | "type": "area", 33 | "zoomType": "x" 34 | }, 35 | "plotOptions": { 36 | "area": { 37 | "fillOpacity": 0.5 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-49.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 10, 6 | 30, 7 | { 8 | "isIntermediateSum": true 9 | }, 10 | -4, 11 | -8, 12 | { 13 | "isSum": true 14 | } 15 | ] 16 | } 17 | ], 18 | "chart": { 19 | "type": "waterfall", 20 | "zoomType": "x" 21 | }, 22 | "legend": { 23 | "enabled": false 24 | }, 25 | "xAxis": { 26 | "categories": [ 27 | "Opening stocks", 28 | "Production", 29 | "Total domestic supply", 30 | "Net exports", 31 | "Consumption", 32 | "Closing stocks" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-50.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "y": 120000, 7 | "color": "#059669" 8 | }, 9 | { 10 | "y": 569000, 11 | "color": "#059669" 12 | }, 13 | { 14 | "y": 231000, 15 | "color": "#059669" 16 | }, 17 | { 18 | "isIntermediateSum": true 19 | }, 20 | { 21 | "y": -342000, 22 | "color": "#ef4444" 23 | }, 24 | { 25 | "y": -233000, 26 | "color": "#ef4444" 27 | }, 28 | { 29 | "isSum": true 30 | } 31 | ], 32 | "showInLegend": false, 33 | "dataLabels": { 34 | "enabled": true, 35 | "format": "{point.y:,:0f}" 36 | } 37 | } 38 | ], 39 | "chart": { 40 | "type": "waterfall", 41 | "zoomType": "x" 42 | }, 43 | "xAxis": { 44 | "categories": [ 45 | "Services revenues", 46 | "Product revenues", 47 | "Licensing revenues", 48 | "Total revenues", 49 | "Fixed costs", 50 | "Variable costs", 51 | "Profit (loss)" 52 | ] 53 | } 54 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-51.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | 1670457600000.0, 7 | 1 8 | ], 9 | [ 10 | 1670544000000.0, 11 | 3 12 | ], 13 | [ 14 | 1670630400000.0, 15 | 5 16 | ], 17 | [ 18 | 1670716800000.0, 19 | 4 20 | ], 21 | [ 22 | 1670803200000.0, 23 | 3 24 | ], 25 | [ 26 | 1670889600000.0, 27 | 5 28 | ], 29 | [ 30 | 1670976000000.0, 31 | 2 32 | ] 33 | ] 34 | } 35 | ], 36 | "chart": { 37 | "type": "line", 38 | "zoomType": "x" 39 | }, 40 | "xAxis": { 41 | "type": "datetime", 42 | "labels": { 43 | "format": "Midnight on {value:%d %b}" 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-52.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 3, 7 | 5 8 | ], 9 | "name": "cats", 10 | "dataLabels": { 11 | "enabled": true, 12 | "format": "{point.y} {point.series.name} in {point.category} ({point.color})", 13 | "filter": { 14 | "property": "y", 15 | "operator": ">", 16 | "value": 0 17 | } 18 | } 19 | }, 20 | { 21 | "data": [ 22 | 1, 23 | 0, 24 | 4 25 | ], 26 | "name": "dogs", 27 | "dataLabels": { 28 | "enabled": true, 29 | "format": "{point.y} {point.series.name} in {point.category} ({point.color})", 30 | "filter": { 31 | "property": "y", 32 | "operator": ">", 33 | "value": 0 34 | } 35 | } 36 | } 37 | ], 38 | "chart": { 39 | "type": "column", 40 | "zoomType": "x" 41 | }, 42 | "plotOptions": { 43 | "series": { 44 | "stacking": "normal" 45 | } 46 | }, 47 | "title": { 48 | "text": "Adoptions per month, by animal" 49 | }, 50 | "xAxis": { 51 | "categories": [ 52 | "June", 53 | "July", 54 | "August" 55 | ] 56 | } 57 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-56.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "A", 7 | "D", 8 | 9 9 | ], 10 | [ 11 | "A", 12 | "C", 13 | 2 14 | ], 15 | [ 16 | "D", 17 | "E", 18 | 4 19 | ], 20 | [ 21 | "D", 22 | "F", 23 | 4 24 | ], 25 | [ 26 | "B", 27 | "C", 28 | 4 29 | ], 30 | [ 31 | "B", 32 | "D", 33 | 2 34 | ], 35 | [ 36 | "C", 37 | "E", 38 | 3 39 | ], 40 | [ 41 | "C", 42 | "F", 43 | 3 44 | ] 45 | ], 46 | "keys": [ 47 | "from", 48 | "to", 49 | "weight" 50 | ], 51 | "dataLabels": { 52 | "format": "{point.from} -> {point.to} {point.weight}km", 53 | "nodeFormat": "Node {point.name}" 54 | } 55 | } 56 | ], 57 | "chart": { 58 | "type": "sankey", 59 | "zoomType": "x" 60 | } 61 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-58.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 3, 7 | 2, 8 | 4, 9 | 3 10 | ], 11 | "name": "Series A" 12 | }, 13 | { 14 | "data": [ 15 | 8, 16 | 1, 17 | 0, 18 | 3, 19 | 1 20 | ], 21 | "name": "Series B" 22 | } 23 | ], 24 | "chart": { 25 | "type": "column", 26 | "zoomType": "x" 27 | }, 28 | "plotOptions": { 29 | "column": { 30 | "groupPadding": 0.1, 31 | "pointPadding": 0.05 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-66.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | -2, 7 | 8 8 | ], 9 | [ 10 | 4, 11 | 6 12 | ] 13 | ], 14 | "dataLabels": { 15 | "enabled": true, 16 | "format": "{#if (le point.y 0)}{point.y:,.0f}USD{else}+{point.y}USD{/if}" 17 | } 18 | } 19 | ], 20 | "chart": { 21 | "type": "dumbbell", 22 | "zoomType": "x" 23 | }, 24 | "legend": { 25 | "enabled": false 26 | }, 27 | "xAxis": { 28 | "categories": [ 29 | "A", 30 | "B" 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-8.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 1, 7 | 2, 8 | 3, 9 | 5, 10 | 8 11 | ], 12 | "name": "Fibonacci series" 13 | } 14 | ], 15 | "chart": { 16 | "zoomType": "x" 17 | } 18 | } -------------------------------------------------------------------------------- /docs/static/charts/chart-9.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 46.1, 6 | 48.2 7 | ], 8 | "name": "Hillary Clinton", 9 | "type": "column", 10 | "color": "rgb(18,8,55)" 11 | }, 12 | { 13 | "data": [ 14 | 57.3, 15 | 42.7 16 | ], 17 | "name": "Donald Trump", 18 | "type": "column", 19 | "color": "rgb(202,0,4)" 20 | } 21 | ], 22 | "chart": { 23 | "zoomType": "x" 24 | }, 25 | "title": { 26 | "text": "US 2016 Presidential election results" 27 | }, 28 | "yAxis": { 29 | "title": { 30 | "text": "" 31 | }, 32 | "labels": { 33 | "format": "{value}%" 34 | } 35 | }, 36 | "xAxis": { 37 | "categories": [ 38 | "Electoral vote", 39 | "Popular vote" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /docs/static/colormaps/accent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/accent.png -------------------------------------------------------------------------------- /docs/static/colormaps/afmhot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/afmhot.png -------------------------------------------------------------------------------- /docs/static/colormaps/autumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/autumn.png -------------------------------------------------------------------------------- /docs/static/colormaps/binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/binary.png -------------------------------------------------------------------------------- /docs/static/colormaps/blues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/blues.png -------------------------------------------------------------------------------- /docs/static/colormaps/bone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/bone.png -------------------------------------------------------------------------------- /docs/static/colormaps/brbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/brbg.png -------------------------------------------------------------------------------- /docs/static/colormaps/brg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/brg.png -------------------------------------------------------------------------------- /docs/static/colormaps/bugn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/bugn.png -------------------------------------------------------------------------------- /docs/static/colormaps/bupu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/bupu.png -------------------------------------------------------------------------------- /docs/static/colormaps/bwr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/bwr.png -------------------------------------------------------------------------------- /docs/static/colormaps/cividis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/cividis.png -------------------------------------------------------------------------------- /docs/static/colormaps/cmrmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/cmrmap.png -------------------------------------------------------------------------------- /docs/static/colormaps/cool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/cool.png -------------------------------------------------------------------------------- /docs/static/colormaps/coolwarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/coolwarm.png -------------------------------------------------------------------------------- /docs/static/colormaps/copper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/copper.png -------------------------------------------------------------------------------- /docs/static/colormaps/cubehelix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/cubehelix.png -------------------------------------------------------------------------------- /docs/static/colormaps/dark2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/dark2.png -------------------------------------------------------------------------------- /docs/static/colormaps/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/flag.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_earth.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_gray.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_heat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_heat.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_ncar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_ncar.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_rainbow.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_stern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_stern.png -------------------------------------------------------------------------------- /docs/static/colormaps/gist_yarg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gist_yarg.png -------------------------------------------------------------------------------- /docs/static/colormaps/gnbu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gnbu.png -------------------------------------------------------------------------------- /docs/static/colormaps/gnuplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gnuplot.png -------------------------------------------------------------------------------- /docs/static/colormaps/gnuplot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gnuplot2.png -------------------------------------------------------------------------------- /docs/static/colormaps/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/gray.png -------------------------------------------------------------------------------- /docs/static/colormaps/greens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/greens.png -------------------------------------------------------------------------------- /docs/static/colormaps/greys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/greys.png -------------------------------------------------------------------------------- /docs/static/colormaps/hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/hot.png -------------------------------------------------------------------------------- /docs/static/colormaps/hsv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/hsv.png -------------------------------------------------------------------------------- /docs/static/colormaps/inferno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/inferno.png -------------------------------------------------------------------------------- /docs/static/colormaps/jet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/jet.png -------------------------------------------------------------------------------- /docs/static/colormaps/magma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/magma.png -------------------------------------------------------------------------------- /docs/static/colormaps/nipy_spectral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/nipy_spectral.png -------------------------------------------------------------------------------- /docs/static/colormaps/ocean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/ocean.png -------------------------------------------------------------------------------- /docs/static/colormaps/oranges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/oranges.png -------------------------------------------------------------------------------- /docs/static/colormaps/orrd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/orrd.png -------------------------------------------------------------------------------- /docs/static/colormaps/paired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/paired.png -------------------------------------------------------------------------------- /docs/static/colormaps/pastel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/pastel1.png -------------------------------------------------------------------------------- /docs/static/colormaps/pastel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/pastel2.png -------------------------------------------------------------------------------- /docs/static/colormaps/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/pink.png -------------------------------------------------------------------------------- /docs/static/colormaps/piyg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/piyg.png -------------------------------------------------------------------------------- /docs/static/colormaps/plasma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/plasma.png -------------------------------------------------------------------------------- /docs/static/colormaps/prgn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/prgn.png -------------------------------------------------------------------------------- /docs/static/colormaps/prism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/prism.png -------------------------------------------------------------------------------- /docs/static/colormaps/pubu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/pubu.png -------------------------------------------------------------------------------- /docs/static/colormaps/pubugn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/pubugn.png -------------------------------------------------------------------------------- /docs/static/colormaps/puor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/puor.png -------------------------------------------------------------------------------- /docs/static/colormaps/purd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/purd.png -------------------------------------------------------------------------------- /docs/static/colormaps/purples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/purples.png -------------------------------------------------------------------------------- /docs/static/colormaps/rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rainbow.png -------------------------------------------------------------------------------- /docs/static/colormaps/rdbu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rdbu.png -------------------------------------------------------------------------------- /docs/static/colormaps/rdgy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rdgy.png -------------------------------------------------------------------------------- /docs/static/colormaps/rdpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rdpu.png -------------------------------------------------------------------------------- /docs/static/colormaps/rdylbu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rdylbu.png -------------------------------------------------------------------------------- /docs/static/colormaps/rdylgn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/rdylgn.png -------------------------------------------------------------------------------- /docs/static/colormaps/reds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/reds.png -------------------------------------------------------------------------------- /docs/static/colormaps/seismic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/seismic.png -------------------------------------------------------------------------------- /docs/static/colormaps/set1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/set1.png -------------------------------------------------------------------------------- /docs/static/colormaps/set2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/set2.png -------------------------------------------------------------------------------- /docs/static/colormaps/set3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/set3.png -------------------------------------------------------------------------------- /docs/static/colormaps/spectral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/spectral.png -------------------------------------------------------------------------------- /docs/static/colormaps/spring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/spring.png -------------------------------------------------------------------------------- /docs/static/colormaps/summer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/summer.png -------------------------------------------------------------------------------- /docs/static/colormaps/tab10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/tab10.png -------------------------------------------------------------------------------- /docs/static/colormaps/tab20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/tab20.png -------------------------------------------------------------------------------- /docs/static/colormaps/tab20b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/tab20b.png -------------------------------------------------------------------------------- /docs/static/colormaps/tab20c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/tab20c.png -------------------------------------------------------------------------------- /docs/static/colormaps/terrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/terrain.png -------------------------------------------------------------------------------- /docs/static/colormaps/turbo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/turbo.png -------------------------------------------------------------------------------- /docs/static/colormaps/twilight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/twilight.png -------------------------------------------------------------------------------- /docs/static/colormaps/twilight_shifted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/twilight_shifted.png -------------------------------------------------------------------------------- /docs/static/colormaps/viridis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/viridis.png -------------------------------------------------------------------------------- /docs/static/colormaps/winter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/winter.png -------------------------------------------------------------------------------- /docs/static/colormaps/wistia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/wistia.png -------------------------------------------------------------------------------- /docs/static/colormaps/ylgn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/ylgn.png -------------------------------------------------------------------------------- /docs/static/colormaps/ylgnbu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/ylgnbu.png -------------------------------------------------------------------------------- /docs/static/colormaps/ylorbr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/ylorbr.png -------------------------------------------------------------------------------- /docs/static/colormaps/ylorrd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/docs/static/colormaps/ylorrd.png -------------------------------------------------------------------------------- /docs/static/style.css: -------------------------------------------------------------------------------- 1 | div.chart-container { 2 | border:1px solid #fffcfc; 3 | } -------------------------------------------------------------------------------- /easychart/colormaps/accent.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Accent", 3 | "colors": [ 4 | "#7fc97f", 5 | "#beaed4", 6 | "#fdc086", 7 | "#ffff99", 8 | "#386cb0", 9 | "#f0027f", 10 | "#bf5b17", 11 | "#666666" 12 | ] 13 | } -------------------------------------------------------------------------------- /easychart/colormaps/dark2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dark2", 3 | "colors": [ 4 | "#1b9e77", 5 | "#d95f02", 6 | "#7570b3", 7 | "#e7298a", 8 | "#66a61e", 9 | "#e6ab02", 10 | "#a6761d", 11 | "#666666" 12 | ] 13 | } -------------------------------------------------------------------------------- /easychart/colormaps/paired.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Paired", 3 | "colors": [ 4 | "#a6cee3", 5 | "#1f78b4", 6 | "#b2df8a", 7 | "#33a02c", 8 | "#fb9a99", 9 | "#e31a1c", 10 | "#fdbf6f", 11 | "#ff7f00", 12 | "#cab2d6", 13 | "#6a3d9a", 14 | "#ffff99", 15 | "#b15928" 16 | ] 17 | } -------------------------------------------------------------------------------- /easychart/colormaps/pastel1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Pastel1", 3 | "colors": [ 4 | "#fbb4ae", 5 | "#b3cde3", 6 | "#ccebc5", 7 | "#decbe4", 8 | "#fed9a6", 9 | "#ffffcc", 10 | "#e5d8bd", 11 | "#fddaec", 12 | "#f2f2f2" 13 | ] 14 | } -------------------------------------------------------------------------------- /easychart/colormaps/pastel2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Pastel2", 3 | "colors": [ 4 | "#b3e2cd", 5 | "#fdcdac", 6 | "#cbd5e8", 7 | "#f4cae4", 8 | "#e6f5c9", 9 | "#fff2ae", 10 | "#f1e2cc", 11 | "#cccccc" 12 | ] 13 | } -------------------------------------------------------------------------------- /easychart/colormaps/set1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Set1", 3 | "colors": [ 4 | "#e41a1c", 5 | "#377eb8", 6 | "#4daf4a", 7 | "#984ea3", 8 | "#ff7f00", 9 | "#ffff33", 10 | "#a65628", 11 | "#f781bf", 12 | "#999999" 13 | ] 14 | } -------------------------------------------------------------------------------- /easychart/colormaps/set2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Set2", 3 | "colors": [ 4 | "#66c2a5", 5 | "#fc8d62", 6 | "#8da0cb", 7 | "#e78ac3", 8 | "#a6d854", 9 | "#ffd92f", 10 | "#e5c494", 11 | "#b3b3b3" 12 | ] 13 | } -------------------------------------------------------------------------------- /easychart/colormaps/set3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Set3", 3 | "colors": [ 4 | "#8dd3c7", 5 | "#ffffb3", 6 | "#bebada", 7 | "#fb8072", 8 | "#80b1d3", 9 | "#fdb462", 10 | "#b3de69", 11 | "#fccde5", 12 | "#d9d9d9", 13 | "#bc80bd", 14 | "#ccebc5", 15 | "#ffed6f" 16 | ] 17 | } -------------------------------------------------------------------------------- /easychart/colormaps/tab10.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tab10", 3 | "colors": [ 4 | "#1f77b4", 5 | "#ff7f0e", 6 | "#2ca02c", 7 | "#d62728", 8 | "#9467bd", 9 | "#8c564b", 10 | "#e377c2", 11 | "#7f7f7f", 12 | "#bcbd22", 13 | "#17becf" 14 | ] 15 | } -------------------------------------------------------------------------------- /easychart/colormaps/tab20.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tab20", 3 | "colors": [ 4 | "#1f77b4", 5 | "#aec7e8", 6 | "#ff7f0e", 7 | "#ffbb78", 8 | "#2ca02c", 9 | "#98df8a", 10 | "#d62728", 11 | "#ff9896", 12 | "#9467bd", 13 | "#c5b0d5", 14 | "#8c564b", 15 | "#c49c94", 16 | "#e377c2", 17 | "#f7b6d2", 18 | "#7f7f7f", 19 | "#c7c7c7", 20 | "#bcbd22", 21 | "#dbdb8d", 22 | "#17becf", 23 | "#9edae5" 24 | ] 25 | } -------------------------------------------------------------------------------- /easychart/colormaps/tab20b.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tab20b", 3 | "colors": [ 4 | "#393b79", 5 | "#5254a3", 6 | "#6b6ecf", 7 | "#9c9ede", 8 | "#637939", 9 | "#8ca252", 10 | "#b5cf6b", 11 | "#cedb9c", 12 | "#8c6d31", 13 | "#bd9e39", 14 | "#e7ba52", 15 | "#e7cb94", 16 | "#843c39", 17 | "#ad494a", 18 | "#d6616b", 19 | "#e7969c", 20 | "#7b4173", 21 | "#a55194", 22 | "#ce6dbd", 23 | "#de9ed6" 24 | ] 25 | } -------------------------------------------------------------------------------- /easychart/colormaps/tab20c.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tab20c", 3 | "colors": [ 4 | "#3182bd", 5 | "#6baed6", 6 | "#9ecae1", 7 | "#c6dbef", 8 | "#e6550d", 9 | "#fd8d3c", 10 | "#fdae6b", 11 | "#fdd0a2", 12 | "#31a354", 13 | "#74c476", 14 | "#a1d99b", 15 | "#c7e9c0", 16 | "#756bb1", 17 | "#9e9ac8", 18 | "#bcbddc", 19 | "#dadaeb", 20 | "#636363", 21 | "#969696", 22 | "#bdbdbd", 23 | "#d9d9d9" 24 | ] 25 | } -------------------------------------------------------------------------------- /easychart/datasets/populations.csv: -------------------------------------------------------------------------------- 1 | ,Africa,Latin America and the Caribbean,Northern America,Europe,Asia and Oceania 2 | 1950,9.015974602,6.660079581,6.80537134,21.66069466,55.8578798172 3 | 2017,16.63873386,8.550603939,4.784045905,9.828453635,60.1981626603 4 | 2030,19.92162736,8.402131678,4.62453277,8.647395529,58.4043126595 5 | 2050,25.86576997,7.980507627,4.448044592,7.324335216,54.3813426017 6 | 2100,39.94493028,6.366144247,4.463354568,5.840839643,43.3847312559 -------------------------------------------------------------------------------- /easychart/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | from .racechart import racechart 2 | -------------------------------------------------------------------------------- /easychart/ipynb.py: -------------------------------------------------------------------------------- 1 | try: 2 | ip = get_ipython() # noqa: F821 3 | except Exception: 4 | ip = None 5 | 6 | if ip and ( 7 | ip.__module__.startswith("IPython") or ip.__module__.startswith("ipykernel") 8 | ): 9 | import IPython 10 | import easychart 11 | import easychart.rendering 12 | 13 | if IPython.__version__ >= "0.11": 14 | formatter = ip.display_formatter.formatters["text/html"] 15 | 16 | for cls in [easychart.Chart, easychart.Plot, easychart.Grid]: 17 | formatter.for_type(cls, easychart.rendering.render) 18 | -------------------------------------------------------------------------------- /easychart/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .chart import Chart 2 | from .grid import Grid 3 | from .plot import Plot 4 | from .series import Series 5 | -------------------------------------------------------------------------------- /easychart/models/grid.py: -------------------------------------------------------------------------------- 1 | import easychart 2 | import easychart.internals as internals 3 | 4 | 5 | class Grid: 6 | """ 7 | Grid of chart plots 8 | """ 9 | 10 | def __init__(self, plots=None, *, width=None, theme=None): 11 | """ 12 | Parameters 13 | ------------------------ 14 | plots : list 15 | list of individual plots 16 | 17 | width : str 18 | total width of grid, as pixels (e.g. "1280px") 19 | 20 | theme : str, dict 21 | theme name or dict of theme options 22 | """ 23 | self.plots = [easychart.Plot(p) for p in (plots or [])] 24 | self.theme = theme 25 | self.width = internals.Size(width) if width is not None else width 26 | 27 | def add(self, chart, *, width=None) -> None: 28 | """ 29 | Adds a chart (or plot) to the grid 30 | 31 | Parameters 32 | ------------ 33 | width : str 34 | width of the plot, expressed as a percentage of the grid width 35 | """ 36 | if not isinstance(chart, easychart.Plot): 37 | chart = easychart.Plot(chart, width=width) 38 | self.plots.append(chart) 39 | 40 | def serialize(self) -> dict: 41 | """ 42 | Returns 43 | ------- 44 | dict 45 | """ 46 | return { 47 | "plots": [plot.serialize() for plot in self.plots], 48 | "theme": self.theme, 49 | "width": self.width, 50 | } 51 | -------------------------------------------------------------------------------- /easychart/models/plot.py: -------------------------------------------------------------------------------- 1 | import easychart.encoders 2 | import easychart.internals as internals 3 | 4 | 5 | class Plot: 6 | """ 7 | Individual chart container 8 | """ 9 | 10 | def __init__(self, chart, *, width=None, constr=None): 11 | """ 12 | Parameters 13 | ------------ 14 | chart : Chart 15 | chart 16 | width : str 17 | width of the plot, expressed as a number of pixels or a percentage 18 | of the container width 19 | constr : str 20 | one of 'chart', 'stock', 'map' or 'gantt' 21 | defaults to 'chart' 22 | """ 23 | if isinstance(chart, Plot): 24 | chart, width, constr = ( 25 | chart.chart, 26 | width or chart.width, 27 | chart.constr or constr, 28 | ) 29 | 30 | self.chart = chart 31 | 32 | self.width = internals.Size( 33 | width 34 | or self.chart.get( 35 | ["chart", "width"], 36 | "100%" if easychart.config.rendering.responsive else "600px", 37 | ) 38 | ) 39 | 40 | self.constr = chart.get("constr", constr) or "chart" 41 | 42 | def serialize(self) -> dict: 43 | """ 44 | Returns 45 | ------- 46 | dict 47 | """ 48 | return { 49 | "chart": self.chart.serialize(), 50 | "width": self.width, 51 | "constr": self.constr, 52 | } 53 | -------------------------------------------------------------------------------- /easychart/themes/elementary.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": [ 3 | "#41B5E9", 4 | "#FA8832", 5 | "#34393C", 6 | "#E46151" 7 | ], 8 | "chart": { 9 | "style": { 10 | "color": "#333", 11 | "fontFamily": "Open Sans" 12 | } 13 | }, 14 | "title": { 15 | "style": { 16 | "fontFamily": "Raleway", 17 | "fontWeight": "100" 18 | } 19 | }, 20 | "subtitle": { 21 | "style": { 22 | "fontFamily": "Raleway", 23 | "fontWeight": "100" 24 | } 25 | }, 26 | "legend": { 27 | "align": "right", 28 | "verticalAlign": "bottom" 29 | }, 30 | "xAxis": { 31 | "gridLineWidth": 1, 32 | "gridLineColor": "#F3F3F3", 33 | "lineColor": "#F3F3F3", 34 | "minorGridLineColor": "#F3F3F3", 35 | "tickColor": "#F3F3F3", 36 | "tickWidth": 1 37 | }, 38 | "yAxis": { 39 | "gridLineColor": "#F3F3F3", 40 | "lineColor": "#F3F3F3", 41 | "minorGridLineColor": "#F3F3F3", 42 | "tickColor": "#F3F3F3", 43 | "tickWidth": 1 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /easychart/themes/ffx.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": ["#00AACC", "#FF4E00", "#B90000", "#5F9B0A", "#CD6723"], 3 | "chart": { 4 | "backgroundColor": { 5 | "linearGradient": [ 6 | 0, 7 | 0, 8 | 0, 9 | 150 10 | ], 11 | "stops": [ 12 | [ 13 | 0, 14 | "#CAE1F4" 15 | ], 16 | [ 17 | 1, 18 | "#EEEEEE" 19 | ] 20 | ] 21 | }, 22 | "style": { 23 | "fontFamily": "Open Sans" 24 | } 25 | }, 26 | "title": { 27 | "align": "left" 28 | }, 29 | "subtitle": { 30 | "align": "left" 31 | }, 32 | "legend": { 33 | "align": "right", 34 | "verticalAlign": "bottom" 35 | }, 36 | "xAxis": { 37 | "gridLineWidth": 1, 38 | "gridLineColor": "#F3F3F3", 39 | "lineColor": "#F3F3F3", 40 | "minorGridLineColor": "#F3F3F3", 41 | "tickColor": "#F3F3F3", 42 | "tickWidth": 1 43 | }, 44 | "yAxis": { 45 | "gridLineColor": "#F3F3F3", 46 | "lineColor": "#F3F3F3", 47 | "minorGridLineColor": "#F3F3F3", 48 | "tickColor": "#F3F3F3", 49 | "tickWidth": 1 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /easychart/themes/flat.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": ["#f1c40f", "#2ecc71", "#9b59b6", "#e74c3c", "#34495e", "#3498db", "#1abc9c", "#f39c12", "#d35400"], 3 | "chart": { 4 | "backgroundColor": "#ECF0F1" 5 | }, 6 | "xAxis": { 7 | "gridLineDashStyle": "Dash", 8 | "gridLineWidth": 1, 9 | "gridLineColor": "#BDC3C7", 10 | "lineColor": "#BDC3C7", 11 | "minorGridLineColor": "#BDC3C7", 12 | "tickColor": "#BDC3C7", 13 | "tickWidth": 1 14 | }, 15 | "yAxis": { 16 | "gridLineDashStyle": "Dash", 17 | "gridLineColor": "#BDC3C7", 18 | "lineColor": "#BDC3C7", 19 | "minorGridLineColor": "#BDC3C7", 20 | "tickColor": "#BDC3C7", 21 | "tickWidth": 1 22 | }, 23 | "legendBackgroundColor": "rgba(0, 0, 0, 0.5)", 24 | "background2": "#505053", 25 | "dataLabelsColor": "#B0B0B3", 26 | "textColor": "#34495e", 27 | "contrastTextColor": "#F0F0F3", 28 | "maskColor": "rgba(255,255,255,0.3)" 29 | } 30 | -------------------------------------------------------------------------------- /easychart/themes/flatdark.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": ["#f1c40f", "#2ecc71", "#9b59b6", "#e74c3c", "#34495e", "#3498db", "#1abc9c", "#f39c12", "#d35400"], 3 | "chart": { 4 | "backgroundColor": "#34495e" 5 | }, 6 | "xAxis": { 7 | "gridLineDashStyle": "Dash", 8 | "gridLineWidth": 1, 9 | "gridLineColor": "#46627f", 10 | "lineColor": "#46627f", 11 | "minorGridLineColor": "#BDC3C7", 12 | "tickColor": "#46627f", 13 | "tickWidth": 1, 14 | "title": { 15 | "style": { 16 | "color": "#FFFFFF" 17 | } 18 | } 19 | }, 20 | "yAxis": { 21 | "gridLineDashStyle": "Dash", 22 | "gridLineColor": "#46627f", 23 | "lineColor": "#BDC3C7", 24 | "minorGridLineColor": "#BDC3C7", 25 | "tickColor": "#46627f", 26 | "tickWidth": 1, 27 | "title": { 28 | "style": { 29 | "color": "#FFFFFF" 30 | } 31 | } 32 | }, 33 | "legendBackgroundColor": "rgba(0, 0, 0, 0.5)", 34 | "background2": "#505053", 35 | "dataLabelsColor": "#B0B0B3", 36 | "textColor": "#34495e", 37 | "contrastTextColor": "#F0F0F3", 38 | "maskColor": "rgba(255,255,255,0.3)", 39 | "title": { 40 | "style": { 41 | "color": "#FFFFFF" 42 | } 43 | }, 44 | "subtitle": { 45 | "style": { 46 | "color": "#666666" 47 | } 48 | }, 49 | "legend": { 50 | "itemStyle": { 51 | "color": "#C0C0C0" 52 | }, 53 | "itemHoverStyle": { 54 | "color": "#C0C0C0" 55 | }, 56 | "itemHiddenStyle": { 57 | "color": "#444444" 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /easychart/themes/google.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": ["#0266C8", "#F90101", "#F2B50F", "#00933B"], 3 | "chart": { 4 | "style": { 5 | "fontFamily": "Roboto", 6 | "color": "#444444" 7 | } 8 | }, 9 | "xAxis": { 10 | "gridLineWidth": 1, 11 | "gridLineColor": "#F3F3F3", 12 | "lineColor": "#F3F3F3", 13 | "minorGridLineColor": "#F3F3F3", 14 | "tickColor": "#F3F3F3", 15 | "tickWidth": 1 16 | }, 17 | "yAxis": { 18 | "gridLineColor": "#F3F3F3", 19 | "lineColor": "#F3F3F3", 20 | "minorGridLineColor": "#F3F3F3", 21 | "tickColor": "#F3F3F3", 22 | "tickWidth": 1 23 | }, 24 | "legendBackgroundColor": "rgba(0, 0, 0, 0.5)", 25 | "background2": "#505053", 26 | "dataLabelsColor": "#B0B0B3", 27 | "textColor": "#C0C0C0", 28 | "contrastTextColor": "#F0F0F3", 29 | "maskColor": "rgba(255,255,255,0.3)" 30 | } 31 | -------------------------------------------------------------------------------- /easychart/themes/highcharts.json: -------------------------------------------------------------------------------- 1 | { 2 | "global": {}, 3 | "lang": {} 4 | } -------------------------------------------------------------------------------- /easychart/themes/monokai.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": ["#F92672", "#66D9EF", "#A6E22E", "#A6E22E"], 3 | "chart": { 4 | "backgroundColor": "#272822", 5 | "style": { 6 | "fontFamily": "Inconsolata", 7 | "color": "#A2A39C" 8 | } 9 | }, 10 | "title": { 11 | "style": { 12 | "color": "#A2A39C" 13 | }, 14 | "align": "left" 15 | }, 16 | "subtitle": { 17 | "style": { 18 | "color": "#A2A39C" 19 | }, 20 | "align": "left" 21 | }, 22 | "legend": { 23 | "align": "right", 24 | "verticalAlign": "bottom", 25 | "itemStyle": { 26 | "fontWeight": "normal", 27 | "color": "#A2A39C" 28 | } 29 | }, 30 | "xAxis": { 31 | "gridLineDashStyle": "Dot", 32 | "gridLineWidth": 1, 33 | "gridLineColor": "#A2A39C", 34 | "lineColor": "#A2A39C", 35 | "minorGridLineColor": "#A2A39C", 36 | "tickColor": "#A2A39C", 37 | "tickWidth": 1 38 | }, 39 | "yAxis": { 40 | "gridLineDashStyle": "Dot", 41 | "gridLineColor": "#A2A39C", 42 | "lineColor": "#A2A39C", 43 | "minorGridLineColor": "#A2A39C", 44 | "tickColor": "#A2A39C", 45 | "tickWidth": 1 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /easychart/themes/null.json: -------------------------------------------------------------------------------- 1 | { 2 | "chart": { 3 | "backgroundColor": "transparent" 4 | }, 5 | "plotOptions": { 6 | "line": { 7 | "marker": { 8 | "enabled": false 9 | } 10 | } 11 | }, 12 | "legend": { 13 | "enabled": true, 14 | "align": "right", 15 | "verticalAlign": "bottom" 16 | }, 17 | "credits": { 18 | "enabled": false 19 | }, 20 | "xAxis": { 21 | "visible": false 22 | }, 23 | "yAxis": { 24 | "visible": false 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /easychart/themes/tufte.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": [ 3 | "#737373", 4 | "#D8D7D6", 5 | "#B2B0AD", 6 | "#8C8984" 7 | ], 8 | "chart": { 9 | "style": { 10 | "fontFamily": "Cardo" 11 | } 12 | }, 13 | "xAxis": { 14 | "lineWidth": 0, 15 | "minorGridLineWidth": 0, 16 | "lineColor": "transparent", 17 | "tickColor": "#737373" 18 | }, 19 | "yAxis": { 20 | "lineWidth": 0, 21 | "minorGridLineWidth": 0, 22 | "lineColor": "transparent", 23 | "tickColor": "#737373", 24 | "tickWidth": 1, 25 | "gridLineColor": "transparent" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /easychart/themes/tufte2.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors": [ 3 | "#737373", 4 | "#D8D7D6", 5 | "#B2B0AD", 6 | "#8C8984" 7 | ], 8 | "chart": { 9 | "style": { 10 | "fontFamily": "Cardo" 11 | } 12 | }, 13 | "xAxis": { 14 | "lineWidth": 1, 15 | "minorGridLineWidth": 0, 16 | "lineColor": "#737373", 17 | "tickColor": "#737373", 18 | "tickWidth": 0 19 | }, 20 | "yAxis": { 21 | "lineWidth": 1, 22 | "minorGridLineWidth": 0, 23 | "lineColor": "transparent", 24 | "tickColor": "#737373", 25 | "tickWidth": 0, 26 | "gridLineColor": "white", 27 | "gridZIndex": 4 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | python_files = *.py 3 | python_functions = 4 | test* 5 | regress 6 | testpaths = 7 | tests/ -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pandas 3 | numpy 4 | easytree>=0.2.3 5 | jinja2 6 | simplejson 7 | requests 8 | ipython -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open("README.md", "r") as fh: 4 | long_description = fh.read() 5 | 6 | setuptools.setup( 7 | name="easychart", 8 | version="0.1.32", 9 | author="david.schenck@outlook.com", 10 | author_email="david.schenck@outlook.com", 11 | description="Highcharts meets python in your Jupyter notebook", 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="https://easychart.readthedocs.io/en/latest/", 15 | packages=setuptools.find_packages(), 16 | classifiers=[ 17 | "Programming Language :: Python :: 3", 18 | "License :: OSI Approved :: MIT License", 19 | "Operating System :: OS Independent", 20 | ], 21 | install_requires=[ 22 | "pandas", 23 | "numpy", 24 | "easytree>=0.2.3", 25 | "simplejson", 26 | "jinja2", 27 | "requests", 28 | "ipython", 29 | ], 30 | include_package_data=True, 31 | ) 32 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dschenck/easychart/2f11523abd561389cd5aa4fce589ffb22313d5e6/tests/__init__.py -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def pytest_addoption(parser): 5 | parser.addoption( 6 | "--regenerate-missing", 7 | action="store_true", 8 | default=False, 9 | help="Regenerate regression test output data for cases where such data does not exist", 10 | ) 11 | 12 | parser.addoption( 13 | "--regenerate-failing", 14 | action="store_true", 15 | default=False, 16 | help="Regenerate regression test output data for failing cases", 17 | ) 18 | 19 | parser.addoption( 20 | "--regenerate-all", 21 | action="store_true", 22 | default=False, 23 | help="Regenerate regression test output data for all cases", 24 | ) 25 | -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-1.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 7, 6 | 16, 7 | 18 8 | ], 9 | "name": 2008 10 | }, 11 | { 12 | "data": [ 13 | 11, 14 | 11, 15 | 13 16 | ], 17 | "name": 2012 18 | } 19 | ], 20 | "chart": { 21 | "type": "column", 22 | "zoomType": "x" 23 | }, 24 | "title": { 25 | "text": "France Olympic medals" 26 | }, 27 | "subtitle": { 28 | "text": "by year and by medal class" 29 | }, 30 | "xAxis": { 31 | "categories": [ 32 | "Gold", 33 | "Silver", 34 | "Bronze" 35 | ] 36 | }, 37 | "yAxis": { 38 | "title": { 39 | "text": "medals" 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-14.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | 760, 7 | 801, 8 | 848, 9 | 895, 10 | 965 11 | ], 12 | [ 13 | 733, 14 | 853, 15 | 939, 16 | 980, 17 | 1080 18 | ], 19 | [ 20 | 714, 21 | 762, 22 | 817, 23 | 870, 24 | 918 25 | ], 26 | [ 27 | 724, 28 | 802, 29 | 806, 30 | 871, 31 | 950 32 | ], 33 | [ 34 | 834, 35 | 836, 36 | 864, 37 | 882, 38 | 910 39 | ] 40 | ], 41 | "name": "distribution of values" 42 | } 43 | ], 44 | "chart": { 45 | "type": "boxplot", 46 | "zoomType": "x" 47 | }, 48 | "xAxis": { 49 | "categories": [ 50 | "A", 51 | "B", 52 | "C", 53 | "D", 54 | "E" 55 | ] 56 | } 57 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-15.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 43000, 6 | 19000, 7 | 60000, 8 | 35000, 9 | 17000, 10 | 10000 11 | ], 12 | "pointPlacement": "on", 13 | "name": "budget" 14 | }, 15 | { 16 | "data": [ 17 | 50000, 18 | 39000, 19 | 42000, 20 | 31000, 21 | 26000, 22 | 14000 23 | ], 24 | "pointPlacement": "on", 25 | "name": "actual" 26 | } 27 | ], 28 | "chart": { 29 | "zoomType": "x", 30 | "type": "line", 31 | "polar": true 32 | }, 33 | "xAxis": { 34 | "categories": [ 35 | "Sales", 36 | "Marketing", 37 | "Development", 38 | "Support", 39 | "Technology", 40 | "Administration" 41 | ] 42 | } 43 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-19.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 2, 7 | 4, 8 | 8, 9 | 16, 10 | 32, 11 | 64, 12 | 128, 13 | 256, 14 | 512 15 | ] 16 | } 17 | ], 18 | "chart": { 19 | "type": "line", 20 | "zoomType": "x" 21 | }, 22 | "title": { 23 | "text": "Logarithmic series" 24 | }, 25 | "yAxis": { 26 | "type": "logarithmic" 27 | } 28 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-26.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "O", 7 | 45 8 | ], 9 | [ 10 | "A", 11 | 40 12 | ], 13 | [ 14 | "B", 15 | 11 16 | ], 17 | [ 18 | "AB", 19 | 4 20 | ] 21 | ], 22 | "dataLabels": { 23 | "enabled": true, 24 | "format": "{point.name} ({point.y}%)" 25 | } 26 | } 27 | ], 28 | "chart": { 29 | "type": "pie", 30 | "zoomType": "x" 31 | }, 32 | "title": { 33 | "text": "Distribution of blood type in the US" 34 | }, 35 | "subtitle": { 36 | "text": "Source: American Red Cross" 37 | }, 38 | "tooltip": { 39 | "valueDecimals": 0, 40 | "valueSuffix": "%" 41 | } 42 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-29.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "Chrome", 7 | "y": 61.41, 8 | "sliced": true 9 | }, 10 | { 11 | "name": "Internet Explorer", 12 | "y": 11.84 13 | }, 14 | { 15 | "name": "Firefox", 16 | "y": 10.85 17 | }, 18 | { 19 | "name": "Edge", 20 | "y": 4.67 21 | }, 22 | { 23 | "name": "Safari", 24 | "y": 4.18 25 | }, 26 | { 27 | "name": "Other", 28 | "y": 7.05 29 | } 30 | ], 31 | "name": "browser" 32 | } 33 | ], 34 | "chart": { 35 | "type": "pie", 36 | "zoomType": "x" 37 | }, 38 | "title": { 39 | "text": "Browser market shares in January, 2018" 40 | }, 41 | "tooltip": { 42 | "valuePrefix": "{point.name}: ", 43 | "valueDecimals": 1, 44 | "valueSuffix": "%" 45 | } 46 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-3.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "O", 7 | "y": 45 8 | }, 9 | { 10 | "name": "A", 11 | "y": 40 12 | }, 13 | { 14 | "name": "B", 15 | "y": 11 16 | }, 17 | { 18 | "name": "AB", 19 | "y": 4 20 | } 21 | ] 22 | } 23 | ], 24 | "chart": { 25 | "type": "pie", 26 | "zoomType": "x" 27 | }, 28 | "title": { 29 | "text": "Distribution of blood type in the US" 30 | }, 31 | "subtitle": { 32 | "text": "Source: American Red Cross" 33 | }, 34 | "tooltip": { 35 | "valueDecimals": 0, 36 | "valueSuffix": "%" 37 | } 38 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-30.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ], 30 | "innerSize": "50%" 31 | } 32 | ], 33 | "chart": { 34 | "type": "pie", 35 | "zoomType": "x" 36 | } 37 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-31.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ] 30 | } 31 | ], 32 | "chart": { 33 | "type": "pie", 34 | "zoomType": "x" 35 | }, 36 | "plotOptions": { 37 | "pie": { 38 | "startAngle": -90, 39 | "endAngle": 90, 40 | "center": [ 41 | "50%", 42 | "75%" 43 | ] 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-32.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Chrome", 7 | 58.9 8 | ], 9 | [ 10 | "Firefox", 11 | 13.29 12 | ], 13 | [ 14 | "Internet Explorer", 15 | 13 16 | ], 17 | [ 18 | "Edge", 19 | 3.78 20 | ], 21 | [ 22 | "Safari", 23 | 3.42 24 | ], 25 | [ 26 | "Safari", 27 | 7.61 28 | ] 29 | ], 30 | "innerSize": "50%" 31 | } 32 | ], 33 | "chart": { 34 | "type": "pie", 35 | "zoomType": "x" 36 | }, 37 | "plotOptions": { 38 | "pie": { 39 | "startAngle": -90, 40 | "endAngle": 90, 41 | "center": [ 42 | "50%", 43 | "75%" 44 | ] 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-33.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "name": "Spain", 7 | "y": 505370, 8 | "z": 92.9 9 | }, 10 | { 11 | "name": "France", 12 | "y": 551500, 13 | "z": 118.7 14 | }, 15 | { 16 | "name": "Poland", 17 | "y": 312685, 18 | "z": 124.6 19 | }, 20 | { 21 | "name": "Czech Republic", 22 | "y": 78867, 23 | "z": 137.5 24 | }, 25 | { 26 | "name": "Italy", 27 | "y": 301340, 28 | "z": 201.8 29 | }, 30 | { 31 | "name": "Switzerland", 32 | "y": 41277, 33 | "z": 214.5 34 | }, 35 | { 36 | "name": "Germany", 37 | "y": 357022, 38 | "z": 235.6 39 | } 40 | ], 41 | "zMin": 0, 42 | "name": "countries" 43 | } 44 | ], 45 | "chart": { 46 | "type": "variablepie", 47 | "zoomType": "x" 48 | }, 49 | "title": { 50 | "text": "Countries compared by population density and total area" 51 | } 52 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-34.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "O", 7 | 45 8 | ], 9 | [ 10 | "A", 11 | 40 12 | ], 13 | [ 14 | "B", 15 | 11 16 | ], 17 | [ 18 | "AB", 19 | 4 20 | ] 21 | ], 22 | "name": null 23 | } 24 | ], 25 | "chart": { 26 | "type": "pie", 27 | "zoomType": "x" 28 | }, 29 | "title": { 30 | "text": "Distribution of blood type in the US" 31 | }, 32 | "subtitle": { 33 | "text": "Source: American Red Cross" 34 | }, 35 | "tooltip": { 36 | "valueDecimals": 0, 37 | "valueSuffix": "%" 38 | } 39 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-35.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "Gold", 7 | 7 8 | ], 9 | [ 10 | "Silver", 11 | 16 12 | ], 13 | [ 14 | "Bronze", 15 | 18 16 | ] 17 | ], 18 | "name": 2008 19 | }, 20 | { 21 | "data": [ 22 | [ 23 | "Gold", 24 | 11 25 | ], 26 | [ 27 | "Silver", 28 | 11 29 | ], 30 | [ 31 | "Bronze", 32 | 13 33 | ] 34 | ], 35 | "name": 2012 36 | } 37 | ], 38 | "chart": { 39 | "type": "column", 40 | "zoomType": "x" 41 | }, 42 | "title": { 43 | "text": "France Olympic medals" 44 | }, 45 | "subtitle": { 46 | "text": "by year and by medal class" 47 | }, 48 | "xAxis": { 49 | "categories": [ 50 | "Gold", 51 | "Silver", 52 | "Bronze" 53 | ] 54 | }, 55 | "yAxis": { 56 | "title": { 57 | "text": "medals" 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-40.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 103, 6 | 84, 7 | 67, 8 | 52, 9 | 39, 10 | 28, 11 | 19, 12 | 12, 13 | 7, 14 | 4, 15 | 3, 16 | 4, 17 | 7, 18 | 12, 19 | 19, 20 | 28, 21 | 39, 22 | 52, 23 | 67, 24 | 84 25 | ] 26 | } 27 | ], 28 | "chart": { 29 | "zoomType": "x" 30 | } 31 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-41.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | "male", 7 | 68, 8 | 87 9 | ], 10 | [ 11 | "female", 12 | 71, 13 | 85 14 | ] 15 | ], 16 | "name": "min-max range of grades" 17 | } 18 | ], 19 | "chart": { 20 | "type": "columnrange", 21 | "zoomType": "x" 22 | }, 23 | "xAxis": { 24 | "categories": [ 25 | "male", 26 | "female" 27 | ] 28 | } 29 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-46.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 10, 6 | 9, 7 | 11, 8 | 11, 9 | 8, 10 | 13, 11 | 12, 12 | 14 13 | ], 14 | "name": "Arvid" 15 | }, 16 | { 17 | "data": [ 18 | 13, 19 | 9, 20 | 10, 21 | 10, 22 | 8, 23 | null, 24 | 8, 25 | 6 26 | ], 27 | "name": "Yasin", 28 | "color": "#5A5A5A" 29 | } 30 | ], 31 | "chart": { 32 | "type": "area", 33 | "zoomType": "x" 34 | }, 35 | "plotOptions": { 36 | "area": { 37 | "fillOpacity": 0.5 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-49.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 10, 6 | 30, 7 | { 8 | "isIntermediateSum": true 9 | }, 10 | -4, 11 | -8, 12 | { 13 | "isSum": true 14 | } 15 | ] 16 | } 17 | ], 18 | "chart": { 19 | "type": "waterfall", 20 | "zoomType": "x" 21 | }, 22 | "legend": { 23 | "enabled": false 24 | }, 25 | "xAxis": { 26 | "categories": [ 27 | "Opening stocks", 28 | "Production", 29 | "Total domestic supply", 30 | "Net exports", 31 | "Consumption", 32 | "Closing stocks" 33 | ] 34 | } 35 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-50.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | { 6 | "y": 120000, 7 | "color": "#059669" 8 | }, 9 | { 10 | "y": 569000, 11 | "color": "#059669" 12 | }, 13 | { 14 | "y": 231000, 15 | "color": "#059669" 16 | }, 17 | { 18 | "isIntermediateSum": true 19 | }, 20 | { 21 | "y": -342000, 22 | "color": "#ef4444" 23 | }, 24 | { 25 | "y": -233000, 26 | "color": "#ef4444" 27 | }, 28 | { 29 | "isSum": true 30 | } 31 | ], 32 | "showInLegend": false, 33 | "dataLabels": { 34 | "enabled": true, 35 | "format": "{point.y:,:0f}" 36 | } 37 | } 38 | ], 39 | "chart": { 40 | "type": "waterfall", 41 | "zoomType": "x" 42 | }, 43 | "xAxis": { 44 | "categories": [ 45 | "Services revenues", 46 | "Product revenues", 47 | "Licensing revenues", 48 | "Total revenues", 49 | "Fixed costs", 50 | "Variable costs", 51 | "Profit (loss)" 52 | ] 53 | } 54 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-51.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | [ 6 | 1670457600000.0, 7 | 1 8 | ], 9 | [ 10 | 1670544000000.0, 11 | 3 12 | ], 13 | [ 14 | 1670630400000.0, 15 | 5 16 | ], 17 | [ 18 | 1670716800000.0, 19 | 4 20 | ], 21 | [ 22 | 1670803200000.0, 23 | 3 24 | ], 25 | [ 26 | 1670889600000.0, 27 | 5 28 | ], 29 | [ 30 | 1670976000000.0, 31 | 2 32 | ] 33 | ] 34 | } 35 | ], 36 | "chart": { 37 | "type": "line", 38 | "zoomType": "x" 39 | }, 40 | "xAxis": { 41 | "type": "datetime", 42 | "labels": { 43 | "format": "Midnight on {value:%d %b}" 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-58.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 3, 7 | 2, 8 | 4, 9 | 3 10 | ], 11 | "name": "Series A" 12 | }, 13 | { 14 | "data": [ 15 | 8, 16 | 1, 17 | 0, 18 | 3, 19 | 1 20 | ], 21 | "name": "Series B" 22 | } 23 | ], 24 | "chart": { 25 | "type": "column", 26 | "zoomType": "x" 27 | }, 28 | "plotOptions": { 29 | "column": { 30 | "groupPadding": 0.1, 31 | "pointPadding": 0.05 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-8.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 1, 6 | 1, 7 | 2, 8 | 3, 9 | 5, 10 | 8 11 | ], 12 | "name": "Fibonacci series" 13 | } 14 | ], 15 | "chart": { 16 | "zoomType": "x" 17 | } 18 | } -------------------------------------------------------------------------------- /tests/regression-tests/data/chart-9.regtest.json: -------------------------------------------------------------------------------- 1 | { 2 | "series": [ 3 | { 4 | "data": [ 5 | 46.1, 6 | 48.2 7 | ], 8 | "name": "Hillary Clinton", 9 | "type": "column", 10 | "color": "rgb(18,8,55)" 11 | }, 12 | { 13 | "data": [ 14 | 57.3, 15 | 42.7 16 | ], 17 | "name": "Donald Trump", 18 | "type": "column", 19 | "color": "rgb(202,0,4)" 20 | } 21 | ], 22 | "chart": { 23 | "zoomType": "x" 24 | }, 25 | "title": { 26 | "text": "US 2016 Presidential election results" 27 | }, 28 | "yAxis": { 29 | "title": { 30 | "text": "" 31 | }, 32 | "labels": { 33 | "format": "{value}%" 34 | } 35 | }, 36 | "xAxis": { 37 | "categories": [ 38 | "Electoral vote", 39 | "Popular vote" 40 | ] 41 | } 42 | } -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-1.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("column") 8 | chart.title = "France Olympic medals" 9 | chart.subtitle = "by year and by medal class" 10 | chart.categories = ["Gold", "Silver", "Bronze"] 11 | chart.yAxis.title.text = "medals" 12 | chart.plot([7, 16, 18], name=2008) 13 | chart.plot([11, 11, 13], name=2012) 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-10.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # data is a pd.DataFrame with world population by continent 8 | # in 1950, 2017, 2030, 2050 and 2100 9 | data = easychart.datasets.load("populations") 10 | 11 | chart = easychart.new() 12 | chart.title = "Distribution of world population by continent" 13 | chart.subtitle = "UN World Population Prospect (2017)" 14 | chart.stacking = "percent" 15 | chart.yAxis.labels.format = "{value}%" 16 | chart.tooltip = ("shared", "{value:.1}%") 17 | for column in data.columns[::-1]: 18 | chart.plot(data[column], index=data.index, type="area", marker=False) 19 | chart.vband( 20 | 2020, 21 | 2100, 22 | color="rgba(200,200,200,0.2)", 23 | zIndex=20, 24 | label={"text": "forecast", "style": {"color": "white"}}, 25 | ) 26 | 27 | regression.check(chart.serialize()) 28 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-12.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | [0, 15], 9 | [10, -50], 10 | [20, -56.5], 11 | [30, -46.5], 12 | [40, -22.1], 13 | [50, -2.5], 14 | [60, -27.7], 15 | [70, -55.7], 16 | [80, -76.5], 17 | ] 18 | 19 | chart = easychart.new() 20 | chart.title = "Atmosphere Temperature by Altitude" 21 | chart.subtitle = "According to the Standard Atmosphere Model" 22 | chart.chart = {"type": "spline", "inverted": True} 23 | 24 | with chart.xAxis as axis: 25 | axis.reversed = False 26 | axis.title.text = "Altitude" 27 | axis.labels.format = "{value} km" 28 | 29 | with chart.yAxis as axis: 30 | axis.labels.format = "{value}°" 31 | axis.title.text = "Temperature" 32 | axis.title.rotation = 0 33 | 34 | chart.tooltip.headerFormat = "{series.name}
" 35 | chart.tooltip.pointFormat = "{point.x} km: {point.y}°C" 36 | 37 | chart.legend.enabled = False 38 | chart.plot(data, name="temperature") 39 | 40 | regression.check(chart.serialize()) 41 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-14.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # min, Q1, median, Q3, max 8 | data = [ 9 | [760, 801, 848, 895, 965], 10 | [733, 853, 939, 980, 1080], 11 | [714, 762, 817, 870, 918], 12 | [724, 802, 806, 871, 950], 13 | [834, 836, 864, 882, 910], 14 | ] 15 | 16 | chart = easychart.new(type="boxplot") 17 | chart.categories = ["A", "B", "C", "D", "E"] 18 | chart.plot(data, name="distribution of values") 19 | 20 | regression.check(chart.serialize()) 21 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-15.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new() 8 | chart.chart.type = "line" 9 | chart.chart.polar = True 10 | chart.categories = [ 11 | "Sales", 12 | "Marketing", 13 | "Development", 14 | "Support", 15 | "Technology", 16 | "Administration", 17 | ] 18 | chart.plot( 19 | [43000, 19000, 60000, 35000, 17000, 10000], pointPlacement="on", name="budget" 20 | ) 21 | chart.plot( 22 | [50000, 39000, 42000, 31000, 26000, 14000], pointPlacement="on", name="actual" 23 | ) 24 | 25 | regression.check(chart.serialize()) 26 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-17.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | [-9.9, 10.3], 9 | [-8.6, 8.5], 10 | [-10.2, 11.8], 11 | [-1.7, 12.2], 12 | [-0.6, 23.1], 13 | [3.7, 25.4], 14 | [6.0, 26.2], 15 | [6.7, 21.4], 16 | [3.5, 19.5], 17 | [-1.3, 16.0], 18 | [-8.7, 9.4], 19 | [-9.0, 8.6], 20 | ] 21 | 22 | chart = easychart.new("columnrange") 23 | chart.title = "Temperature variation by month" 24 | chart.subtitle = "Observed in Vik i Sogn, Norway, 2017" 25 | chart.tooltip = "{value}°C" 26 | chart.yAxis.title.text = "Temperature ( °C )" 27 | chart.legend = False 28 | chart.inverted = True 29 | chart.categories = [ 30 | "Jan", 31 | "Feb", 32 | "Mar", 33 | "Apr", 34 | "May", 35 | "Jun", 36 | "Jul", 37 | "Aug", 38 | "Sep", 39 | "Oct", 40 | "Nov", 41 | "Dec", 42 | ] 43 | chart.plot(data, name="Temperature") 44 | 45 | regression.check(chart.serialize()) 46 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-18.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import pandas as pd 6 | import easychart 7 | 8 | data = pd.DataFrame( 9 | [ 10 | [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6], 11 | [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8], 12 | ], 13 | index=["Tokyo", "London"], 14 | columns=[ 15 | "Jan", 16 | "Feb", 17 | "Mar", 18 | "Apr", 19 | "May", 20 | "Jun", 21 | "Jul", 22 | "Aug", 23 | "Sep", 24 | "Oct", 25 | "Nov", 26 | "Dec", 27 | ], 28 | ) 29 | 30 | chart = easychart.new("line") 31 | chart.title = "Monthly Average Temperature" 32 | chart.subtitle = "Source: WorldClimate.com" 33 | chart.categories = data.columns 34 | chart.yAxis.title.text = "Temperature (°C)" 35 | for city in data.index: 36 | chart.plot(data.loc[city], name=city, labels="{point.y}°C") 37 | 38 | regression.check(chart.serialize()) 39 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-19.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # some data 8 | data = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] 9 | 10 | chart = easychart.new("line") 11 | chart.title = "Logarithmic series" 12 | chart.yAxis.type = "logarithmic" 13 | chart.plot(data) 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-2.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # data is a pd.Series of the US unemployment rate 8 | data = easychart.datasets.load("unemployment") 9 | 10 | chart = easychart.new(datetime=True, title="US unemployment rate", zoom="x") 11 | chart.subtitle = "Source: Federal Reserve (FRED)" 12 | chart.yAxis.labels.format = "{value}%" 13 | chart.plot(data, name="unemployment rate") 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-20.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("column") 8 | chart.stacked = True 9 | chart.title = "Total fruit consumption, grouped by gender" 10 | chart.categories = ["Apples", "Oranges", "Pears", "Grapes", "Bananas"] 11 | with chart.yAxis as axis: 12 | axis.allowDecimals = False 13 | axis.min = 0 14 | axis.title.text = "Number of fruits" 15 | chart.tooltip = "{value:.0f}" 16 | chart.plot([5, 3, 4, 7, 2], name="John", stack="male") 17 | chart.plot([3, 4, 4, 2, 5], name="Joe", stack="male") 18 | chart.plot([2, 5, 6, 2, 1], name="Jane", stack="female") 19 | chart.plot([3, 0, 4, 4, 3], name="Janet", stack="female") 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-23.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | 8 | data = pd.DataFrame( 9 | [ 10 | [107, 31, 635, 203, 2], 11 | [133, 156, 947, 408, 6], 12 | [814, 841, 3714, 727, 31], 13 | [1216, 1001, 4436, 738, 40], 14 | ], 15 | index=[1800, 1900, 2000, 2016], 16 | columns=["Africa", "America", "Asia", "Europe", "Oceania"], 17 | ) 18 | 19 | chart = easychart.new("bar") 20 | chart.title = "Historic World Population by Region" 21 | chart.subtitle = "Source: Wikipedia.org" 22 | chart.categories = data.columns 23 | chart.yAxis.title = {"text": "Population (millions)", "align": "high"} 24 | chart.tooltip = "{value:.0f}m" 25 | for year in data.index: 26 | chart.plot(data.loc[year], name=year, datalabels=(year == 2016)) 27 | 28 | regression.check(chart.serialize()) 29 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-24.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import datetime 7 | 8 | # fancy fibonacci one-liner 9 | fib = lambda x: 1 if x < 2 else fib(x - 1) + fib(x - 2) 10 | 11 | x = [datetime.time(x) for x in range(14)] 12 | y = [fib(x + 1) for x in range(14)] 13 | 14 | chart = easychart.new(datetime=True) 15 | chart.plot(y, index=x, name="example") 16 | 17 | regression.check(chart.serialize()) 18 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-25.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import datetime 7 | 8 | # fancy fibonacci one-liner 9 | fib = lambda x: 1 if x < 2 else fib(x - 1) + fib(x - 2) 10 | 11 | x = [datetime.time(x) for x in range(14)] 12 | y = [fib(x + 1) for x in range(14)] 13 | 14 | chart = easychart.new(datetime=True) 15 | chart.xAxis.labels.format = "{value:%H:%M}" 16 | chart.tooltip.xDateFormat = "%H:%M" 17 | chart.plot(y, index=x, name="another example") 18 | 19 | regression.check(chart.serialize()) 20 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-26.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | labels = ["O", "A", "B", "AB"] 8 | values = [45, 40, 11, 4] 9 | 10 | chart = easychart.new("pie", title="Distribution of blood type in the US") 11 | chart.subtitle = "Source: American Red Cross" 12 | chart.tooltip = "{point.percentage:.0f}%" 13 | chart.plot(values, index=labels, labels="{point.name} ({point.y}%)") 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-27.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["Brazil", "Portugal", 5], 9 | ["Brazil", "France", 1], 10 | ["Canada", "Portugal", 1], 11 | ["Canada", "France", 5], 12 | ["Mexico", "Portugal", 1], 13 | ["Mexico", "France", 1], 14 | ["USA", "Portugal", 1], 15 | ["USA", "France", 1], 16 | ["Portugal", "Angola", 2], 17 | ["Portugal", "Senegal", 1], 18 | ["France", "Angola", 1], 19 | ["France", "Senegal", 3], 20 | ["Spain", "Senegal", 1], 21 | ["Spain", "Morocco", 3], 22 | ["England", "Morocco", 2], 23 | ["England", "South Africa", 7], 24 | ["South Africa", "China", 5], 25 | ["Angola", "Japan", 3], 26 | ["Senegal", "India", 1], 27 | ["Senegal", "Japan", 3], 28 | ["Mali", "India", 1], 29 | ["Morocco", "India", 1], 30 | ["Morocco", "Japan", 3], 31 | ] 32 | 33 | chart = easychart.new(type="sankey") 34 | chart.title = "Sankey diagram" 35 | chart.subtitle = ( 36 | "Flow diagram in which the width of the arrows is proportional to the flow rate" 37 | ) 38 | chart.plot(data, keys=["from", "to", "weight"]) 39 | 40 | regression.check(chart.serialize()) 41 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-28.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["Austria", 69, 82], 9 | ["Belgium", 70, 81], 10 | ["Bulgaria", 69, 75], 11 | ["Croatia", 65, 78], 12 | ["Cyprus", 70, 81], 13 | ["Czech Republic", 70, 79], 14 | ["Denmark", 72, 81], 15 | ["Estonia", 68, 78], 16 | ["Finland", 69, 81], 17 | ["France", 70, 83], 18 | ["Greece", 68, 81], 19 | ["Spain", 69, 83], 20 | ["Netherlands", 73, 82], 21 | ["Ireland", 70, 82], 22 | ["Lithuania", 70, 75], 23 | ["Luxembourg", 68, 83], 24 | ["Latvia", 70, 75], 25 | ["Malta", 69, 82], 26 | ["Germany", 69, 81], 27 | ["Poland", 68, 78], 28 | ["Portugal", 63, 81], 29 | ["Romania", 66, 75], 30 | ["Slovakia", 70, 77], 31 | ["Slovenia", 69, 81], 32 | ["Sweden", 73, 82], 33 | ["Hungary", 68, 76], 34 | ["Italy", 69, 83], 35 | ["UK", 71, 81], 36 | ] 37 | 38 | chart = easychart.new(type="dumbbell") 39 | chart.title = "Change in Life Expectancy" 40 | chart.subtitle = "1960 vs 2018" 41 | chart.chart.inverted = True 42 | chart.xAxis.type = "category" 43 | chart.yAxis.title.text = "Life expectancy (years)" 44 | chart.plot(data, keys=["name", "low", "high"], legend=False) 45 | 46 | regression.check(chart.serialize()) 47 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-29.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | {"name": "Chrome", "y": 61.41, "sliced": True}, 9 | {"name": "Internet Explorer", "y": 11.84}, 10 | {"name": "Firefox", "y": 10.85}, 11 | {"name": "Edge", "y": 4.67}, 12 | {"name": "Safari", "y": 4.18}, 13 | {"name": "Other", "y": 7.05}, 14 | ] 15 | 16 | chart = easychart.new("pie") 17 | chart.title = "Browser market shares in January, 2018" 18 | chart.tooltip = "{point.name}: {point.percentage:.1f}%" 19 | chart.plot(data, name="browser") 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-3.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | labels = ["O", "A", "B", "AB"] 8 | values = [45, 40, 11, 4] 9 | 10 | chart = easychart.new("pie", title="Distribution of blood type in the US") 11 | chart.subtitle = "Source: American Red Cross" 12 | chart.tooltip = "{point.percentage:.0f}%" 13 | chart.plot([{"name": label, "y": value} for label, value in zip(labels, values)]) 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-30.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("pie") 8 | chart.plot( 9 | [ 10 | ["Chrome", 58.9], 11 | ["Firefox", 13.29], 12 | ["Internet Explorer", 13], 13 | ["Edge", 3.78], 14 | ["Safari", 3.42], 15 | ["Safari", 7.61], 16 | ], 17 | innerSize="50%", 18 | ) 19 | 20 | regression.check(chart.serialize()) 21 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-31.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["Chrome", 58.9], 9 | ["Firefox", 13.29], 10 | ["Internet Explorer", 13], 11 | ["Edge", 3.78], 12 | ["Safari", 3.42], 13 | ["Safari", 7.61], 14 | ] 15 | 16 | chart = easychart.new("pie") 17 | chart.plot(data) 18 | 19 | with chart.plotOptions.pie as options: 20 | options.startAngle = -90 21 | options.endAngle = 90 22 | 23 | # recenter the plot in the middle of the plot area 24 | options.center = ["50%", "75%"] 25 | 26 | regression.check(chart.serialize()) 27 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-32.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["Chrome", 58.9], 9 | ["Firefox", 13.29], 10 | ["Internet Explorer", 13], 11 | ["Edge", 3.78], 12 | ["Safari", 3.42], 13 | ["Safari", 7.61], 14 | ] 15 | 16 | chart = easychart.new("pie") 17 | chart.plot(data, innerSize="50%") 18 | 19 | with chart.plotOptions.pie as options: 20 | options.startAngle = -90 21 | options.endAngle = 90 22 | options.center = ["50%", "75%"] 23 | 24 | regression.check(chart.serialize()) 25 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-33.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | {"name": "Spain", "y": 505370, "z": 92.9}, 9 | {"name": "France", "y": 551500, "z": 118.7}, 10 | {"name": "Poland", "y": 312685, "z": 124.6}, 11 | {"name": "Czech Republic", "y": 78867, "z": 137.5}, 12 | {"name": "Italy", "y": 301340, "z": 201.8}, 13 | {"name": "Switzerland", "y": 41277, "z": 214.5}, 14 | {"name": "Germany", "y": 357022, "z": 235.6}, 15 | ] 16 | 17 | chart = easychart.new("variablepie") 18 | chart.title = "Countries compared by population density and total area" 19 | chart.plot(data, zMin=0, name="countries") 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-34.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | 8 | data = pd.Series([45, 40, 11, 4], index=["O", "A", "B", "AB"]) 9 | 10 | chart = easychart.new("pie", title="Distribution of blood type in the US") 11 | chart.subtitle = "Source: American Red Cross" 12 | chart.tooltip = "{point.percentage:.0f}%" 13 | chart.plot(data) 14 | 15 | regression.check(chart.serialize()) 16 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-35.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | 8 | data = pd.DataFrame( 9 | [[7, 16, 18], [11, 11, 13]], 10 | columns=["Gold", "Silver", "Bronze"], 11 | index=[2008, 2012], 12 | ).T 13 | 14 | chart = easychart.new("column") 15 | 16 | chart.title = "France Olympic medals" 17 | chart.subtitle = "by year and by medal class" 18 | chart.categories = data.index 19 | chart.yAxis.title.text = "medals" 20 | 21 | for column in data: 22 | chart.plot(data[column]) 23 | 24 | regression.check(chart.serialize()) 25 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-36.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | 8 | data = pd.DataFrame( 9 | [[5, 3, 4, 7, 2], [2, 2, 3, 2, 1], [3, 4, 4, 2, 5]], 10 | index=["John", "Jane", "Joe"], 11 | columns=["Apples", "Oranges", "Pears", "Grapes", "Bananas"], 12 | ) 13 | 14 | chart = easychart.new("bar") 15 | chart.stacked = True 16 | chart.categories = data.columns 17 | 18 | for person, row in data.iterrows(): 19 | chart.plot(row, name=person) 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-37.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | import requests 8 | 9 | # data is a pd.Series of the US unemployment rate 10 | data = easychart.datasets.load("unemployment") 11 | 12 | # recessions is a pd.DataFrame of the peak and trough dates 13 | # of US recessions since 1854, from the NBER 14 | res = requests.get("http://data.nber.org/data/cycles/business_cycle_dates.json") 15 | recessions = pd.DataFrame(res.json()).map(lambda d: pd.Timestamp(d))[1:] 16 | 17 | chart = easychart.new(datetime=True, title="US unemployment rate", zoom="x") 18 | chart.subtitle = "Source: Federal Reserve (FRED)" 19 | chart.yAxis.labels.format = "{value}%" 20 | chart.plot(data, name="unemployment rate") 21 | 22 | for i, recession in recessions.iterrows(): 23 | chart.vband(recession.peak, recession.trough) 24 | 25 | regression.check(chart.serialize()) 26 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-38.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import pandas as pd 6 | import easychart 7 | 8 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 9 | 10 | chart = easychart.new() 11 | chart.plot(data) 12 | 13 | regression.check(chart.serialize()) 14 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-39.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import pandas as pd 6 | import easychart 7 | 8 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 9 | 10 | chart = easychart.new() 11 | chart.plot(data, index=range(100, 130)) 12 | 13 | regression.check(chart.serialize()) 14 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-40.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import pandas as pd 6 | import easychart 7 | 8 | data = pd.Series([(x - 20) ** 2 + 3 for x in range(10, 30)], index=range(10, 30)) 9 | 10 | chart = easychart.new() 11 | chart.plot(data.values) 12 | 13 | regression.check(chart.serialize()) 14 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-41.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | import pandas as pd 7 | 8 | grades = pd.DataFrame( 9 | [[68, 87], [71, 85]], columns=["min", "max"], index=["male", "female"] 10 | ) 11 | 12 | chart = easychart.new("columnrange") 13 | chart.categories = grades.index 14 | chart.plot(grades, name="min-max range of grades") 15 | 16 | regression.check(chart.serialize()) 17 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-42.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import math 6 | import pandas as pd 7 | import easychart 8 | 9 | numbers = pd.DataFrame([[x, round(math.cos(x), 4)] for x in range(-100, 100)]) 10 | 11 | chart = easychart.new("scatter") 12 | chart.plot(numbers.values) # 2 columns only (no index) 13 | 14 | regression.check(chart.serialize()) 15 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-43.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import math 6 | import pandas as pd 7 | import easychart 8 | 9 | numbers = pd.DataFrame( 10 | [[round(math.cos(x), 4), round(math.sin(x), 4)] for x in range(-10, 10)], 11 | index=range(-10, 10), 12 | ) 13 | 14 | chart = easychart.new("bubble") 15 | chart.plot(numbers) # index + 2 columns 16 | 17 | regression.check(chart.serialize()) 18 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-44.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("column") 8 | chart.stacked = True 9 | chart.title = "Total fruit consumption, grouped by gender" 10 | chart.categories = ["Apples", "Oranges", "Pears", "Grapes", "Bananas"] 11 | with chart.yAxis as axis: 12 | axis.allowDecimals = False 13 | axis.min = 0 14 | axis.title.text = "Number of fruits" 15 | 16 | chart.tooltip = "{value:.0f}" 17 | chart.plot( 18 | [5, 3, 4, 7, 2], 19 | name="John", 20 | stack="male", 21 | labels="{point.y} fruits
({point.percentage:.0f}%)", 22 | ) 23 | chart.plot([3, 4, 4, 2, 5], name="Joe", stack="male", labels="{point.series.name}") 24 | chart.plot([2, 5, 6, 2, 1], name="Jane", stack="female", labels="{point.category}") 25 | chart.plot( 26 | [3, 0, 4, 4, 3], 27 | name="Janet", 28 | stack="female", 29 | labels="{point.y} out of {point.total}", 30 | ) 31 | 32 | regression.check(chart.serialize()) 33 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-46.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("area") 8 | chart.plotOptions.area.fillOpacity = 0.5 9 | chart.plot([10, 9, 11, 11, 8, 13, 12, 14], name="Arvid") 10 | chart.plot([13, 9, 10, 10, 8, None, 8, 6], name="Yasin", color="#5A5A5A") 11 | 12 | regression.check(chart.serialize()) 13 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-47.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new() 8 | chart.plot([50, 33, 68, 35, 46, 4, 35, 6, 19, 75, 22, 11]) 9 | chart.annotate( 10 | "Lowest point is here ({point.x}:{point.y})", x=5, y=4, width=100, yOffset=75 11 | ) 12 | chart.annotate("Highest point is here", x=9, y=75, width=100, xOffset=65) 13 | 14 | regression.check(chart.serialize()) 15 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-48.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("scatter") 8 | chart.xAxis.min = 0 9 | chart.xAxis.max = 6 10 | chart.plot([(1, 5), (3, 5), (5, 5)]) 11 | 12 | chart.annotate("Callout is the default shape", x=1, y=5) 13 | 14 | chart.annotate("Connector is akin to floating text", x=3, y=5, shape="connector") 15 | 16 | chart.annotate( 17 | "You may want to set a width to a long-text annotation to avoid it growing too large", 18 | x=5, 19 | y=5, 20 | width=100, 21 | ) 22 | 23 | regression.check(chart.serialize()) 24 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-49.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [10, 30, {"isIntermediateSum": True}, -4, -8, {"isSum": True}] 8 | 9 | chart = easychart.new("waterfall", legend=False) 10 | chart.categories = [ 11 | "Opening stocks", 12 | "Production", 13 | "Total domestic supply", 14 | "Net exports", 15 | "Consumption", 16 | "Closing stocks", 17 | ] 18 | chart.plot(data) 19 | 20 | regression.check(chart.serialize()) 21 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-5.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # data is a pd.DataFrame about 54k diamonds 8 | data = easychart.datasets.load("diamonds") 9 | 10 | # count number of diamonds by cut and color 11 | data = data.groupby(["color", "cut"])["price"].count().unstack() 12 | 13 | chart = easychart.new("column", title="Diamond inventories by cut and color") 14 | chart.categories = data.index 15 | chart.xAxis.title.text = "Diamond color" 16 | chart.yAxis.title.text = "Count" 17 | chart.stacking = "normal" 18 | for cut in data: 19 | chart.plot(data[cut], name=cut) 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-50.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | {"y": 120000, "color": "#059669"}, 9 | {"y": 569000, "color": "#059669"}, 10 | {"y": 231000, "color": "#059669"}, 11 | {"isIntermediateSum": True}, 12 | {"y": -342000, "color": "#ef4444"}, 13 | {"y": -233000, "color": "#ef4444"}, 14 | {"isSum": True}, 15 | ] 16 | 17 | chart = easychart.new("waterfall") 18 | chart.categories = [ 19 | "Services revenues", 20 | "Product revenues", 21 | "Licensing revenues", 22 | "Total revenues", 23 | "Fixed costs", 24 | "Variable costs", 25 | "Profit (loss)", 26 | ] 27 | 28 | chart.plot(data, labels="{point.y:,:0f}", legend=False) 29 | 30 | regression.check(chart.serialize()) 31 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-51.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import pandas as pd 6 | import easychart 7 | 8 | chart = easychart.new("line", datetime=True) 9 | chart.plot( 10 | [1, 3, 5, 4, 3, 5, 2], 11 | index=[pd.Timestamp(2022, 12, 8) + pd.Timedelta(days=i) for i in range(7)], 12 | ) 13 | 14 | chart.xAxis.labels.format = "Midnight on {value:%d %b}" 15 | 16 | regression.check(chart.serialize()) 17 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-52.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | datalabels = { 8 | "enabled": True, 9 | "format": "{point.y} {point.series.name} in {point.category} ({point.color})", 10 | "filter": {"property": "y", "operator": ">", "value": 0}, 11 | } 12 | 13 | chart = easychart.new("column") 14 | chart.stacked = True 15 | chart.title = "Adoptions per month, by animal" 16 | chart.categories = ["June", "July", "August"] 17 | chart.plot([1, 3, 5], name="cats", datalabels=datalabels) 18 | chart.plot([1, 0, 4], name="dogs", datalabels=datalabels) 19 | 20 | regression.check(chart.serialize()) 21 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-53.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | datalabels = { 8 | "enabled": True, 9 | "format": "{point.name}", 10 | "filter": {"property": "y", "operator": ">", "value": 0}, 11 | } 12 | 13 | def pluralize(quantity, label): 14 | """ 15 | Pluralize a category if quantity > 2 16 | """ 17 | if quantity < 2: 18 | return label 19 | return label + "s" 20 | 21 | def label(quantity, category): 22 | """ 23 | Create a data label for a given point (y) and category (category) 24 | """ 25 | return str(quantity) + " " + pluralize(quantity, category) 26 | 27 | chart = easychart.new("column") 28 | chart.stacked = True 29 | chart.title = "Adoptions per month, by animal" 30 | chart.categories = ["June", "July", "August"] 31 | chart.plot( 32 | [{"y": y, "name": label(y, "cat")} for y in [1, 3, 5]], 33 | name="cats", 34 | datalabels=datalabels, 35 | ) 36 | chart.plot( 37 | [{"y": y, "name": label(y, "dog")} for y in [2, 1, 5]], 38 | name="dogs", 39 | datalabels=datalabels, 40 | ) 41 | 42 | regression.check(chart.serialize()) 43 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-54.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["A", "D", 9, "#BCD4DE"], # gray 9 | ["A", "C", 2, "#FFD675"], # light yellow 10 | ["D", "E", 4, "#BCD4DE"], # gray 11 | ["D", "F", 4, "#BCD4DE"], # gray 12 | ["B", "C", 4, "#FFD675"], # light yellow 13 | ["B", "D", 4, "#BCD4DE"], # gray 14 | ["C", "E", 3, "#F7BA2D"], # darker yellow 15 | ["C", "F", 3, "#BCD4DE"], # gray 16 | ] 17 | 18 | chart = easychart.new(type="sankey") 19 | chart.plot(data, keys=["from", "to", "weight", "color"]) 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-55.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | data = [ 8 | ["A", "D", 9, "#BCD4DE"], # gray 9 | ["A", "C", 2, "#FFD675"], # light yellow 10 | ["D", "E", 4, "#BCD4DE"], # gray 11 | ["D", "F", 4, "#BCD4DE"], # gray 12 | ["B", "C", 4, "#FFD675"], # light yellow 13 | ["B", "D", 4, "#BCD4DE"], # gray 14 | ["C", "E", 3, "#F7BA2D"], # darker yellow 15 | ["C", "F", 3, "#BCD4DE"], # gray 16 | ] 17 | 18 | nodes = [ 19 | {"id": "A", "color": "#457b9d"}, # blue 20 | {"id": "B", "color": "#2a9d8f"}, # green 21 | {"id": "C", "color": "#e9c46a"}, # yellow 22 | {"id": "D", "color": "#f4a261"}, # orange 23 | {"id": "E", "color": "#e76f51"}, # red 24 | {"id": "F", "color": "#1d3557"}, # night 25 | ] 26 | 27 | chart = easychart.new(type="sankey") 28 | chart.plot(data, keys=["from", "to", "weight", "color"], nodes=nodes) 29 | 30 | regression.check(chart.serialize()) 31 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-56.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | labels = { 8 | "format": "{point.from} -> {point.to} {point.weight}km", 9 | "nodeFormat": "Node {point.name}", 10 | } 11 | 12 | data = [ 13 | ["A", "D", 9], 14 | ["A", "C", 2], 15 | ["D", "E", 4], 16 | ["D", "F", 4], 17 | ["B", "C", 4], 18 | ["B", "D", 2], 19 | ["C", "E", 3], 20 | ["C", "F", 3], 21 | ] 22 | 23 | chart = easychart.new(type="sankey") 24 | chart.plot(data, keys=["from", "to", "weight"], labels=labels) 25 | 26 | regression.check(chart.serialize()) 27 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-57.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | labels = [ 8 | { 9 | "format": "{point.from} -> {point.to} {point.weight}km", 10 | "filter": {"property": "weight", "operator": ">", "value": 3}, 11 | }, 12 | {"nodeFormat": "Point {point.name}"}, 13 | ] 14 | 15 | data = [ 16 | ["A", "D", 9], 17 | ["A", "C", 2], 18 | ["D", "E", 4], 19 | ["D", "F", 4], 20 | ["B", "C", 4], 21 | ["B", "D", 2], 22 | ["C", "E", 3], 23 | ["C", "F", 3], 24 | ] 25 | 26 | chart = easychart.new(type="sankey") 27 | chart.plot(data, keys=["from", "to", "weight"], labels=labels) 28 | 29 | regression.check(chart.serialize()) 30 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-58.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new("column") 8 | 9 | chart.plotOptions.column = {"groupPadding": 0.10, "pointPadding": 0.05} 10 | 11 | chart.plot([1, 3, 2, 4, 3], name="Series A") 12 | chart.plot([8, 1, 0, 3, 1], name="Series B") 13 | 14 | regression.check(chart.serialize()) 15 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-7.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | # compute the annual high, low and last value of the S&P since 2010 8 | data = easychart.datasets.load("S&P500")["Close"]["20100101":] 9 | data = data.groupby(data.index.year).agg(["min", "max", "last"]) 10 | 11 | chart = easychart.new(title="S&P 500 annual trading range", tooltip="shared") 12 | chart.plot( 13 | data[["min", "max"]], 14 | type="arearange", 15 | color="#eeeeee", 16 | name="annual range", 17 | marker={"enabled": False}, 18 | ) 19 | chart.plot(data["last"], name="end of year") 20 | 21 | regression.check(chart.serialize()) 22 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-8.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new() 8 | chart.plot([1, 1, 2, 3, 5, 8], name="Fibonacci series") 9 | 10 | regression.check(chart.serialize()) 11 | -------------------------------------------------------------------------------- /tests/regression-tests/tests/chart-9.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | def regress(regression): 5 | import easychart 6 | 7 | chart = easychart.new( 8 | title="US 2016 Presidential election results", ytitle="", yformat="{value}%" 9 | ) 10 | chart.categories = ["Electoral vote", "Popular vote"] 11 | chart.plot( 12 | [46.1, 48.2], name="Hillary Clinton", type="column", color="rgb(18,8,55)" 13 | ) 14 | chart.plot([57.3, 42.7], name="Donald Trump", type="column", color="rgb(202,0,4)") 15 | 16 | regression.check(chart.serialize()) 17 | -------------------------------------------------------------------------------- /tests/unit-tests/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import easychart 3 | 4 | 5 | def test_racechart_rendering(): 6 | charts = [] 7 | for i in range(100): 8 | chart = easychart.new() 9 | chart.plot([j for j in range(10, 30)]) 10 | charts.append(chart) 11 | 12 | assert easychart.ext.racechart(charts).render() 13 | assert easychart.ext.racechart(charts, options={"animate": True}).render() 14 | assert easychart.ext.racechart(charts, options={"animate": False}).render() 15 | 16 | assert easychart.ext.racechart( 17 | charts, options={"animate": False, "interval": 50} 18 | ).render() 19 | -------------------------------------------------------------------------------- /tests/unit-tests/functions.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import easychart 3 | 4 | 5 | def test_plot_arguments(): 6 | """ 7 | Test to ensure that arguments are dispatched to easychart.new 8 | and chart.plot appropriately 9 | """ 10 | chart = easychart.plot([1, 3, 2, 4], xtype="datetime", color="red") 11 | assert chart.series[0].color == "red" 12 | assert chart.xAxis.type == "datetime" 13 | -------------------------------------------------------------------------------- /tests/unit-tests/internals.py: -------------------------------------------------------------------------------- 1 | import easychart.internals as internals 2 | 3 | 4 | def test_flatten_singular_value(): 5 | assert internals.flatten(1) == [1] 6 | 7 | 8 | def test_flatten_multiple_singular_values(): 9 | assert internals.flatten(1, 2, 3) == [1, 2, 3] 10 | 11 | 12 | def test_flatten_multiple_depth(): 13 | assert internals.flatten(1, [2, 3]) == [1, 2, 3] 14 | 15 | 16 | def test_size_parsing(): 17 | assert isinstance(internals.Size(1), internals.Size.Pixels) 18 | assert isinstance(internals.Size(500), internals.Size.Pixels) 19 | assert isinstance(internals.Size("500"), internals.Size.Pixels) 20 | assert isinstance(internals.Size("500px"), internals.Size.Pixels) 21 | 22 | assert isinstance(internals.Size(0.5), internals.Size.Percentage) 23 | assert isinstance(internals.Size("1%"), internals.Size.Percentage) 24 | assert isinstance(internals.Size("100%"), internals.Size.Percentage) 25 | 26 | 27 | def test_size_int_values(): 28 | assert int(internals.Size(500)) == 500 29 | assert int(internals.Size("500")) == 500 30 | assert int(internals.Size("500px")) == 500 31 | 32 | assert int(internals.Size("95%")) == 95 33 | 34 | 35 | def test_size_float_values(): 36 | assert float(internals.Size(500)) == 500 37 | assert float(internals.Size("500")) == 500 38 | assert float(internals.Size("500px")) == 500 39 | 40 | assert float(internals.Size(0.5)) == 0.5 41 | assert float(internals.Size("95%")) == 0.95 42 | --------------------------------------------------------------------------------