pygal icon indicating copy to clipboard operation
pygal copied to clipboard

Line chart: stroke_style doesn't work for serie

Open bedeberger opened this issue 3 years ago • 1 comments

Since 3.0.0 (installed via pip) the parameter stroke_style within a line chart doesn't work anymore. Do you experienced the same issue? What is your proposal? Downgrad to an older version? Example:

chart.add("Serie", df.to_list(), dots_size=4, stroke_style={'width': 3})

bedeberger avatar Nov 29 '21 15:11 bedeberger

This is a bug caused by this commit: https://github.com/Kozea/pygal/commit/51a96d34bf81c54256539e9528f41b7a8ab95dc2

It's exactly as @cbeytas described it in the comment there -- stroke_width set from a Style is applied with more specificity and thus overrides the options set by stroke_style.

You can hot-patch this locally by removing those lines from style.css, or you can write a Style that sets the width that you want. More generally, that commit should probably be reverted and a better thought-out solution implemented.

micha030201 avatar Feb 19 '22 16:02 micha030201