
我在我的react应用程序中使用图表。我尝试使用Scales and gridlines: false选项,但在我身上不起作用。该图像显示了我的代码。谢谢
发布于 2020-07-27 14:54:00
您可以查看chart.js sample。从那里,我发现您的示例的对象设置中存在一些偏差
var config = {
type: 'line',
data: {
datasets: [{
// Here starts your snippet
}]
},
options: {
// The options are outside of the datasets property
scales: {
x: {
gridLines: {
display: false
}
},
y: {
gridLines: {
display: false
}
}
}
}
};编辑1:使用gridLines属性更新了比例
发布于 2020-07-28 17:18:46
您可以使用以下代码移除网格线,如果您想要启用X和Y轴,它将非常有用
gridLines: {
display: true,
zeroLineColor:'white',
color:'transparent'
}https://stackoverflow.com/questions/63109879
复制相似问题