查看原文: 原文地址
python pyecharts 库 数据可视化
作者微信公众号:小卫星
操作系统: Windows 10
IDE: PyCharm Community 2018.1
Python 3.7
1、安装
$ pip install pyecharts
或者源码安装:
$ git clone https://github.com/pyecharts/pyecharts.git
$ cd pyecharts
$ pip install -r requirements.txt
$ python setup.py install
安装地图:
$ pip install echarts-countries-pypkg
$ pip install echarts-china-provinces-pypkg
$ pip install echarts-china-cities-pypkg
$ pip install echarts-china-counties-pypkg
$ pip install echarts-china-misc-pypkg
$ pip install echarts-united-kingdom-pypkg
2、测试
import random from pyecharts import Polar, Page, Style import math #from app.charts.constants import WIDTH, HEIGHT WIDTH = 600 HEIGHT = 400 def create_charts(): page = Page() style = Style(width=WIDTH, height=HEIGHT) data = [] for i in range(361): t = i / 180 * math.pi r = math.sin(<