idalin / echarts-python

Generate Echarts options with Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Echarts for Python

An unofficial Echarts options generator with Python.

Latest Version Travis CI Status Codecov Status Doc Status

Installation

Installing echarts-python with pip

$ pip install echarts-python

Current version for Echarts 3.1.6

Basic Usage

from echarts import Echart, Legend, Bar

chart = Echart('GDP', 'This is a fake chart')
chart.use(Bar('China', [2, 3, 4, 5]))
chart.use(Legend(['GDP']))
chart.use(Axis('category', 'bottom', data=['Nov', 'Dec', 'Jan', 'Feb']))

The chart.json property will be

{
    "series": [
        {
            "type": "bar",
            "zlevel": 0,
            "data": [2, 3, 4, 5],
            "name": "China"
        }
    ],
    "legend": {
        "y": "top",
        "x": "center",
        "data": [
            "China"
        ],
        "orient": "horizontal"
    },
    "title": {
        "text": "GDP",
        "subtext": "This is a fake chart"
    },
    "xAxis": [],
    "yAxis": []
}

Contribution

This package authored by Hsiaoming Yang <me@lepture.com> in 2014.

If you have any question or want to improve this repository, welcome to create an issue or pull requests .

This repo is maintained by Yufei Li <yufeiminds@gmail.com> now, you can also send a email to me.

About

Generate Echarts options with Python.


Languages

Language:Python 87.2%Language:Makefile 12.8%