Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Morris Charts shows day as a year instead of the actual number

I use morris chart to visualize my date, however in the xkey, which is the Year, shows the number as a year instead of the day.

This is my code that shows the value of the day 5 days from now

Morris.Line({
    element: 'reports-per-day',
    data: [{
        y: (todayDay - 4).toString(),
        a: <?php echo $day[4]; ?>
    }],
    xkey: 'y',
    ykeys: ['a'],
    labels: ['Reports/Year'],
    hideHover: 'auto',
    resize: false
});

However, the day is shown as a year with 19 added at the start of the number, how can I get rid of this?

like image 634
ineedhelp Avatar asked Nov 09 '22 15:11

ineedhelp


1 Answers

Fixed it, just added parseTime: false to prevent parsing the value to date

like image 199
ineedhelp Avatar answered Nov 14 '22 21:11

ineedhelp