ChartJS API

Component ID

2918981

Component name

ChartJS API

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

107

Component created

Component changed

Component body

Integration API with the ChartJS library that provides a "render element" for generating graphs.

In addition to the standard graphs of GraphJS, a new type called "halfdonut" is added. With this, from a doughnut type graph, "half doughnut" type graphs can be generated.

Installation and configuration

ChartJS API Plugin can be installed like any other Drupal module. Place it in the modules directory for your site and enable it on the `admin/modules` page.

This module use lastest version of ChartJS.js library from CDN.

Parameters for "render element" array:

  • data: Array with labels and datasets with same structure than the ChartJS.js library.
  • graph_type: Chart type (line, bar, radar, pie... and halfdonut).
  • id: Unique id for chart.
  • options: Array with options of ChartJS.js library, with same structure.
  • plugins: Plugins to activate. This module include halfdonutTotal plugin. This plugin display the title inside half doughnut.
  • type: chartjs_api

You can find more info in ChartJs documentation:
http://www.chartjs.org/docs/latest/