svg-line-chart icon indicating copy to clipboard operation
svg-line-chart copied to clipboard

id of linearGradient shouldn't be supplied by the user

Open il3ven opened this issue 3 years ago • 0 comments

Right now, line 44 is necessary for the gradient to be shown.

https://github.com/rugpullindex/svg-line-chart/blob/b2b3bc2b15224af6b141d6dc318186064d477625/scripts/serve.mjs#L42-L47

This is because the <polygon> element creates the gradient and it needs an id of a <linearGradient>. The id of the <linearGradient> is hard-coded as polygrad.

https://github.com/rugpullindex/svg-line-chart/blob/b2b3bc2b15224af6b141d6dc318186064d477625/src/index.mjs#L105-L114

Deliverables

Hard-code fill:url(#polygrad) in the polygon function so the user does not need to pass it.

Time Estimate

1-2 hr

il3ven avatar Nov 21 '21 20:11 il3ven