mmo-chart
The mmo-chart are meant to display charts following chart.js method.
Documentation
Builder
Usage
The mmo-chart is meant to display charts, and so statistics.
The config is defined by default.
The config is based on Chart.js
In this example we work with Bar Chart
If total of values is 0, the element will display a message (alt attribute).
Config explanation
- type : string => type of chart
- data : object => data of chart
- options : object => options of chart
data is an object with the following properties :
- datasets : array => datasets of chart
- labels : array => labels of chart (optional, is mandatory for multiple bars, multiple lines, pie, doughnut, polarArea)
datasets is an array of objects with the following properties :
- label : string => label of dataset
- data : array => data of dataset
- backgroundColor : string|array => background color of dataset
- borderColor : string|array => border color of dataset
- borderWidth : number => border width of dataset
- pointRadius : number => point radius of dataset
options is an object with the following properties :
- responsive : if true, the chart will be responsive
- maintainAspectRatio : if true, the chart will maintain its aspect ratio
- aspectRatio : aspect ratio of the chart
- scales : scales of the chart
- y : object => y axis of the chart
- ticks : object => ticks of the y axis
- precision : number => precision of the y axis
- plugins : plugins of the chart
plugins is an object with the following properties :
- title : title of the chart
- legend : legend of the chart
- position : position of the legend
- display : if true, the legend will be displayed