I have a graph like the following:
I take the graph data from this URL
and my javascript function is as follows:
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 be displayed on the X axis, since the json has an entry for each day of the month, however, nothing is displayed...
I've tried messing around with the xLabelFormat , xLabels properties and nothing. I have also tried to enlarge the graph and although more labels are shown on the x-axis, the day to day is not even remotely shown.
Currently it shows me dates from 1970, when the timestamp received by the json is correct and I don't know why either.
Can anyone give me some clue as to where I have the error?
I have modified my function to format the timestamp I get from get by the formatted date: