开发者

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

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

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

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     


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜