Flot library setting up y axis to min 0 and max 24

最后都变了- 提交于 2019-12-21 07:03:42

问题


How can i set up my y axis to be in the range of 0 to 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.

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

for example d1 holds

[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.

thanks

Prady


回答1:


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


来源:https://stackoverflow.com/questions/4690413/flot-library-setting-up-y-axis-to-min-0-and-max-24

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!