0
我正在嘗試編輯使用ember-cli-chart來顯示圖表的選項。ember-cli-chart獲取beginAtZero工作
這裏是我的代碼:
// hbs template
{{ember-chart type="Line" data=journeyData options=lineOptions height=100 width=400}}
// route
journeyData: Ember.computed('model.journey', function(){
return {
labels: this.get('model.journey').mapBy('date'),
datasets: [{
label: "Emissions",
fill:false,
tension: 0,
fillColor: "rgba(0,0,0,0)",
strokeColor: "#4caf50",
data: this.get('model.journey').mapBy('emissions'),
}]
}
}),
lineOptions: {
scales: {
yAxes: [{
ticks: {
max: 5,
min: 0,
stepSize: 0.5,
beginAtZero: true
}
}]
},
responsive: true,
maintainAspectRatio: true,
}
這是載列的文件說,但沒有下「」天平正在工作的選項。響應和維護AspectRatio選項的工作。
我把它放在正確的地方嗎?
有你嘗試設置在控制器中的數據? –