Jav Hens
Jav Hens

Reputation: 73

How to adjust the Morris line chart y axis dynamically

I need to adjuts the y axis in my Morris line chart. The code that I have so far is:

Morris.Line({
    element : 'chart_01',
    data: [<?php echo $chart_data; ?>],
    xkey: 'fecha',
    ykeys: ['Precio'],
    labels: 'Precio',
    lineWidth: '6px',
    xLabelAngle: 45
});

And this is how it looks like: This is how it looks like now

And this is how I would like the chart to be, once the y axis is adjusted. Ideally I would not like to start at 0 but closer to the range found. Anyone can help with this? thx.

And this is how I would like the yscale to be

Upvotes: 1

Views: 1020

Answers (1)

Jav Hens
Jav Hens

Reputation: 73

I just noticed how to do it:

> ymin: 'auto'

Upvotes: 1

Related Questions