# 指标

<sm-indicator title="人均收入" unit="" indicatorColor="red" textColor="red" :num="12323412" fontSize="18">
</sm-indicator>

# Attributes

参数 说明 类型 可选值 默认值
title 标题 string - '指标标题'
unit 单位 string - '单位'
num 数据 string | number - 0
decimals 小数位数 number - -1 (计算结果的默认小数位数)
mode 排列方式 string 'vertical' | 'horizontal' 'vertical'
separator 千分符 string - ','(英文逗号)
separatorBackground 分隔符背景 boolean - false
showTitleUnit 是否显示标题和单位 boolean - true
animated 数字动画 boolean - false
duration 动画时长 string | number - 1000
fontWeight 字体粗细 string | number 'lighter' | 'normal' | 'bolder' 'border'
fontSize 数字字体大小 string | number - -
textFontSize 标签和单位字体大小。默认用 fontSize 的 0.66 倍 string | number - -
numSpacing 字体间距 number - 0
indicatorColor 指标值的字体颜色 string - -
numBackground 背景样式 object - { color: 'rgba(0, 0, 0, 0)', image: '', padding: 0 }
thresholdsStyle 阈值样式 ThresholdsStyle - -
url 服务地址 string - -
proxy 服务代理地址 string - -
numField 指标值字段。指定服务响应数据中的字段 string - -
titleField 标题字段。指定服务响应数据中的字段 string - -
unitField 单位字段。指定服务响应数据中的字段 string - -

支持主题混入参数定时刷新混入参数

# ThresholdsStyle

// 阈值格式如下
[
  {
    "max": 50,
    "color": "#0CD54A"
  },
  {
    "min": 50,
    "max": 80,
    "color": "#F7682D"
  },
  {
    "min": 80,
    "color": "#DD2C2C"
  }
]
最后更新时间: 2021/2/8 下午6:09:40