HTML:
highcharts-ng配置:
var prices = [60.5, 55.7]; // Static data works$scope.chartConfig = { options : { chart : { type : 'line' } }, series : [ { data : prices } ], title : { text : 'Monthly Book Prices' }, loading : false}
动态更新series数据:
$scope.chartConfig.series[0].data = $scope.book.prices 或者用下面这个方法:var prices = {data: [60.5, 55.7]}; // Static data works$scope.chartConfig = { options : { chart : { type : 'line' } }, series : [ prices ], title : { text : 'Monthly Book Prices' }, loading : false}prices.data = [60.5, 55.7]
Highcharts官网: