I'm relatively new to using anychart js and encountering some obstacles. I have a json file that is being fetched from an API, containing data on NBA players' statistics. You can find the json file here:
My goal is to display the date data on the X axis of the chart. How can I achieve this?
function retrieveData() {
axios.get("https://www.balldontlie.io/api/v1/stats").then(response => {
var dataPoints = [];
for (item of response.data.data) {
dataPoints.push([item.date, item.fga]);
}
anychart.onDocumentReady(function() {
var dates = [];
for (item of response.data.data) {
dates.push(item.date.split('-'));
}
var data = dataPoints;
var chart = anychart.line();
var series = chart.line(data);
chart.yScale().minimum(0);
chart.yScale().maximum(50);
chart.container("container");
chart.draw();
});
});
}
retrieveData();