g2-card 图表卡片 - 图1 This article has not been translated, hope that your can PR to translated it. Help us!g2-card 图表卡片 - 图2

g2-card 图表卡片

图表卡片,用于展示图表的卡片容器,可以方便的配合其它图表套件展示丰富信息。

  1. import { G2CardModule } from '@delon/chart/card';

代码演示

g2-card 图表卡片 - 图3

风格一

风格一用法。

  1. import { Component } from '@angular/core';
  2. @Component({
  3. selector: 'chart-card-style1',
  4. template: `
  5. <g2-card [title]="'销售额'" [bordered]="true" [total]="'¥ 126,560.00'" footer="日访问量 12,423" contentHeight="46" [action]="action">
  6. <ng-template #action>
  7. <i nz-tooltip nzTooltipTitle="指标说明" nz-icon nzType="info-circle"></i>
  8. </ng-template>
  9. 周同比<trend flag="up" style="margin: 0 16px 0 8px; color: rgba(0,0,0,.85)">12%</trend>
  10. 日环比<trend flag="down" style="margin: 0 0 0 8px; color: rgba(0,0,0,.85)">11%</trend>
  11. </g2-card>
  12. `
  13. })
  14. export class ChartCardStyle1Component {
  15. }

g2-card 图表卡片 - 图4

风格三

风格三用法。

  1. import { Component } from '@angular/core';
  2. @Component({
  3. selector: 'chart-card-style3',
  4. template: `
  5. <g2-card [title]="'移动指标'" [bordered]="true" [total]="'¥ 126,560.00'"
  6. [avatar]="avatar" [action]="action">
  7. <ng-template #avatar><img style="width:56px; height: 56px" src="./assets/img/logo-color.svg"/></ng-template>
  8. <ng-template #action>
  9. <i nz-tooltip nzTooltipTitle="指标说明" nz-icon nzType="info-circle"></i>
  10. </ng-template>
  11. </g2-card>
  12. `
  13. })
  14. export class ChartCardStyle3Component {
  15. }

g2-card 图表卡片 - 图5

风格二

风格二用法。

  1. import { Component } from '@angular/core';
  2. @Component({
  3. selector: 'chart-card-style2',
  4. template: `
  5. <g2-card [title]="'移动指标'" [bordered]="true" [total]="'¥ 126,560.00'" footer="日访问量 12,423"
  6. [avatar]="avatar" [action]="action">
  7. <ng-template #avatar><img style="width:56px; height: 56px" src="./assets/img/logo-color.svg"/></ng-template>
  8. <ng-template #action>
  9. <i nz-tooltip nzTooltipTitle="指标说明" nz-icon nzType="info-circle"></i>
  10. </ng-template>
  11. </g2-card>
  12. `
  13. })
  14. export class ChartCardStyle2Component {
  15. }

API

g2-card

参数说明类型默认值
[title]卡片标题string,TemplateRef<void>-
[avatar]头像string,TemplateRef<void>-
[action]卡片操作string,TemplateRef<void>-
[total]数据总量(支持HTML)string-
[footer]卡片底部string,TemplateRef<void>-
[contentHeight]内容区域高度(单位:pxstring-
[bordered]是否显示边框booleanfalse