计图表

{% embed data=“{“url”:”https://stackblitz.com/edit/swimlane-gauge-chart?embed=1&file=app/app.component.ts”,”type”:”link”,”title”:”gauge-chart - StackBlitz”,”description”:”Gauge 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}}” %}

输入

属性

类型

De fa ul

t

Va lu

e

描述

view

numbe r[]

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

resul ts

objec t[]

图表数据

schem e

objec t

图表的颜色方案

custo mColo rs

funct ion or objec t

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

anima tions

boole an

tr ue

使动画

legen d

boole an

fa ls e

显示或隐藏图例

legendTitle

strin g

‘L eg en d’

图例标题

min

numbe r

0

首发规模点

max

numbe r

10 0

ending point of the scale

units

strin g

text to display under the value

bigSe gment s

numbe r

10

number of big segments on the axis

small Segme nts

numbe r

5

number of small segments between every big segment

showA xis

boole an

tr ue

show or hide the axis

axisT ickFo rmatt ing

funct ion

the axis tick formatting

value Forma tting

funct ion

function that formats the value in the middle of the chart

angle Span

numbe r

24 0

the angle that the chart spans (in degrees)

start Angle

numbe r

-1 20

the angle that the chart is rotated by. Use negative half of the spanning angle to centralize

toolt ipDis abled

boole an

fa ls e

显示或隐藏工具提示

toolt ipTem plate

Templ ateRe f

工具提示中要显示的自定义 ng-template

showT ext

boole an

tr ue

显示或隐藏内部文本

输出

属性

描述

select

单击事件

activate

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

deactivate

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

数据格式

数据格式为单系列:

[
  {
    "name": "Germany",
    "value": 8940000
  },
  {
    "name": "USA",
    "value": 5000000
  }
]