Angular2或Angular4使用echarts , ngx-echarts的方法
2017-08-23 15:16
543 查看
一个比较正确的使用方法:https://github.com/xieziyu/ngx-echarts
1、
2、项目中.angular-cli.json 中添加echarts
3、在module 中调用
4、html中
5、chartOption就是option
6、事件方法
(since v1.2.1)
(thanks to averhaegen)
1、
npm install echarts --save
npm install ngx-echarts --save
如果网速差,可以使用淘宝镜像
2、项目中.angular-cli.json 中添加echarts
{ "scripts": [ // ... // add this: "../node_modules/echarts/dist/echarts.min.js" // or echarts.js for debug purpose ], }
3、在module 中调用
import { AngularEchartsModule } from 'ngx-echarts'; @NgModule({ imports: [ ..., AngularEchartsModule ], ... }) export class AppModule { }
4、html中
<div echarts [options]="chartOption" class="demo-chart"></div>
5、chartOption就是option
6、事件方法
chartClick: It emits the same
paramsof
'click'event
chartDblClick: It emits the same
paramsof
'dblclick'event
chartMouseDown: It emits the same
paramsof
'mousedown'event
chartMouseUp: It emits the same
paramsof
'mouseup'event
chartMouseOver: It emits the same
paramsof
'mouseover'event
chartMouseOut: It emits the same
paramsof
'mouseout'event
chartGlobalOut: It emits the same
paramsof
'globalout'event
chartContextMenu: It emits the same
paramsof
'contextmenu'event
(since v1.2.1)
chartDataZoom: It emits the same
paramsof
'dataZoom'event
(thanks to averhaegen)
相关文章推荐
- angular1.0使用echarts点刷新再次调用echarts方法
- 使用ECharts碰到的一些问题和解决方法
- 使用echarts类库,在后台封装option,提供两种使用struts2传递参数到页面的方法
- angular.foreach 循环方法使用指南
- Angular外部使用js调用Angular控制器中的函数方法或变量用法示例
- ThinkPHP与Angular使用POST方法传递数据的问题
- angular.foreach 循环方法使用指南
- angular $location常用方法使用
- echarts使用方法
- angular使用bootstrap方法手动启动
- angular.copy(),angular.extend和angular.merge()方法使用总结
- angular中的$provide和$inject方法使用理解
- angular.element()方法的使用
- ngx_rbtree的基本使用方法
- Echarts中的折线图使用方法
- Nginx使用ngx_zeromq模块返回502错误的解决方法
- ionic和angular中使用rxjs的Observeble,其方法需要是private,不然build会出错
- Nginx使用ngx_zeromq模块返回502错误的解决方法
- Angular中$broadcast和$emit的使用方法
- echarts.js使用方法