I am creating a trend report in jasper studio using highcharts reports and I have ran into an issue on how to display default date range when there is no data.
Basically I need to show 6 data points on my x-axis(6 months) as default. This is fine except the data set I am using is dynamic(taken from a mysql query) so sometimes there will be data points for all 6 months but for others there may only be a data point for one month.
How can I get the report to show all 6 months on the x axis even when there are no associated data points?
So after the sql returns my results it would look something like this:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
categories: ['Jan']
},
yAxis: {
max: 200
},
series: [{
data: [29.9]
}]
});
So this will just display Jan on the x-axis but I need to display following 5 months also(no data points on the report, they are just labels).