开发者

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

开发者 https://www.devze.com 2023-01-20 17:01 出处:网络
I have a graph of memory use over time which looks like: I set the y-axis: { max:n } value n to 1024 (which means开发者_开发知识库 1024MB of RAM).

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

精彩评论

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

关注公众号