I am trying to add colored box as legends to the morris graph. The below picture shows the C3 graph legend. But I am unable to find a way to add in the Morris the same way.
Can anyone help ?
Currently , The Morris legends appears as below with the code:
The code for Morris - jQuery
var chart= Morris.Line({
element: 'status-req',
data: <?=json_encode($jsonDataArray)?>,
xkey: 'y',
ykeys: <?=json_encode($deliveryAspect['statusKeys'])?>,
labels: <?=json_encode($deliveryAspect['statusLabels'])?>,
hideHover: 'auto',
resize: true,
smooth:true
});
chart.options.labels.forEach(function(label, i) {
var legendItem = $('<span align="center"></span> ').text(label).css('color', chart.options.lineColors[i])
$('#legend').append(legendItem);
});

