2
我在我的angular2应用中使用了ZingChart。 我正在尝试更新线图的scale-x。 但无法找到该API:ZingChart在Angular2中更新刻度x
export class App {
charts : Chart[];
@ViewChild(ZingChart)
chart: ZingChart;
constructor() {
this.name = 'Angular2'
this.charts = [{
id : 'chart-1',
data : {
type : 'line',
series : [{
values :[2,3,4,5,3,3,2]
}],
},
height : 400,
width : 600
}]
}
update(){
this.charts[0].data.series[0].values = [1,2,3,4,5,6];
//this.charts[0].data.x.value=[1,2,3,4,5,6]; ???
this.chart.update();
}
}
这里是一个plunkr
?你想显示文字而不是数字吗?你想更改轴上的标签吗? – nardecky
@nardecky我想过去12小时。所以现在它是3比例x应该是[3,4,5,6,7,8,9,10,11,12,13,14],当它将是4时,它应该从4开始即[4,5 ,-6,7,8,9,10,11,12,13,14,15-] – Noa