pygal: How do I specify a different stroke width for different lines?

72 views Asked by At

I would like to have different line thickness for the different lines. I tried specifying width using the stroke_style but it does not seem to help.

import pygal

chart = pygal.XY()
chart.add(**{'title': 'Line A', 'values': [(1, 1), (10, 10)]})
chart.add(**{'title': 'Line B', 'values': [(1, 2), (10, 20)], 'stroke_style': {'dasharray': '3, 6'}})
chart.add(**{'title': 'Line C', 'values': [(1, 3), (10, 30)], 'stroke_style': {'width': 5}})

chart.render_to_png('chart.png')

I have attached a screenshot of the resulting png. I was expecting the "Line C" to be thicker, but it is not. The dasharray ("Line B") works fine.

So, how do I specify different line thickness for different lines? Thank you!

enter image description here

0

There are 0 answers