Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs react-chartjs-2记号不会与中心对齐_Reactjs_Chart.js_React Chartjs 2 - Fatal编程技术网

Reactjs react-chartjs-2记号不会与中心对齐

Reactjs react-chartjs-2记号不会与中心对齐,reactjs,chart.js,react-chartjs-2,Reactjs,Chart.js,React Chartjs 2,我正试着将折线图上的记号对准中心,如下所示: 现在我的图表是这样的: 正如你所看到的,我不能移除X轴上的小线或将它们对准中心,当我有很多数据时,这条线会非常尖,并且会像其他线一样平滑 这是我目前的配置: data: { labels: [], datasets: [ { label: false, data: [], fil

我正试着将折线图上的记号对准中心,如下所示:

现在我的图表是这样的:

正如你所看到的,我不能移除X轴上的小线或将它们对准中心,当我有很多数据时,这条线会非常尖,并且会像其他线一样平滑

这是我目前的配置:

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
                    }
                }]
            }
        }