比如定义了图表之后,我想知道y轴的步长。
// Your average chart
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
options: {}
});
我可以执行以下操作吗?
console.log(downChart.options.scales.yAxes.ticks.stepSize);
杨__羊羊
相关分类