简体   繁体   English

如何在Flot中获取x轴起始值?

[英]How to get x-axis start value in Flot?

I would like to know how to get x-axis start value in JS library Flot. 我想知道如何在JS库Flot中获取x轴起始值。 I know x-axis value in the start (obviously, because I fill it with my own data), but if you set: 我知道开始时的x轴值(显然,因为我用自己的数据填充它),但如果你设置:

pan: {
     interactive: true
}

Than the user is able to pan through graph ( example here ) and if the user pans through graph, the x-values change. 比用户能够平移图表( 这里的示例 ),如果用户平移图表,则x值会发生变化。 I looked inside jquery.flot.js to find where this values are computed but with no luck. 我查看了jquery.flot.js,找到了这个值的计算位置,但没有运气。

I got it. 我知道了。 The solution was in front of me the whole time (example): 解决方案一直在我面前(例子):

 var axes = plot.getAxes();
 var min = axes.xaxis.min;

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

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