本文整理汇总了Python中pygal.Line.stroke方法的典型用法代码示例。如果您正苦于以下问题:Python Line.stroke方法的具体用法?Python Line.stroke怎么用?Python Line.stroke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygal.Line
的用法示例。
在下文中一共展示了Line.stroke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_config_alterations_kwargs
# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import stroke [as 别名]
def test_config_alterations_kwargs():
"""Assert a config can be changed with keyword args"""
class LineConfig(Config):
no_prefix = True
show_legend = False
fill = True
pretty_print = True
x_labels = ['a', 'b', 'c']
config = LineConfig()
line1 = Line(config)
line1.add('_', [1, 2, 3])
l1 = line1.render()
line1.stroke = False
l1bis = line1.render()
assert l1 != l1bis
line2 = Line(config)
line2.add('_', [1, 2, 3])
l2 = line2.render()
assert l1 == l2
assert l1bis != l2
line3 = Line(config, title='Title')
line3.add('_', [1, 2, 3])
l3 = line3.render()
assert l3 != l2
l2bis = line2.render()
assert l2 == l2bis
示例2: test_config_alterations_kwargs
# 需要导入模块: from pygal import Line [as 别名]
# 或者: from pygal.Line import stroke [as 别名]
def test_config_alterations_kwargs():
class LineConfig(Config):
show_legend = False
fill = True
pretty_print = True
x_labels = ["a", "b", "c"]
config = LineConfig()
line1 = Line(config)
line1.add("_", [1, 2, 3])
l1 = line1.render()
line1.stroke = False
l1bis = line1.render()
assert l1 != l1bis
line2 = Line(config)
line2.add("_", [1, 2, 3])
l2 = line2.render()
assert l1 == l2
assert l1bis != l2
line3 = Line(config, title="Title")
line3.add("_", [1, 2, 3])
l3 = line3.render()
assert l3 != l2
l2bis = line2.render()
assert l2 == l2bis