本文整理汇总了Python中pyecharts.Bar._repr_html_方法的典型用法代码示例。如果您正苦于以下问题:Python Bar._repr_html_方法的具体用法?Python Bar._repr_html_怎么用?Python Bar._repr_html_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyecharts.Bar
的用法示例。
在下文中一共展示了Bar._repr_html_方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bar_rotate_label
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_rotate_label():
days = ["{}天".format(i) for i in range(20)]
days_v1 = [random.randint(1, 20) for _ in range(20)]
bar = Bar("坐标轴标签旋转示例")
bar.add("", days, days_v1, xaxis_interval=0, xaxis_rotate=30,
yaxis_rotate=30)
assert "stack_" not in bar._repr_html_()
示例2: test_bar_stack
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_stack():
bar = Bar("柱状图数据堆叠示例")
bar.add("商家A", CLOTHES, clothes_v1, is_stack=True)
bar.add("商家B", CLOTHES, clothes_v2, is_stack=True)
html_content = bar._repr_html_()
assert "dataZoom" not in html_content
assert "stack_" in html_content
示例3: test_bar_datazoom_undefined
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_datazoom_undefined():
days = ["{}天".format(i) for i in range(30)]
days_v1 = [random.randint(1, 30) for _ in range(30)]
bar = Bar("Bar - datazoom 默认 示例")
bar.add("", days, days_v1, is_label_show=True, is_datazoom_show=True)
html_content = bar._repr_html_()
assert "dataZoom" in html_content
assert ': "slider"' in html_content
assert ': "inside"' not in html_content
示例4: test_bar_datazoom_inside
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_datazoom_inside():
days = ["{}天".format(i) for i in range(30)]
days_v1 = [random.randint(1, 30) for _ in range(30)]
bar = Bar("Bar - datazoom - inside 示例")
bar.add("", days, days_v1, is_datazoom_show=True,
datazoom_type='inside', datazoom_range=[10, 25])
html_content = bar._repr_html_()
assert "dataZoom" in html_content
assert ': "inside"' in html_content
assert ': "slider"' not in html_content
示例5: test_bar_datazoom_both
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_datazoom_both():
days = ["{}天".format(i) for i in range(30)]
days_v1 = [random.randint(1, 30) for _ in range(30)]
bar = Bar("Bar - datazoom - both 示例")
bar.add(
"",
days,
days_v1,
is_datazoom_show=True,
datazoom_type="both",
datazoom_range=[10, 25],
is_toolbox_show=False,
)
html_content = bar._repr_html_()
assert "dataZoom" in html_content
assert ': "inside"' in html_content
assert ': "slider"' in html_content
示例6: test_bar_convert_xy_axis
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_convert_xy_axis():
bar = Bar("x 轴和 y 轴交换")
bar.add("商家A", CLOTHES, clothes_v1)
bar.add("商家B", CLOTHES, clothes_v2, is_convert=True)
assert "average" not in bar._repr_html_()
示例7: test_bar_marks
# 需要导入模块: from pyecharts import Bar [as 别名]
# 或者: from pyecharts.Bar import _repr_html_ [as 别名]
def test_bar_marks():
bar = Bar("标记线和标记点示例")
bar.add("商家A", CLOTHES, clothes_v1, mark_point=["average"])
bar.add("商家B", CLOTHES, clothes_v2, mark_line=["min", "max"])
assert '"average"' in bar._repr_html_()