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

1

6

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?

Pieria answered 22/4, 2015 at 8:5 Comment(0)
P
2

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

Pieria answered 22/4, 2015 at 8:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.