morrisjs / morris.js

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

doesnt display the correct labels for x axis #680

Open keyeli opened 8 years ago

keyeli commented 8 years ago

hey my json data looks something like this [{"datePoa":"2016-07-24","Frequency":"4"},{"datePoa":"2016-07-25","Frequency":"4"}]

am using jquery ($.getJSON)to fetch it and a function called chart() that accepts json as a parameter to call the morris.area() method here is the code

function Chart(json){ Morris.Area({ element: 'morris-area-chart', data: json, xkey: 'datePoa', ykeys: ['Frequency'], labels: ['Frequency'], pointSize: 3, fillOpacity: 0, pointStrokeColors:['#00bfc7'], behaveLikeLine: true, gridLineColor: '#e0e0e0', lineWidth: 3, hideHover: 'auto', lineColors: ['#00bfc7'], resize: true

});

} here is the screen shot of how the graphs looks like...my problem is the x axis labels..dont know where these values come from screenshot 91

zawadzkip commented 7 years ago

@keyeli not sure if you have resolved this, but for the time being you can just do an xLabelFormat function as a temporary workaround