归一化面积图

归一化面积图

{% embed data=“{“url”:”https://stackblitz.com/edit/swimlane-normalized-area-chart?embed=1&file=app/app.component.ts”,”type”:”link”,”title”:”normalized-area-chart - StackBlitz”,”description”:”Normalized Area Chart demo for ngx-charts”,”icon”:{“type”:”icon”,”url”:”https://c.staticblitz.com/assets/icon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png”,”aspectRatio”:0},”thumbnail”:{“type”:”thumbnail”,”url”:”https://c.staticblitz.com/assets/icon-664493542621427cc8adae5e8f50d632f87aaa6ea1ce5b01e9a3d05b57940a9f.png”,”aspectRatio”:0}}” %}

输入

属性

类型

默认值

描述

view

number[]

图表[宽度,高度]的尺寸。如果未定义,图表将适合于父容器的大小

resul ts

obje ct[]

图表数据

schem e

obje ct

图表的颜色方案

计划类型

stri ng

‘o rd in al ’

色阶类型。可以是 ‘ordinal’ 或 ‘linear’

custo mColo rs

func tion or obje ct

自定义颜色图表。用于覆盖颜色的特定值

anima tions

bool ean

tr ue

使动画

legen d

bool ean

fa ls e

显示或隐藏图例

legendTitle

stri ng

‘L eg en d’

图例标题

legen dPosi tion

stri ng

‘r ig ht ’

图例位置 [‘right’, ‘below’]

xAxis

bool ean

fa ls e

显示或隐藏x轴

yAxis

bool ean

fa ls e

显示或隐藏y轴

showG ridLi nes

bool ean

tr ue

显示或隐藏网格线

round Domai ns

bool ean

fa ls e

对于对齐网格线圆域

showX AxisL abel

bool ean

fa ls e

显示或隐藏x轴标签

showY AxisL abel

bool ean

fa ls e

显示或隐藏y轴标签

xAxis Label

stri ng

X轴标签文本

yAxis Label

stri ng

y轴标签文本

trimX AxisT icks

bool ean

tr ue

修剪或不在x轴上蜱

trimY AxisT icks

bool ean

tr ue

修剪或不蜱在Y轴上

rotat eXAxi sTick s

bool ean

tr ue

enable automic rotation of x-axis ticks to prevent overlaps

maxXA xisTi ckLen gth

numb er

16

蜱的最大长度。如果 trimXAxisTicksTrue ,那么蜱超过这个长度会被剪掉

maxYA xisTi ckLen gth

numb er

16

蜱的最大长度。如果 trimYAxisTicksTrue ,那么蜱超过这个长度会被剪掉

xAxis TickF ormat ting

func tion

x轴刻度格式

yAxis TickF ormat ting

func tion

y轴刻度格式

xAxis Ticks

any[ ]

x轴刻度值的预定义的列表

yAxis Ticks

any[ ]

Y的预定义列表轴的刻度值

timel ine

bool ean

fa ls e

display a timeline control under the chart. Only available if x scale is date

autoS cale

bool ean

fa ls e

set the minimum value of the y axis to the minimum value in the data, instead of 0

curve

func tion

the interpolation function used to generate the curve. It accepts any `d3.curve <https://github.com/d3/d3-shape#curves >`__ function

gradi ent

bool ean

fa ls e

具有梯度,而不是纯色填充元件

activ eEntr ies

obje ct[]

[]

元素亮点

toolt ipDis abled

bool ean

fa ls e

显示或隐藏工具提示

toolt ipTem plate

Temp late Ref

a custom ng-template to be displayed inside the tooltip when hovering a single point

serie sTool tipTe mplat e

Temp late Ref

徘徊系列时,要在提示中显示的自定义NG-模板

输出

属性

描述

select

单击事件

activate

元件激活事件(鼠标输入)

deactivate

元件去激活事件(鼠标离开)

数据格式

数据格式是多系列:

[
  {
    "name": "Germany",
    "series": [
      {
        "name": "2010",
        "value": 7300000
      },
      {
        "name": "2011",
        "value": 8940000
      }
    ]
  },

  {
    "name": "USA",
    "series": [
      {
        "name": "2010",
        "value": 7870000
      },
      {
        "name": "2011",
        "value": 8270000
      }
    ]
  }
]