绘图库将y轴设置为最小0和最大24 [英] Flot library setting up y axis to min 0 and max 24

查看:85
本文介绍了绘图库将y轴设置为最小0和最大24的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置我的y轴在0到24的范围内

How can i set up my y axis to be in the range of 0 to 24

这是我的代码。

  j$.plot(j$("#placeholder"),[d1],{
        xaxis: 
        { mode: "time", 
            min: (new Date("2010/11/01")).getTime(),
            max: (new Date("2011/02/01")).getTime()
            }
 },
  {yaxis: { min:0, max:24 } };
  };

xaxis似乎有效但是当我添加y轴时它不起作用。

xaxis seemed to work but when i added y axis it doesnt work.

除了这个
d1持有从salesforce发送的字符串

Apart from this d1 holds the string which is sent from salesforce

例如d1持有

[1294041600000,14.00],[1294041600000,14.50],[1294041600000,15.00],[1293955200000,12.00]

我无法查看图表,目前我的y轴只显示-1到1的范围,我假设这可能是我没有看到的原因行。

I am not able to view the graph, currently i am having the y axis showing only the range -1 to 1, i am assuming this could be the reason why i am not seeing the line.

谢谢

Prady

推荐答案

解决了y轴问题。这是代码

The y axis problem was solved. Here is the code

j$.plot(j$("#placeholder"), [d1], {
    xaxis: 
    {
      mode: "time", 
      min: (new Date("2010/11/01")).getTime(),
      max: (new Date("2011/02/01")).getTime()
    },

    yaxis:
    {
        min:0, max: 24,  tickSize: 5 
    }
});

这篇关于绘图库将y轴设置为最小0和最大24的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆