Is stroke-dasharray supported?

Hi. I am trying to learn how to make SVG pie charts, am disappointed that there aren’t more solutions out there.

How well supported is stroke-dasharray?

It seems that the more realistic SVG pie charts use this function, but according to MDN, there is no guaranteed browser support for it.

caniuse - stroke-dasharray

3 Likes

Why does MDN imply that it is not supported here…

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray

MDN also implies that Stroke isn’t supported anywhere…

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke

I think perhaps you’re confusing “Unknown” with “Unsupported”.

The people at MDN have apparently not gone back to these pages to determine their status or when the browsers adopted the ability. caniuse apparently has.

@m_hutley,

How authoritative is CanIUse?

I thought MDN was the gold standard and what I’d want to go off of.

And to my OP, so I guess using stroke and stroke-dasharray is totally fine then, right?

I ask because that function seems to be the only way to create pie charts using SVG and which have multiple slices.

Compatibility tables and the browser compatibility data repository (BCD) - The MDN project | MDN (mozilla.org)

caniuse/CONTRIBUTING.md at main · Fyrd/caniuse · GitHub

They’re both equally authoritative; they source updates through an open Github fork-and-merge process, with a review process as part of the merge.

caniuse is a specialized site for compatibility, MDN is more concerned about the specification and Mozilla’s explanation/implementation of it.

It should be pointed out that Mozilla is not the creator of the spec themselves, they are a member of the W3C group, and so contribute to it, but they do not themselves define it.

2 Likes

Ok, GitHubis o ver my head, but I’ll take it that if CanIUse says stroke-dasharray is supported by browsers then I can spend time learning more about it in an effort to learn how to make pie charts using SVG.

It’s a long-winded way of saying they both crowd-source their information, and then approve/verify it as it goes up on the site.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.