I have a graph like the following:
the data of the graph I take from this URL
and my javascript function is the following:
function charts(){
{% for coin in UserCoins %}
$.get("https://min-api.cryptocompare.com/data/histoday?aggregate=1&fsym={{coin.short_name}}&tsym=EUR&limit=30&extraParams=CryptoAssistant",function(data){
//charts
new Morris.Line({
element: 'chart_{{coin.name}}',
data: data['Data'],
xkey: ['time'],
ykeys: ['close'],
labels: ['Close'],
hideHover: 'auto',
lineColors: ['#F96332'],
pointSize: 0,
postUnits: "€",
xLabelFormat: function (timestamp) {
var date = new Date(timestamp);
return date.getDate() + '/' + date.getMonth() + '/' + date.getFullYear();
}
});
});
{% endfor %}
}
I would like to get the days of the month to show up on the X axis, since the json has an entry for each day of the month, however, nothing is shown ...
I've tried playing with the xLabelFormat , xLabels and nothing properties. I have also tried to enlarge the graph and although more labels are shown on the x-axis, not far from day to day is shown.
Currently shows me dates of 1970, when the timestamp received by the json is correct and I do not know why.
Can anyone give me any clue about where I have the fault?