Reactjs react-chartjs-2记号不会与中心对齐
我正试着将折线图上的记号对准中心,如下所示: 现在我的图表是这样的: 正如你所看到的,我不能移除X轴上的小线或将它们对准中心,当我有很多数据时,这条线会非常尖,并且会像其他线一样平滑 这是我目前的配置:Reactjs react-chartjs-2记号不会与中心对齐,reactjs,chart.js,react-chartjs-2,Reactjs,Chart.js,React Chartjs 2,我正试着将折线图上的记号对准中心,如下所示: 现在我的图表是这样的: 正如你所看到的,我不能移除X轴上的小线或将它们对准中心,当我有很多数据时,这条线会非常尖,并且会像其他线一样平滑 这是我目前的配置: data: { labels: [], datasets: [ { label: false, data: [], fil
data: {
labels: [],
datasets: [
{
label: false,
data: [],
fill: true,
borderWidth:2,
backgroundColor: '#E0F2FE',
borderColor: '#14A1FB',
pointRadius: 0,
lineTension: 0,
cubicInterpolationMode: 'monotone',
borderCapStyle: 'round',
},
],
},
options: {
animation: {
duration: 0,
},
responsive: true,
layout: {
padding: 2,
},
maintainAspectRatio: false,
legend: {
display: false
},
scales: {
alignToPixels: true,
yAxes: [{
position: 'right',
ticks: {
align: 'start',
mirror: true,
z: 1,
padding: 5,
beginAtZero: false,
fontColor: '#9c9c9c',
maxTicksLimit: 4,
offset: true,
},
gridLines: {
drawOnChartArea: true,
borderDash: [8, 4],
beginAtZero: true,
drawBorder: false,
offsetGridLines: true
}
}],
xAxes: [{
ticks: {
align: 'start',
padding: -25,
z: 1,
fontColor: '#9c9c9c',
fontFamily: "Roboto Regular",
source: "labels",
maxTicksLimit: '',
autoSkip: true,
maxRotation: 0,
minRotation: 0,
tickColor: "transparent"
},
gridLines: {
align: 'start',
drawBorder: false,
drawOnChartArea: false,
beginAtZero: false,
offsetGridLines: false
}
}]
}
}