简体   繁体   English

如何在Flot中更改y轴值的步进?

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

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). 我的设定y-axis: { max:n }n 1024(这意味着RAM 1024MB)。

How do I get Flot to change the y-axis labels so they display: 如何让Flot更改y轴标签,使其显示:

1024
 768
 512
 256
 128
   0

You can use the ticks option for this: 您可以使用ticks选项:

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. 你可以在这里测试它markings选项只是为了给它一点风格,如果你正在完成这样的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM