Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@twp0217/ngx-echarts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twp0217/ngx-echarts

Apache ECharts component for Angular

  • 12.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ngx-echarts

简介

Apache ECharts component for Angular(基于 Angular 的 Apache ECharts 组件)

安装

npm install echarts @twp0217/ngx-echarts --save

使用

  • 安装依赖包:echarts@twp0217/ngx-echarts
npm install echarts @twp0217/ngx-echarts --save
  • 在module导入NgxEchartsModule
import { NgxEchartsModule } from '@twp0217/ngx-echarts';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    NgxEchartsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
  • 准备图表数据
option = {
  title: {
    text: 'ECharts 入门示例'
  },
  tooltip: {},
  legend: {
    data: ['销量']
  },
  xAxis: {
    data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
  },
  yAxis: {},
  series: [{
    name: '销量',
    type: 'bar',
    data: [5, 20, 36, 10, 10, 20]
  }]
};
  • 在模板页面使用
<ngx-echarts [option]="option"></ngx-echarts>

API

名称说明类型默认值
[option]图表的配置项和数据EChartsOption-
[theme]应用的主题EChartsTheme-
[initOpts]初始化附加参数EChartsInitOpts-
[setOptionOpts]设置图表的配置项和数据附加参数EChartsSetOptionOpts-
[autoResize]自适应图表booleanfalse
[loading]是否显示加载动画boolean-
[loadingConfig]加载动画配置EChartsLoadingConfig-
[group]图表的分组,用于联动string-
(onChartInit)图表初始化时的回调(echartsInstance: EchartsInstance) => void-
[onEvents]图表事件EchartsOnEvents-

支持

  • 如果项目对你有帮助,请点颗星:star:,谢谢。
  • 如果你对项目有想法、问题、BUG,欢迎讨论。

Keywords

FAQs

Package last updated on 12 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc