Coder Social home page Coder Social logo

bevalz / pyecharts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pyecharts/pyecharts

0.0 2.0 0.0 68.81 MB

Python Echarts Plotting Library

License: MIT License

Makefile 0.01% Python 2.02% HTML 0.15% Jupyter Notebook 62.79% JavaScript 35.04% Shell 0.01%

pyecharts's Introduction

pyecharts

pyecharts is a library to generate charts using Echarts. It simply provides the interface between Echarts and Python.

Build Status

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.

Instatllation

pyecharts works on Python2 and Python3. The latest release is 0.1.9.4. For more information please refer to changelog.md

You can install it via pip

$ pip install pyecharts

or clone it and install it

$ git clone https://github.com/chenjiandongx/pyecharts.git
$ cd pyecharts
$ python setup.py install

Basic Usage

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 creat a file named render.html in the root directory, open file with your borwser.

usage-0

Working with pandas & numpy

import pandas as pd
import numpy as np

from pyecharts import Bar

index = pd.date_range('3/8/2017', periods=6, freq='M')
df1 = pd.DataFrame(np.random.randn(6), index=index)
df2 = pd.DataFrame(np.random.randn(6), index=index)

dtvalue1 = [i[0] for i in df1.values]
dtvalue2 = [i[0] for i in df2.values]

bar = Bar('Bar chart', 'Profit and loss situation')
bar.add('profit', df1.index, dtvalue1)
bar.add('loss', df2.index,  dtvalue2)
bar.render()

usage-1

working with Flask & Django

Flask

flask-0

Django

django-0

Documentation

Author

pyecharts is developed and maintained by chenjiandongx ([email protected])

License

pyecharts is released under the MIT License. See LICENSE for more information.

pyecharts's People

Contributors

chenjiandongx avatar chfw avatar landpack avatar kinegratii avatar miraclexyz avatar mowujilun avatar shkey avatar xbanke avatar

Watchers

James Cloos avatar BevalZ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.