Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Morris graph year x axis

Tags:

jquery

http://jsfiddle.net/wb6jz/

I have problem with x axis, I want to display dates, not year, where do I define this?

    Morris.Area({
  element: 'area-example',
  data: [
    { y: '1.1.', a: 100, b: 90 },
    { y: '2.1.', a: 75,  b: 65 },
    { y: '3.1.', a: 50,  b: 40 },
    { y: '4.1.', a: 75,  b: 65 },
    { y: '5.1.', a: 50,  b: 40 },
    { y: '6.1.', a: 75,  b: 65 },
    { y: '7.1.', a: 100, b: 90 }
  ],
  xkey: 'y',
  ykeys: ['a', 'b'],
  labels: ['Series A', 'Series B']
});
like image 957
ante1820 Avatar asked Sep 04 '13 17:09

ante1820


1 Answers

I don't think your y is formated correctly, but if you want to see dates instead of years add xLabels: "day"

See http://jsfiddle.net/wb6jz/1/

Documentation: http://www.oesmith.co.uk/morris.js/lines.html

like image 94
Mark U Avatar answered Oct 22 '22 18:10

Mark U