Chart.js for Grav

CPPL

The Shortcode Chart.js plugin we've created allows you to create simple animated charts using Chart.js in your Grav website. (Reload the page if you missed the animations.)

It installs in all the usual ways, and should be shortly available from the GPM so that you can intall it via the Admin plugin or the cli using gpm. In the meantime you can download it from our GitHub account, in the repo for the plugin.

This post is just about showing some typical examples of what the current release (v1.0.1 at this writing) can do. Which is simple charts with a single dataset (we'll be adding support multiple datasets).

A note about the example code shown, shortcodes start with a [ and then name of the short code e.g. chartjs as there is no way I'm aware of to include the open [ and the name without triggering the plugin the [ and closing ] have been omitted from the code blocks below. In addition the returns have been added to break the code over multiple lines for readability reasons - there should not be any returns/paragraph breaks in your shortcode.

we've also move the title to the bottom of the pie chart titleposition="bottom"

Wrap-up

You can read a bit more in the plugin's README on GitHub.
While we only have a few options in the current 1.0 release we expect to add support for new options as the need arises. In the mean time you can look at the Chart.js Samples or the Chart.js Docs to get a idea of what is possible.