Simple Graph

Animated line graph w/ custom interactions and advanced customization

simple-graph-tw

Customize

500px
2s
2px
3px
10px

Props

NameTypeDefaultDescription
dataDataPoint[][]Array of data points with value and optional label properties
lineColorstring"#5227FF"Color of the line (CSS color value)
dotColorstring"#5227FF"Color of the dots at each data point (CSS color value)
widthstring | number"100%"Width of the graph container
heightnumber300Height of the graph in pixels
animationDurationnumber2Duration of the line draw animation in seconds
showGridbooleantrueWhether to show background grid lines
gridStyle"solid" | "dashed" | "dotted""solid"Style of the grid lines
gridLines"vertical" | "horizontal" | "both""both"Which grid lines to display
gridLineThicknessnumber1Thickness of grid lines in pixels
showDotsbooleantrueWhether to show dots at each data point
dotSizenumber6Size of the dots in pixels
dotHoverGlowbooleanfalseShow glow effect behind dots when hovering
curvedbooleantrueWhether to curve the line between points using bezier curves
gradientFadebooleanfalseShow gradient fill under the line that fades from line color to transparent
graphLineThicknessnumber3Thickness of the main graph line in pixels
calculatePercentageDifferencebooleanfalseDisplay percentage difference between periods with trend arrows instead of absolute values
animateOnScrollbooleanfalseTrigger animation when the graph is scrolled into view
animateOncebooleantrueOnly animate once when scrolled into view (requires animateOnScroll to be true)
classNamestring""Additional CSS classes for the wrapper element