josejaner / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 1 forks source link

Replace number on the X axis by monthes #668

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
instead of having numbers on the x axis , i need to have months , 
i will use it as a monthly report chart , can u tell me how , plz

Original issue reported on code.google.com by rolandfe...@gmail.com on 15 Feb 2012 at 11:23

GoogleCodeExporter commented 8 years ago
i tried this :  ticks: [[0, "zero"], [1, "Jan"], [2, 
"Feb"],[3,"Mar"],[4,"Apr"],[5,"May"],[6,"Jun"],[7,"Jul"],[8,"Aug"],[9,"Sep"],[10
,"Oct"],[11,"Nov"],[12,"Dec"],[,]] ,

and :

var d2 = 
[[0,0],[1,2.5],[2,6],[3,-2],[4,2],[5,9],[6,-1],[7,-3],[8,2],[9,4],[10,3],[11,5],
[12,2],[13,]]

  $.plot($("#placeholder"), [d2]);

and it worked for me , thankssss

Original comment by rolandfe...@gmail.com on 16 Feb 2012 at 7:53

GoogleCodeExporter commented 8 years ago
Another way to do this is to use the x-axis 'time' mode, and then set 
minTickSize to [1, "month"].  See the API docs for more information; they 
explain this pretty thoroughly.

Original comment by dnsch...@gmail.com on 1 May 2012 at 11:25