Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQPlot - Make y-axis only integers?

Tags:

jquery

jqplot

How can I make a graph in jqplot make all of its ticks at even integer intervals? For example, I have

yaxis: {numberTicks:16, min: 0}

I'd like to have it so that the chart stretches from 0-15, and if plot points go beyond 15, the chart changes to 0-30. Is this doable?

like image 882
theeggman85 Avatar asked Feb 21 '23 13:02

theeggman85


1 Answers

Use the tickInterval instead of numberTicks, like so:

axes:
{
    yaxis:
    {
        tickInterval: 15
    }
}

I think this is closest to what you want, but note that having a point close to y=15 will cause the chart to stretch to 30 as well.

like image 168
Kryptic Avatar answered Mar 09 '23 22:03

Kryptic