We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seem to find examples of gradients in the docs. What would be the easiest way to get gradients?
The text was updated successfully, but these errors were encountered:
I was able to add gradients like this:
import React from 'react'; import { Sparklines, SparklinesLine, SparklinesSpots } from 'react-sparklines'; const LinearGradientFill = stopColor => { return ( <linearGradient id="gradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" stopColor="rgb(26, 135, 255)" stopOpacity="1" /> <stop offset="100%" stopColor="rgb(26, 135, 255)" stopOpacity="0" /> </linearGradient> ); }; const CoinSparklineChart = props => ( <Sparklines data={props.closePrice} height={50}> <svg> <defs> <LinearGradientFill /> </defs> </svg> <SparklinesLine style={{ strokeWidth: 1, fill: 'url(#gradient)' }} color="rgb(26, 135, 255)" /> </Sparklines> ); export default CoinSparklineChart;
Sorry, something went wrong.
It duplicates #87
No branches or pull requests
Can't seem to find examples of gradients in the docs. What would be the easiest way to get gradients?
The text was updated successfully, but these errors were encountered: