I'm new in anychart js and I'm facing some difficulties. I have a json file which is loaded from an API. This json file contains informations about nba players stats. Here is my json file :
https://www.balldontlie.io/api/v1/stats
What I want is to get the date data on th X axis. How can I solve that ?
function getData() {
axios.get("https://www.balldontlie.io/api/v1/stats").then(response => {
var tab = [];
for (item of response.data.data) {
tab.push([item.date, item.fga]);
}
anychart.onDocumentReady(function() {
var month = [];
for (item of response.data.data) {
month.push(item.date.split('-'));
}
var data = tab;
var chart = anychart.line();
var serie = chart.line(data);
chart.yScale().minimum(0);
chart.yScale().maximum(50);
chart.container("container");
chart.draw();
});
});
}
getData();