Skip to content

Commit

Permalink
Release version 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Aug 15, 2019
2 parents aa52a0b + 4135ad0 commit 1a7b2c2
Show file tree
Hide file tree
Showing 41 changed files with 3,051 additions and 81 deletions.
35 changes: 35 additions & 0 deletions example/bar_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,39 @@ def bar_with_brush() -> Bar:
return c


@C.funcs
def bar_custom_bar_color() -> Bar:
color_function = """
function (params) {
if (params.value > 0 && params.value < 50) {
return 'red';
} else if (params.value > 50 && params.value < 100) {
return 'blue';
}
return 'green';
}
"""
c = (
Bar()
.add_xaxis(Faker.choose())
.add_yaxis(
"商家A",
Faker.values(),
itemstyle_opts=opts.ItemStyleOpts(color=JsCode(color_function)),
)
.add_yaxis(
"商家B",
Faker.values(),
itemstyle_opts=opts.ItemStyleOpts(color=JsCode(color_function)),
)
.add_yaxis(
"商家C",
Faker.values(),
itemstyle_opts=opts.ItemStyleOpts(color=JsCode(color_function)),
)
.set_global_opts(title_opts=opts.TitleOpts(title="Bar-自定义柱状颜色"))
)
return c


Page().add(*[fn() for fn, _ in C.charts]).render()
1 change: 0 additions & 1 deletion example/bmap_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

@C.funcs
def bmap_base() -> BMap:

c = (
BMap()
.add_schema(baidu_ak=BAIDU_MAP_AK, center=[120.13066322374, 30.240018034923])
Expand Down
Loading

0 comments on commit 1a7b2c2

Please sign in to comment.