Chartist provides a simple API to animate the elements on the Chart using SMIL. Usually you can achieve most animation with CSS3 animations but in some cases you'd like to animate SVG properties that are not available in CSS.
An example of a simple line chart with three series. You can edit this example in realtime.
This advanced example uses a line chart to draw a scatter diagram. The data object is created with a functional style random mechanism.
An example of a simple line chart with two series. You can edit this example in realtime.
This chart uses the showArea option to draw line, dots but also an area shape. Use the low option to specify a fixed lower bound that will make the area expand.
You can also only draw the area shapes of the line chart. Area shapes will always be constructed around their areaBase (that can be configured in the options) which also allows you to draw nice bi-polar areas.
Path animation is made easy with the SVG Path API. The API allows you to modify complex SVG paths and transform them for different animation morphing states.
By default Chartist uses a cardinal spline algorithm to smooth the lines. However, like all other things in Chartist, this can be customized easily!
By naming your series using the series object notation with a name property, you can enable the individual configuration of series specific settings.
This advanced example uses a line chart to draw a scatter diagram. The data object is created with a functional style random mechanism.
A bi-polar bar chart with a range limit set with low and high. There is also an interpolation function used to skip every odd grid line / label.
This example makes use of label interpolation and the seriesBarDistance property that allows you to make bars overlap over each other.
Chartist will figure out if your browser supports foreignObject and it will use them to create labels that are based on regular HTML text elements.
You can also set your bar chart to stack the series bars on top of each other easily by using the stackBars property in your configuration.
Guess what! Creating horizontal bar charts is as simple as it can get. There's no new chart type you need to learn, just passing an additional option is enough.
As all settings of a chart can be customized with the responsive configuration override mechanism of Chartist, you can create a chart that adopts to every media condition!
Sometime it's desired to have bar charts that show one bar per series distributed along the x-axis. If this option is enabled, you need to make sure that you pass a single series array to Chartist that contains the series values.
You can change the position of the labels on line and bar charts easily by using the position option inside of the axis configuration.
Although it'd be also possible to achieve this animation with CSS, with some minor suboptimal things, here's an example of how to animate donut charts using Chartist.Svg.animate and SMIL.
A very simple pie chart with label interpolation to show percentage instead of the actual data series value.
This pie chart is configured with custom labels specified in the data object. On desktop we use the labelOffset property to offset the labels from the center.
This pie chart uses donut, startAngle and total to draw a gauge chart.