angular directive for ECharts(基于AngularJS的echarts指令)
- AngularJS >=1.2.0
- ECharts >=3.4.0
bower install echarts-angular --save
<script type="text/javascript" src="bower_components/echarts/dist/echarts.min.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="bower_components/echarts-angular/dist/echarts-angular.min.js"></script>
- controller
var app = angular.module('app', ['echarts-angular']);
app.controller('demo', ['$scope', function($scope){
$scope.option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
};
}]);
- html
<div class="container" ng-controller="demo">
<echarts-angular option="option"></echarts-angular>
</div>
- 如果项目对你有帮助,请点颗星:star:
- 有问题,请提交 issue