morrisjs / morris.js

Pretty time-series line graphs
http://morrisjs.github.com/morris.js/
6.92k stars 1.23k forks source link

Line graph x axis values of dots is 0 #771

Closed kaanklky closed 6 years ago

kaanklky commented 6 years ago

I created line graph via Raphael & Morris but x axis values of dots in graph is 0.

Raphael version: 2.1.0 Morris version: 0.5.1

JS Code:

Morris.Line({
  element: "line-report",
  data: [
    {"y":"Dec 2017","a":"6","b":"6"},
    {"y":"Jan 2018","a":"16","b":"22"},
    {"y":"Feb 2018","a":"24","b":"46"},
    {"y":"Mar 2018","a":"7","b":"53"},
    {"y":"Apr 2018","a":"3","b":"56"},
    {"y":"May 2018","a":"37","b":"93"},
    {"y":"Jun 2018","a":"206","b":"299"}
  ],
  xkey: 'y',
  ykeys: ['a', 'b'],
  labels: ['Başvuru Sayısı', 'Toplam Başvuru Sayısı'],
  hideHover: "false"
});

Graph: screenshot_2018-09-01_12-48-15

Dots in Raphael's svg: screenshot_2018-09-01_12-49-57

pierresh commented 6 years ago

Your dates are not in right format. See examples in the help: http://morrisjs.github.io/morris.js/lines.html

To check this, you can try to set the option parseTime to false

kaanklky commented 6 years ago

Unfortunately, adding parseTime: "false" to options didn't solve the problem. By the way, y keys are string but even so Do Morris still check to key if it can be parsed?

pierresh commented 6 years ago

no need the quotes, this a boolean parseTime: false

kaanklky commented 6 years ago

Oh, sorry; graph is looking greate now. ^^