

GitHub - pyecharts/pyecharts: ? Python Echarts Plotting Library
source link: https://github.com/pyecharts/pyecharts
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
pyecharts

pyecharts is a library to generate charts using Echarts. It simply provides the interface of 28+ kinds of charts between Echarts and Python.
Introduction
Echarts is an open source library from Baidu for data visualization in javascript. It has awesome demo pages so I started to look out for an interface library so that I could use it in Python. I ended up with echarts-python on github but it lacks of documentation and was not updated for a while. Just like many other Python projects, I started my own project, pyecharts, referencing echarts-python and another library pygal.
Installation
Python Compatibility
pyecharts works on Python2.7 and Python3.4+.
pyecharts handles all strings and files with unicode encoding and you MUST use unicode string on Python 2.
#coding=utf-8 from __future__ import unicode_literals
pyecharts
You can install it via pip
$ pip install pyecharts
or clone it and install it
$ git clone https://github.com/pyecharts/pyecharts.git
$ cd pyecharts
$ pip install -r requirements.txt
$ python setup.py install
Please note: since version 0.3.2, NO LONGER pyecharts comes with any map files. Please read next section for more informations.
map extensions
Here is a list of map extensions from pyecharts dev team:
- World countries include China map and World map: echarts-countries-pypkg (1.9MB)
- Chinese provinces and regions: echarts-china-provinces-pypkg (730KB)
- Chinese cities: echarts-china-cities-pypkg (3.8MB)
In order to install them, you can try one of them or all:
$ pip install echarts-countries-pypkg
$ pip install echarts-china-provinces-pypkg
$ pip install echarts-china-cities-pypkg
Basic Usage
Render to Local Html File
from pyecharts import Bar attr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] v1 = [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3] v2 = [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3] bar = Bar("Bar chart", "precipitation and evaporation one year") bar.add("precipitation", attr, v1, mark_line=["average"], mark_point=["max", "min"]) bar.add("evaporation", attr, v2, mark_line=["average"], mark_point=["max", "min"]) bar.render()
It will create a file named render.html in the root directory, open file with your borwser.
Export as Images or Pdf
pyecharts-snapshot is a library which renders the output of pyecharts as a png, jpeg, gif image or a pdf file at command line or in your code.
See more detail at the repositoty.
Platform Support
pyecharts exposes chart API and template API so that it can work on some common platforms.
Work on Jupyter Notebook
In the Notebook cell ,you can simply call the instance itself to diplay the chart.
All chart classes in pyecharts implement the _repr_html_
interface about IPython Rich Display .
In the case of online jshost mode,you can also download as some file formats (ipynb/py/html/pdf) and run without jupyter notebook enviromnment.
Integrate With Web Framework
With the help of pyecharts API,it is easy to integrate pyecharts to your web projects, such as Flask and Django.
Demo
Advance Topics
Cusom Template FIles and Layout
pyecharts exposes engine API so that you can use your own template file and integrate with CSS framework.
In addition,pyecharts also ships a lot of jinja2 template functions used in template files.
Custom Map Library
All map is hosted by the repository echarts-china-cities-js and echarts-countries-js .
Documentation
Examples
All examples is hosted on the repository pyecharts-users-cases .
Test
Unit Test
You should install the libraries in the requirements.txt files.
pip install -r test\requirements.txt
And run with the nose commands.
$ make
Quality Assurance
flake8 and pylint are used to improve the quality of code.
Continuous Integration
The project is developed with Travis CI and AppVeyor.
Author
License
pyecharts is released under the MIT License. See LICENSE for more information.
Recommend
-
165
Introducing Glot the plotting library for Golang...
-
128
glot is a plotting library for Golang built on top of gnuplot. glot currently supports styles like lines, points, bars, steps, histogram, circle, and many others. We...
-
38
前言 我们都知道python上的一款可视化工具 matplotlib ,而前些阵子做一个Spark项目的时候用到了百度开源的一个可视化JS工具- Echarts ,可视化类型非常多,但是得通过导入js库在Java...
-
41
GopherAcademy provides conferences, education, training, and community services to the Go programming language community.
-
65
README.rst
-
9
CandyGraph A flexible and fast-by-default 2D plotting library tuned for rendering huge datasets on the GPU at interactive speeds. Adopts D3's elegant concept of scales, but implements them on the GPU to maxim...
-
13
ScottPlot ScottPlot is a free and open-source plotting library for .NET that makes it easy to interactively display large datasets. The ScottPlot Cookbook...
-
6
第一章:实例演示 先给大家看下效果图哈。
-
9
[ 系列文章篇 ] 2022 见证中国崛起从 Python 绘制中国地图开始:使用 pyecharts 最新版本绘制中国地图实例详解...
-
8
Ecosystem Kandy: the new Kotlin plotting library by JetBrains ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK