您可以為此設置默認值。您可以在scale默認值中設置它,以便它對所有圖表類型和比例執行此操作。如果特別想隱藏X軸網格線,只需將其設置為圖表類型級別。 Chart.defaults.scale.gridLines.display = false // hides all the gridLines in all charts for all axesChart.defaults.line.scales.xAxes[0].gridLines = { display: false} // Hides only the X axes gridLines in all line chartsvar options = { type: 'line', data: { labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], borderWidth: 1 }, { label: '# of Points', data: [7, 11, 5, 8, 3, 7], borderWidth: 1 } ] }, options: { scales: { yAxes: [{ ticks: { reverse: fa