Strikethrough on legend being too thick on small label size
- Dominant language
- JavaScript
- Stars
- 67.7k
- Forks
- 11.9k
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 5
Description
### Feature Proposal
Based on legend strikethough implementation([code1](https://github.com/chartjs/Chart.js/blob/7736ea32da0a93f89d20d59861dd8821a2802447/src/plugins/plugin.legend.js#L368
), [code2](https://github.com/chartjs/Chart.js/blob/7736ea32da0a93f89d20d59861dd8821a2802447/src/helpers/helpers.canvas.ts#L403-L432)), legend strikethrough will always have `lineWidth` as `2` regardless of actual font size. This issue becomes clearly noticeable on small device as shown below.

### Possible Implementation
Would suggest to calculate `lineWidth` based on font size for legend. A rough idea would be updating [code](https://github.com/chartjs/Chart.js/blob/7736ea32da0a93f89d20d59861dd8821a2802447/src/plugins/plugin.legend.js#L368
) from
```
renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {
strikethrough: legendItem.hidden,
textAlign: rtlHelper.textAlign(legendItem.textAlign)
});
```
to
```
renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {
strikethrough: legendItem.hidden,
textAlign: rtlHelper.textAlign(legendItem.textAlign),
decorationWidth: labelFont.size / 8
});
```
I tested locally this change and this is before and after:

If hard coding ratio here is not acceptable, another option would be providing some option like [the one](https://www.chartjs.org/docs/latest/api/interfaces/RenderTextOpts.html#decorationwidth) for label to customize strikethrough width.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.