Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 707
Prady Avatar asked Jan 14 '11 11:01

Prady


1 Answers

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 
    }
});
like image 58
Prady Avatar answered Sep 28 '22 04:09

Prady