angular6:使用echarts方法

本文档介绍了如何在Angular6项目中集成ECharts,包括安装ngx-echarts和echarts库,配置angular.json文件,以及在组件中声明并设置ECharts的option选项,适用于希望在Angular应用中实现数据可视化的开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

注意:n本人采用最新版本的 echarts4.1.0,ngx-echarts3.1.0angular6.0.0;其余版本可以下载对应的文件
1.通过npm 导入相对应的包
npm install echarts --save
npm install ngx-echarts --save

2.在angular.jsonn文件中引入echart

在这里插入图片描述
3.在app.module中引入文件
import { NgxEchartsModule } from “ngx-echarts”;
在importsn中引入NgxEchartsModule

4.在对应页面使用,在component中声明option

this.visitOption= {
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'cross',
          crossStyle: {
            color: '#999'
          }
        }
      },
      toolbox: {
        feature: {
          dataView: {show: true, readOnly: false},
          magicType: {show: true, type: ['line', 'bar']},
          restore: {show: true},
          saveAsImage: {show: true}
        }
      },
      legend: {
        data:['时间','访问量','平均访问量']
      },
      xAxis: [
        {
          type: 'catego
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值