Kev
Kev

Reputation: 119856

How do I change the stepping of y-axis values in Flot?

I have a graph of memory use over time which looks like: alt text

I set the y-axis: { max:n } value n to 1024 (which means 1024MB of RAM).

How do I get Flot to change the y-axis labels so they display:

1024
 768
 512
 256
 128
   0     

Upvotes: 3

Views: 1143

Answers (1)

Nick Craver
Nick Craver

Reputation: 630627

You can use the ticks option for this:

yaxis: { max: 1024, ticks: [128, 256, 512, 768, 1024] }

You can test it out here, the markings option is just to give it a bit of style, if you're after an effect like that at all.

Upvotes: 3

Related Questions