1
A
回答
0
对Style
类有一个to_dict
方法,对创建自定义样式非常有帮助。
>>> CleanStyle.to_dict()
{'opacity': '.8', 'foreground': 'rgba(0, 0, 0, 0.9)', 'plot_background': 'rgba(240, 240, 240, 0.7)', 'stroke_style': 'round', 'foreground_light': 'rgba(0, 0, 0, 0.9)', 'transition': '250ms', 'foreground_dark': 'rgba(0, 0, 0, 0.5)', 'stroke_dasharray': '0,0', 'opacity_hover': '.9', 'stroke_width': 1.0, 'colors': ('rgb(12,55,149)', 'rgb(117,38,65)', 'rgb(228,127,0)', 'rgb(159,170,0)', 'rgb(149,12,12)'), 'background': 'transparent', 'font_family': 'monospace'}
下面介绍了如何创建粗笔触宽度的自定义样式。
>>> from pygal.style import Style, CleanStyle
>>> style_arg = CleanStyle.to_dict()
>>> style_arg['stroke_width']=10
>>> HeavyCleanStyle = Style(**style_arg)
>>> HeavyCleanStyle.to_dict()
{'opacity': '.8', 'foreground': 'rgba(0, 0, 0, 0.9)', 'plot_background': 'rgba(240, 240, 240, 0.7)', 'stroke_style': 'round', 'foreground_light': 'rgba(0, 0, 0, 0.9)', 'transition': '250ms', 'foreground_dark': 'rgba(0, 0, 0, 0.5)', 'stroke_dasharray': '0,0', 'opacity_hover': '.9', 'stroke_width': 10.0, 'colors': ('rgb(12,55,149)', 'rgb(117,38,65)', 'rgb(228,127,0)', 'rgb(159,170,0)', 'rgb(149,12,12)'), 'background': 'transparent', 'font_family': 'monospace'}
相关问题
- 1. 如何更改笔画宽度android?
- 2. 如何改变pygal的笔画颜色?
- 3. 如何更改DrawFocusRect笔的宽度?
- 4. HTML5画布笔划宽度不会增量更改
- 5. CAShapeLayer更改不同笔刷的宽度
- 6. 根据写入速度更改笔宽
- 7. 如何在不更改inkscape中的笔触宽度的情况下更改一条线的宽度?
- 8. SVG中的固定笔画宽度
- 9. 如何在iPad中更改UITableViewCell宽度
- 10. 如何更改沿路径/线条的笔触宽度?
- 11. Pygal在Jupyter笔记本中呈现SVG
- 12. 如何更改UITableviewCell宽度
- 13. 如何更改FBLoginView宽度
- 14. 如何更改UISearchBar宽度
- 15. 如何在flash html5画布中更改动画片段的宽度?
- 16. 没有linejoin和笔画宽度
- 17. 笔画宽度= 1px的线的外观
- 18. Android,查看宽度更改动画?
- 19. 对ImageView宽度的动画更改
- 20. Android平滑宽度更改动画
- 21. 更改表格宽度动画
- 22. 用点击功能改变svg图像的笔画宽度jquery
- 23. 如何更改iPad中UIActionSheet的宽度?
- 24. 如何更改ImageView高度和宽度
- 25. 如何在表单宽度增加时更改ListView的宽度?
- 26. dc.js - 如何设置画笔(具体宽度),以BARCHART负载
- 27. 如何动画视图的笔划宽度
- 28. 如何绘制一个可变的笔画宽度的路径
- 29. 如何使用动画更改NSTableColumn宽度
- 30. 如何用动画从左到右更改CALayer的宽度?
也许你需要此设置:http://www.pygal.org/en/latest/api/pygal.config.html?highlight=stroke_style#pygal.config.Config.width – 2015-11-18 17:31:29