I am currently creating a fruit consumption chart for each day, and so far everything is working correctly in the provided example.
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"hideCredits": true,
"fixedColumnWidth": '10px',
"legend": {
"horizontalGap": 10,
"maxColumns": 1,
"position": "right",
"useGraphSettings": true,
"markerSize": 10
},
"dataProvider": [{
"creationDate": "04/09/18",
"Banana": 1,
"Apple": 13,
"Grapes": 24
},
{
"creationDate": "06/09/18",
"Banana": 10,
"Apple": 13,
"Grapes": 24
},
{
"creationDate": "08/09/18",
"Banana": 11,
"Apple": 13,
"Grapes": 24
},
{
"creationDate": "09/09/18",
"Banana": 1,
"Apple": 50,
"Grapes": 24
},
],
//"gridAboveGraphs": true,
"startDuration": 1,
"valueAxes": [{
"stackType": "regular",
"axisAlpha": 0.3,
"gridAlpha": 0,
"minimum": 0,
"maximum": 50,
"gridCount": 1
}],
"graphs": [{
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>",
"fillColors": "#47b012",
"lineColor": "#47b012",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "Grapes Eaten",
"type": "column",
"color": "#000000",
"valueField": "Grapes",
"fixedColumnWidth": 25
}, {
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>",
"fillColors": "#fff138",
"lineColor": "#fff138",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "Banana Eaten",
"type": "column",
"color": "#000000",
"valueField": "Banana",
"fixedColumnWidth": 25
}, {
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>",
"fillColors": "#dd111b",
"lineColor": "#dd111b",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "Apples eaten",
"type": "column",
"color": "#000000",
"valueField": "Apple",
"fixedColumnWidth": 25
}],
"categoryField": "creationDate",
"categoryAxis": {
"gridPosition": "start",
"axisAlpha": 0,
"gridAlpha": 0,
"position": "left",
"labelRotation": 80,
},
});
#chartdiv {
width: 100%;
height: 500px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
<div id="chartdiv"></div>
However, I aim to display data even on days when no fruits are consumed as shown in the image below. https://i.sstatic.net/lIajF.png
The information for dates 05-09-2018 and 07-09-2018 is missing from the dataprovider
field, and my goal is to have them automatically included in the graph.