]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
[docs] HTML Legend sample: add flex-shrink: 0 to color box (#11330)
authorFrans de Jonge <fransdejonge@gmail.com>
Wed, 7 Jun 2023 16:44:21 +0000 (18:44 +0200)
committerGitHub <noreply@github.com>
Wed, 7 Jun 2023 16:44:21 +0000 (18:44 +0200)
This way the color box is prevented from shrinking in case of larger legends.

docs/samples/legend/html.md

index d7d64357560bd9ac58459569931ef0f37b1c0ef3..00c92c83fb2ad9fd2b8bdfdc13d4849cde11b48c 100644 (file)
@@ -61,6 +61,7 @@ const htmlLegendPlugin = {
       boxSpan.style.borderColor = item.strokeStyle;
       boxSpan.style.borderWidth = item.lineWidth + 'px';
       boxSpan.style.display = 'inline-block';
+      boxSpan.style.flexShrink = 0;
       boxSpan.style.height = '20px';
       boxSpan.style.marginRight = '10px';
       boxSpan.style.width = '20px';