ChartJs смена единицы измерения
Пытаюсь построить график при помощи chartjs, выстраиваю следующим скриптом:
var ctx = document.getElementById("newChart").getContext("2d");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['2021-03-28', '2021-03-29', '2021-03-30', '2021-03-31', '2021-04-01', '2021-04-02', '2021-04-03', '2021-04-04', '2021-04-05', '2021-04-06', '2021-04-07', '2021-04-08', '2021-04-09', '2021-04-10', '2021-04-11', '2021-04-12', '2021-04-13'],
datasets: [{
label: 'count/day',
data: [1275, 695, 1943, 1552, 1568, 1429, 1548, 1017, 1079, 1413, 2085, 1255, 2035, 1057, 993, 1187, 488],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
],
borderColor: [
'rgba(255,99,132,1)',
],
borderWidth: 1
}]
},
options: {
legend: {
labels: {
fontColor: "#fff",
fontSize: 14
}
},
scales: {
xAxes: [{
type: 'time',
//distribution: 'linear',
time: {
parser: 'YYYY-MM-DD',
unit: 'week',
unitStepSize: 1,
displayFormats: {
'millisecond': 'MMM DD',
'second': 'MMM DD',
'minute': 'MMM DD',
'hour': 'MMM DD',
'day': 'MMM DD',
'week': 'MMM DD',
'month': 'MMM DD',
'quarter': 'MMM DD',
'year': 'MMM DD',
}
},
ticks: {
fontColor: "#fff",
fontSize: 10,
//stepSize: 1,
beginAtZero: true
}
}],
yAxes: [{
ticks: {
fontColor: "#fff",
fontSize: 10,
//stepSize: 50,
beginAtZero: true
}
}]
},
plugins: {
legend: {
display: true,
labels: {
color: 'rgb(255, 99, 132)'
}
}
}
}
});
При попытки изменить unit на какое либо значение не дает результата, Пытался также выполнить parser в данном случае, это тоже не приблизило к желаем результату, просьба, подсказать что делаю не так,