本文整理匯總了Python中pyecharts.Line.chart_id方法的典型用法代碼示例。如果您正苦於以下問題:Python Line.chart_id方法的具體用法?Python Line.chart_id怎麽用?Python Line.chart_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyecharts.Line
的用法示例。
在下文中一共展示了Line.chart_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_page
# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import chart_id [as 別名]
def test_page():
page = Page()
line = Line("折線圖示例")
line.chart_id = "id_my_cell_line"
line.add(
"最高氣溫",
WEEK,
[11, 11, 15, 13, 12, 13, 10],
mark_point=["max", "min"],
mark_line=["average"],
)
line.add(
"最低氣溫",
WEEK,
[1, -2, 2, 5, 3, 2, 0],
mark_point=["max", "min"],
mark_line=["average"],
)
# pie
v1 = [11, 12, 13, 10, 10, 10]
pie = Pie("餅圖-圓環圖示例", title_pos="center", width="600px")
pie.add(
"",
CLOTHES,
v1,
radius=[40, 75],
label_text_color=None,
is_label_show=True,
legend_orient="vertical",
legend_pos="left",
)
page.add([line, pie, create_a_bar(TITLE)])
# Start render and test
html = page._repr_html_()
# Test base html structure
assert html.count("<script>") == html.count("</script>") == 2
assert html.count("<div") == html.count("</div>") == 3
assert html.count("require.config") == html.count("function(echarts)") == 1
# Test some chart attributes
json_encoded_title = json.dumps(TITLE)
assert json_encoded_title in html
assert "nbextensions/echarts" in html # default jshost
assert html.count("height:400px") == 3
assert html.count("width:600px") == 1
assert html.count("width:800px") == 2
assert html.count("id_my_cell_line") == 6