12 Star 26 Fork 5

twp0217 / ngx-echarts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

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] 自适应图表 boolean false
[loading] 是否显示加载动画 boolean -
[loadingConfig] 加载动画配置 EChartsLoadingConfig -
[group] 图表的分组,用于联动 string -
(onChartInit) 图表初始化时的回调 (echartsInstance: EchartsInstance) => void -
[onEvents] 图表事件 EchartsOnEvents -

支持

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

空文件

简介

Apache ECharts component for Angular(基于 Angular 的 Apache ECharts 组件) 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/twp0217/ngx-echarts.git
git@gitee.com:twp0217/ngx-echarts.git
twp0217
ngx-echarts
ngx-echarts
master

搜索帮助