chart-generator
Generate a Chart into a png file
CLI
parameters
- outputPath : folder's path to save chart into
- outputFilename : name of the output chart's file
- inputFilePath : path of input data
Options
- '-c, --curves' : do you want curves or not in your lines chart
- '-l, --labels' : do you not want labels to be displayed on chart
Input data format
{
"title":string,
"labels"(optional): array of "string",
"type" : "line" or "bar" or "radar" or "doughnut" or "pie" or "polarArea" or "bubble",
"datasets" : array of dataset
}
Chart Types
- line => ok
- bar => to be tested
- radar => to be tested
- polar area => to be tested
- doughnut and pie => ok
- bubble => to be tested
More documentation here
Dataset
{
"data": array of number or object,
"label": string,
"borderColor": color string or array of color string,
"backgroundColor": color string or array of color string,
"fill" : boolean
}
Examples
Line Chart
{
"title":"",
"type" : "line",
"datasets" : [
{
"data": [3,4, 5, 6,7,8,20,33, 30,27,45],
"label": "toto",
"borderColor": "white",
"backgroundColor": "black",
"fill" : true
}
]
}
Doughnut Chart
{
"title":"",
"type" : "doughnut",
"labels": ["toto","tata","titi","tutu"],
"datasets" : [
{
"data": [3,4, 5, 6],
"label": "toto",
"backgroundColor": ["white","green","yellow", "red" ],
"borderColor": "black"
}
]
}