Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. function formatDate(myDate){
  2. var m_names = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
  3.  
  4. var d = new Date(myDate);
  5.  
  6. var curr_month = d.getMonth();
  7. //var curr_year = d.getFullYear();
  8. //return (m_names[curr_month] + "-" + curr_year);
  9. return (m_names[curr_month]);
  10. }
  11.  
  12. new Morris.Line({
  13. element: 'financial-year-sales-graph',
  14. data: [
  15. { month: '2013-07', sales: 52325 },
  16. { month: '2013-08', sales: 65432 },
  17. { month: '2013-09', sales: 52125 },
  18. { month: '2013-10', sales: 23265 },
  19. { month: '2013-11', sales: 25125 },
  20. { month: '2013-12', sales: 63256 },
  21. { month: '2014-01', sales: 52365 },
  22. { month: '2014-02', sales: 65954 },
  23. { month: '2014-03', sales: 55255 },
  24. { month: '2014-04', sales: 66236 },
  25. { month: '2014-05', sales: 52369 },
  26. { month: '2014-06', sales: 85214 }
  27. ],
  28. // The name of the data record attribute that contains x-values.
  29. xkey: 'month',
  30. // A list of names of data record attributes that contain y-values.
  31. ykeys: ['sales'],
  32. // Labels for the ykeys -- will be displayed when you hover over the
  33. // chart.
  34. labels: ['Sales'],
  35. xLabelFormat: function(str){
  36. return formatDate(str);
  37. },
  38. preUnits: '$'
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement