您應該簡單地設置一些間隔和縮放圖表每次。例如:
private function initialZoom():void
{
var firstDate:Date = dataSet.dataProvider[0].date;
var endDate:Date = new Date(firstDate);
endDate.setDate(endDate.getDate() + 20);
chart.zoom(firstDate, endDate);
setInterval(zoomChart, 1000);
}
private function zoomChart():void
{
var startDate:Date = new Date(chart.startDate);
var endDate:Date = new Date(chart.endDate);
startDate.setDate(startDate.getDate() + 1);
endDate.setDate(endDate.getDate() + 1);
chart.zoom(startDate, endDate);
}
initialZoom應該在由AmStockChart觸發的dataUpdated事件上調用。請注意,您不應將任何期間設置爲「已選」,以使其發揮作用。