forked from pyecharts/pyecharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af9ac02
commit 8b87e3a
Showing
97 changed files
with
2,260 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,7 @@ __pycache__/ | |
.idea | ||
# Distribution / packaging | ||
.Python | ||
/json/ | ||
/js/ | ||
/images_/ | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
```python | ||
import math | ||
from pyecharts import Polar | ||
|
||
data = [] | ||
for i in range(101): | ||
theta = i / 100 * 360 | ||
r = 5 * (1 + math.sin(theta / 180 * math.pi)) | ||
data.append([r, theta]) | ||
hour = [i for i in range(1, 25)] | ||
polar = Polar("极坐标系示例", width=1200, height=600) | ||
polar.add("Love", data, angle_data=hour, boundary_gap=False,start_angle=0) | ||
polar.show_config() | ||
polar.render() | ||
``` | ||
![example-0](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-0.png) | ||
|
||
```python | ||
import math | ||
from pyecharts import Polar | ||
|
||
data = [] | ||
for i in range(361): | ||
t = i / 180 * math.pi | ||
r = math.sin(2 * t) * math.cos(2 * t) | ||
data.append([r, i]) | ||
polar = Polar("极坐标系示例", width=1200, height=600) | ||
polar.add("Flower", data, start_angle=0, symbol=None, axis_range=[0, None]) | ||
polar.show_config() | ||
polar.render() | ||
``` | ||
![example-1](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-1.png) | ||
|
||
```python | ||
from pyecharts import Scatter | ||
|
||
scatter = Scatter("散点图示例", width=800, height=480) | ||
v1 ,v2 = scatter.draw("../images/love.png") | ||
scatter.add("Love", v1, v2) | ||
scatter.render() | ||
``` | ||
![example-2](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-2.png) | ||
|
||
```python | ||
from pyecharts import Scatter | ||
|
||
scatter = Scatter("散点图示例", width=1000, height=480) | ||
v1 ,v2 = scatter.draw("../images/cup.png") | ||
scatter.add("Cup", v1, v2) | ||
scatter.render() | ||
``` | ||
![example-3](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-3.png) | ||
|
||
```python | ||
from pyecharts import Scatter | ||
|
||
scatter = Scatter("散点图示例", width=1000, height=480) | ||
v1 ,v2 = scatter.draw("../images/cup.png") | ||
scatter.add("Cup", v1, v2, label_color=["#000"]) | ||
scatter.render() | ||
``` | ||
![example-4](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-4.png) | ||
|
||
```python | ||
from pyecharts import Line | ||
|
||
attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日', ] | ||
line = Line("折线图示例") | ||
line.add("最高气温", attr, [11, 11, 15, 13, 12, 13, 10], mark_point=["max", "min"],mark_line=["average"]) | ||
line.add("最低气温", attr, [1, -2, 2, 5, 3, 2, 0], mark_point=["max", "min"], mark_line=["average"], yaxis_formatter="°C") | ||
line.show_config() | ||
line.render() | ||
``` | ||
![example-5](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-5.gif) | ||
|
||
```python | ||
from pyecharts import Pie | ||
|
||
pie = Pie("饼图示例", title_pos='center', width=1000, height=600) | ||
pie.add("", ['A', 'B', 'C', 'D', 'E', 'F'], [335, 321, 234, 135, 251, 148], radius=[40, 55],is_label_show=True) | ||
pie.add("", ['H', 'I', 'J'], [335, 679, 204], radius=[0, 30], legend_orient='vertical', legend_pos='left') | ||
pie.show_config() | ||
pie.render() | ||
``` | ||
![example-6](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-6.png) | ||
|
||
```python | ||
import random | ||
from pyecharts import Pie | ||
|
||
attr = ['A', 'B', 'C', 'D', 'E', 'F'] | ||
pie = Pie("饼图示例", width=1000, height=600) | ||
pie.add("", attr, [random.randint(0, 100) for _ in range(6)], radius=[50, 55], center=[25, 50],is_random=True) | ||
pie.add("", attr, [random.randint(20, 100) for _ in range(6)], radius=[0, 45], center=[25, 50],rosetype='area') | ||
pie.add("", attr, [random.randint(0, 100) for _ in range(6)], radius=[50, 55], center=[65, 50],is_random=True) | ||
pie.add("", attr, [random.randint(20, 100) for _ in range(6)], radius=[0, 45], center=[65, 50],rosetype='radius') | ||
pie.show_config() | ||
pie.render() | ||
``` | ||
![example-7](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-7.gif) | ||
|
||
```python | ||
from pyecharts import Bar | ||
|
||
attr = ["{}月".format(i) for i in range(1, 13)] | ||
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.add("蒸发量", attr, v1, mark_line=["average"], mark_point=["max", "min"]) | ||
bar.add("降水量", attr, v2, mark_line=["average"], mark_point=["max", "min"]) | ||
bar.show_config() | ||
bar.render() | ||
``` | ||
![example-8](https://github.com/chenjiandongx/pyecharts/blob/master/images/example-8.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
__title__ = 'pyecharts' | ||
__description__ = 'Python echarts, make charting easier' | ||
__url__ = 'https://github.com/chenjiandongx/pyecharts' | ||
__version__ = '1.1.4' | ||
__version__ = '0.1.1' | ||
__author__ = 'chenjiandongx' | ||
__author_email__ = '[email protected]' | ||
__license__ = 'MIT' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.charts.scatter import Scatter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
||
class Liquid(Base): | ||
""" | ||
<<< 水球图 >>> | ||
主要用来突出数据的百分比 | ||
""" | ||
def __init__(self, title="", subtitle="", **kwargs): | ||
super(Liquid, self).__init__(title, subtitle, **kwargs) | ||
|
||
def add(self, *args, **kwargs): | ||
self.__add(*args, **kwargs) | ||
|
||
def __add(self, name, data, | ||
shape='circle', | ||
liquid_color=None, | ||
is_liquid_animation=True, | ||
is_liquid_outline_show=True, | ||
**kwargs): | ||
""" | ||
:param name: | ||
图例名称 | ||
:param data: | ||
数据项 | ||
:param shape: | ||
水球外形,有'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'可选 | ||
:param liquid_color: | ||
波浪颜色 | ||
:param is_liquid_animation: | ||
是否显示波浪动画 | ||
:param is_liquid_outline_show: | ||
是否显示边框 | ||
:param kwargs: | ||
:return: | ||
""" | ||
_animation_dur, _animation_dur_update = 2000, 1000 | ||
if not is_liquid_animation: | ||
_animation_dur, _animation_dur_update = 0, 0 | ||
|
||
_color = ['#294D99', '#156ACF', '#1598ED', '#45BDFF'] | ||
if liquid_color: | ||
_color = liquid_color | ||
|
||
_shape = 'circle' | ||
if shape in ('circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'): | ||
_shape = shape | ||
|
||
self._option.get('series').append({ | ||
"type": "liquidFill", | ||
"name": name, | ||
"data": data, | ||
"waveAnimation": is_liquid_animation, | ||
"animationDuration": _animation_dur, | ||
"animationDurationUpdate": _animation_dur_update, | ||
"color": _color, | ||
"shape": _shape, | ||
"outline": {"show": is_liquid_outline_show} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#coding=utf-8 | ||
|
||
from pyecharts.base import Base | ||
|
Oops, something went wrong.