pyecharts/example/table_example.py
陈键冬 dc7617f7f7
PR: add pictorialbar chart type and fix some bugs (#1158)
* Add: pictorialBar chart

* Update: 减少代码量

* Add: 为 Gauge 新增配置项

* Format: code

* Update: example

* Add: test

* Fix: test

* Fix: broken test

* Add: more examples

* Update: add itemstyle_opts for MarkPointItem

* Fix: 修复 geo data 参数逻辑判断

* Fix: CurrentConfig.ONLINE_HOST 表现不一致的问题

* Update: example

* Update: GeoChartBase 子类处理 data 逻辑
2019-06-01 15:14:51 +08:00

25 lines
728 B
Python

from pyecharts.components import Table
from pyecharts.options import ComponentTitleOpts
def table_base() -> Table:
table = Table()
headers = ["City name", "Area", "Population", "Annual Rainfall"]
rows = [
["Brisbane", 5905, 1857594, 1146.4],
["Adelaide", 1295, 1158259, 600.5],
["Darwin", 112, 120900, 1714.7],
["Hobart", 1357, 205556, 619.5],
["Sydney", 2058, 4336374, 1214.8],
["Melbourne", 1566, 3806092, 646.9],
["Perth", 5386, 1554769, 869.4],
]
table.add(headers, rows).set_global_opts(
title_opts=ComponentTitleOpts(title="Table-基本示例", subtitle="我是副标题支持换行哦")
)
return table
table_base().render()