diff --git a/.isort.cfg b/.isort.cfg index 3d282d0d..74fbd2e1 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,3 +1,3 @@ [settings] sections=FUTURE, STDLIB, FIRSTPARTY, THIRDPARTY, LOCALFOLDER -KNOWN_FIRST_PARTY=jinja2, lml, pyecharts_javascripthon, PIL, pandas, numpy +KNOWN_FIRST_PARTY=jinja2, lml, pandas, numpy, nose, mock diff --git a/docs/en-us/charts_base.md b/docs/en-us/charts_base.md index 821e71c4..90f7d246 100644 --- a/docs/en-us/charts_base.md +++ b/docs/en-us/charts_base.md @@ -1305,7 +1305,7 @@ kline.render() Line.add() signatures ```python add(name, x_axis, y_axis, is_symbol_show=True, is_smooth=False, is_stack=False, - is_step=False, is_fill=False, **kwargs) + is_step=False, **kwargs) ``` * name -> str Series name used for displaying in tooltip and filtering with legend,or updaing data and configuration with setOption. @@ -1332,10 +1332,6 @@ add(name, x_axis, y_axis, is_symbol_show=True, is_smooth=False, is_stack=False, default -> False Whether to show as a step line.It can be true, false. Or 'start', 'middle', 'end'.Which will configure the turn point of step line. -* is_fill -> bool - default -> False - Whether to fill area. - ```python from pyecharts import Line @@ -1365,7 +1361,6 @@ line.render() line = Line("折线图-数据堆叠示例") line.add("商家A", attr, v1, is_stack=True, is_label_show=True) line.add("商家B", attr, v2, is_stack=True, is_label_show=True) -line.show_config() line.render() ``` ![line-demo](https://user-images.githubusercontent.com/19553554/35089965-4f880100-fc73-11e7-9861-c43bd4d4bbe1.gif) @@ -1373,16 +1368,15 @@ line.render() ```python line = Line("折线图-阶梯图示例") line.add("商家A", attr, v1, is_step=True, is_label_show=True) -line.show_config() line.render() ``` ![line-demo](https://user-images.githubusercontent.com/19553554/35089968-510f3304-fc73-11e7-9159-67ce6ace9fa3.png) +**area_opacity:** Opacity of the component. Supports value from 0 to 1, and the component will not be drawn when set to 0. ```python line = Line("折线图-面积图示例") line.add("商家A", attr, v1, is_fill=True, line_opacity=0.2, area_opacity=0.4, symbol=None) line.add("商家B", attr, v2, is_fill=True, area_color='#000', area_opacity=0.3, is_smooth=True) -line.show_config() line.render() ``` ![line-demo](https://user-images.githubusercontent.com/19553554/35089973-53868fd8-fc73-11e7-8ff6-bfb452954267.png) diff --git a/docs/zh-cn/changelog.md b/docs/zh-cn/changelog.md index ccd7b332..b73042db 100644 --- a/docs/zh-cn/changelog.md +++ b/docs/zh-cn/changelog.md @@ -4,6 +4,9 @@ #### Updated * 将 pyecharts-javascripthon 合并入主仓库,并对该部分代码进行了重构。导入路径由 `from pyecharts_javascripthon import *` 转变为 `from pyecharts.javascripthon import *` + + ### Removed + * [issue#762](https://github.com/pyecharts/pyecharts/issues/762) 移除 `is_fill` 配置项,使用 `area_opacity` 指定区域透明度。 * ### version 0.5.11 - 2018.9.9(current) diff --git a/docs/zh-cn/charts_base.md b/docs/zh-cn/charts_base.md index 6825996e..6f14ffde 100644 --- a/docs/zh-cn/charts_base.md +++ b/docs/zh-cn/charts_base.md @@ -1426,8 +1426,7 @@ add(name, x_axis, y_axis, is_symbol_show=True, is_smooth=False, is_stack=False, - is_step=False, - is_fill=False, **kwargs) + is_step=False, **kwargs) ``` * name -> str 图例名称 @@ -1444,8 +1443,6 @@ add(name, x_axis, y_axis, * is_step -> bool/str 是否是阶梯线图。可以设置为 True 显示成阶梯线图。默认为 False 也支持设置成'start', 'middle', 'end'分别配置在当前点,当前点与下个点的中间下个点拐弯。 -* is_fill -> bool - 是否填充曲线所绘制面积,默认为 False ```python from pyecharts import Line @@ -1517,13 +1514,13 @@ line.render() ``` ![line-demo](https://user-images.githubusercontent.com/19553554/35089968-510f3304-fc73-11e7-9159-67ce6ace9fa3.png) +**使用 area_opacity:** area_opacity 用于指定区域透明度,0 为完全不透明(默认),1 为完全透明。 ```python line = Line("折线图-面积图示例") line.add( "商家A", attr, v1, - is_fill=True, line_opacity=0.2, area_opacity=0.4, symbol=None, diff --git a/format_code.sh b/format_code.sh index f1b3046e..96f0ca0b 100644 --- a/format_code.sh +++ b/format_code.sh @@ -1,3 +1,2 @@ isort $(find pyecharts -name "*.py"|xargs echo) $(find test -name "*.py"|xargs echo) setup.py black -l 79 pyecharts test - diff --git a/pyecharts/chart.py b/pyecharts/chart.py index 25c8829f..674ea44c 100644 --- a/pyecharts/chart.py +++ b/pyecharts/chart.py @@ -206,7 +206,6 @@ class Chart(Base): is_convert=None, is_datazoom_show=None, is_datazoom_extra_show=None, - is_fill=None, is_focusnode=None, is_geo_effect_show=None, is_grid3d_rotate=None, diff --git a/pyecharts/charts/line.py b/pyecharts/charts/line.py index f8edf7db..5b5b15a7 100644 --- a/pyecharts/charts/line.py +++ b/pyecharts/charts/line.py @@ -27,7 +27,6 @@ class Line(Chart): is_smooth=False, is_stack=False, is_step=False, - is_fill=False, **kwargs ): """ @@ -48,8 +47,6 @@ class Line(Chart): 是否是阶梯线图。可以设置为 True 显示成阶梯线图。默认为 False。 也支持设置成'start', 'middle', 'end'分别配置在当前点,当前点与下个 点的中间下个点拐弯。 - :param is_fill: - 是否填充曲线所绘制面积,默认为 False。 :param kwargs: """ assert len(x_axis) == len(y_axis) diff --git a/test/test_bar3D.py b/test/test_bar3D.py index b5d59ee0..55990b16 100644 --- a/test/test_bar3D.py +++ b/test/test_bar3D.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals from test.constants import RANGE_COLOR, X_TIME, Y_WEEK from nose.tools import eq_ + from pyecharts import Bar3D data = [ diff --git a/test/test_base.py b/test/test_base.py index 6d369815..82b5d8a4 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -9,11 +9,10 @@ from test.utils import get_default_rendering_file_content import numpy as np import pandas as pd - -import pyecharts.exceptions as exceptions from mock import MagicMock, patch from nose.tools import eq_, raises -from pyecharts import Bar, Map, jupyter_image, online + +from pyecharts import Bar, Map, exceptions, jupyter_image, online from pyecharts.conf import CURRENT_CONFIG TITLE = "柱状图数据堆叠示例" diff --git a/test/test_chart_properties.py b/test/test_chart_properties.py index ae915856..5b8056a4 100644 --- a/test/test_chart_properties.py +++ b/test/test_chart_properties.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals from test.constants import CLOTHES, WEEK from nose.tools import eq_ + from pyecharts import Bar, Grid, Line from pyecharts.base import Base diff --git a/test/test_conf.py b/test/test_conf.py index 4974e955..fe1dcae3 100644 --- a/test/test_conf.py +++ b/test/test_conf.py @@ -7,6 +7,7 @@ Test Target: js_embed (should render