---
order: 19
group:
  title: 文本
  order: 40
---

## 文字标签

文字标签

```tsx
import React from 'react';
import * as Charts from 'edata-charts';
const props = {
  data: [
    {
      content: '家有宝宝',
    },
    {
      content: '时尚达人',
      type: 'series1',
    },
    {
      content: '美食专家',
    },
    {
      content: '运动先锋',
      type: 'series1',
    },
    {
      content: 'VIP4',
    },
    {
      content: '时尚达人',
      type: 'series1',
    },
    {
      content: '美食专家',
    },
  ],
  customConfig: [
    // 不传属性为默认  传了属性以属性优先
    {
      type: 'series1',
      background: 'rgb(121, 218, 255)',
      fontSize: '',
      color: '',
      fontWeight: 'normal',
    },
  ],
  defaultConfig: {
    padding: 10,
    borderRadius: 5,
    background: '#35629d',
    fontSize: '',
    color: '#fff',
    fontWeight: 'normal',
    fontFamily: '微软雅黑',
  },
  globalConfig: {
    fontFamily: '微软雅黑',
    autoLayout: false,
    rowNum: 4,
    columnNum: 3,
    gridColumnGap: 5,
    gridRowGap: 5,
  },
};

export default () => <Charts.TextLabel {...props} />;
```

## API

| 参数          | 说明       | 类型    |
| ------------- | ---------- | ------- |
| size          | 宽高       | object  |
| dataValue     | 数据       | array   |
| globalConfig  | 全局配置   | object  |
| defaultConfig | 默认配置   | object  |
| customConf    | 自定义标签 | objject |

### dataValue

| 参数    | 说明       | 类型   |
| ------- | ---------- | ------ |
| content | 内容       | string |
| type    | 标签类别名 | string |

### globalConfig

| 参数          | 说明                  | 类型    |
| ------------- | --------------------- | ------- |
| fontFamily    | 字体(默认 微软雅黑)   | string  |
| autoLayout    | 自动布局（默认 true） | boolean |
| rowNum        | 行数                  | number  |
| columnNum     | 列数                  | number  |
| gridColumnGap | 列间距                | number  |
| gridRowGap    | 行间距                | number  |

### defaultConfig

| 参数         | 说明     | 类型            |
| ------------ | -------- | --------------- |
| padding      | 内容边距 | number / string |
| borderRadius | 圆角     | number          |
| background   | 背景色   | number          |
| fontSize     | 字号     | number          |
| color        | 字体颜色 | number          |
| fontWeight   | 字体粗细 | number          |

# customConfig

| 参数       | 说明     | 类型   |
| ---------- | -------- | ------ |
| background | 背景色   | number |
| fontSize   | 字号     | number |
| color      | 字体颜色 | number |
| fontWeight | 字体粗细 | number |
