Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function formatDate(myDate){
- var m_names = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
- var d = new Date(myDate);
- var curr_month = d.getMonth();
- //var curr_year = d.getFullYear();
- //return (m_names[curr_month] + "-" + curr_year);
- return (m_names[curr_month]);
- }
- new Morris.Line({
- element: 'financial-year-sales-graph',
- data: [
- { month: '2013-07', sales: 52325 },
- { month: '2013-08', sales: 65432 },
- { month: '2013-09', sales: 52125 },
- { month: '2013-10', sales: 23265 },
- { month: '2013-11', sales: 25125 },
- { month: '2013-12', sales: 63256 },
- { month: '2014-01', sales: 52365 },
- { month: '2014-02', sales: 65954 },
- { month: '2014-03', sales: 55255 },
- { month: '2014-04', sales: 66236 },
- { month: '2014-05', sales: 52369 },
- { month: '2014-06', sales: 85214 }
- ],
- // The name of the data record attribute that contains x-values.
- xkey: 'month',
- // A list of names of data record attributes that contain y-values.
- ykeys: ['sales'],
- // Labels for the ykeys -- will be displayed when you hover over the
- // chart.
- labels: ['Sales'],
- xLabelFormat: function(str){
- return formatDate(str);
- },
- preUnits: '$'
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement