绘图库将y轴设置为最小0和最大24

时间:2022-10-24 20:11:49

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

如何将y轴设置为0到24的范围

Here is the code i have.

这是我的代码。

  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 seemed to work but when i added y axis it doesnt work.

xaxis似乎工作,但当我添加y轴它不起作用。

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

除此之外,d1还包含从salesforce发送的字符串

for example d1 holds

例如d1成立

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

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.

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

thanks

Prady

1 个解决方案

#1


28  

The y axis problem was solved. Here is the code

y轴问题得以解决。这是代码

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 
    }
});

#1


28  

The y axis problem was solved. Here is the code

y轴问题得以解决。这是代码

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 
    }
});