Simple Graph

Animated line graph w/ custom interactions and advanced customization

simple-graph-tw

Customize

#B19EEF
#B19EEF
500px
2s
2px
3px
10px

Props

dataDataPoint[]

Array of data points with value and optional label properties

Default:[]
lineColorstring

Color of the line (CSS color value)

Default:"#5227FF"
dotColorstring

Color of the dots at each data point (CSS color value)

Default:"#5227FF"
widthstring | number

Width of the graph container

Default:"100%"
heightnumber

Height of the graph in pixels

Default:300
animationDurationnumber

Duration of the line draw animation in seconds

Default:2
showGridboolean

Whether to show background grid lines

Default:true
gridStyle"solid" | "dashed" | "dotted"

Style of the grid lines

Default:"solid"
gridLines"vertical" | "horizontal" | "both"

Which grid lines to display

Default:"both"
gridLineThicknessnumber

Thickness of grid lines in pixels

Default:1
showDotsboolean

Whether to show dots at each data point

Default:true
dotSizenumber

Size of the dots in pixels

Default:6
dotHoverGlowboolean

Show glow effect behind dots when hovering

Default:false
curvedboolean

Whether to curve the line between points using bezier curves

Default:true
gradientFadeboolean

Show gradient fill under the line that fades from line color to transparent

Default:false
graphLineThicknessnumber

Thickness of the main graph line in pixels

Default:3
calculatePercentageDifferenceboolean

Display percentage difference between periods with trend arrows instead of absolute values

Default:false
animateOnScrollboolean

Trigger animation when the graph is scrolled into view

Default:false
animateOnceboolean

Only animate once when scrolled into view (requires animateOnScroll to be true)

Default:true
classNamestring

Additional CSS classes for the wrapper element

Default:""