How to set step in morris.js?

I have simple graphics on Morris.js:

enter image description here

How can I set the step in position Y? The step should be 50 points, eq:

...

150

100

fifty

    $(document).ready(function() {
            new Morris.Line({
                element: 'myfirstchart',
                data: [
                {year: '2011-10-01' },
                {year: '2012', mark: 313.75},{year: '2013', mark: 323.75},
                {year: '2016-06-01' }
                ],
                xkey: ['year'],
                ykeys: ['mark'],
                xLabels: 'year',
                hideHover: true,
                labels: ['Mark'],
                ymax : 350, ymin : 0,
                events: ['2012','2013','2014','2015','2016'],
                eventLineColors: ['#aaaaaa']
            });
    });
+3
source share
1 answer

The only way I can do this is to set the number of rows for the grid (numLines) based on ymin and ymax.

<script type="text/javascript">
$(document).ready(function() {
        new Morris.Line({
            element: 'myfirstchart',
            data: [
            {year: '2011-10-01' },
            {year: '2012', mark: 313.75},{year: '2013', mark: 323.75},
            {year: '2016-06-01' }
            ],
            xkey: ['year'],
            ykeys: ['mark'],
            xLabels: 'year',
            hideHover: true,
            labels: ['Mark'],
            ymax : 350, ymin : 0,
            numLines: 8,
            events: ['2012','2013','2014','2015','2016'],
            eventLineColors: ['#aaaaaa']
        });
});
</script>
0
source

All Articles