Echarts可视化教程

  1. 网站首页
  2. 百度ECharts
  3. ECharts实例
  4. ECharts入门
  5. 地图大全
  6. ECharts官网

百度Echarts饼图标签formatter使用及自定义标签

option = {
  series: [
    {
      ...
      label: {
        formatter: params => {
          return `{color${params.dataIndex}|${params.name}(${params.value})}`
        },
      },
      ...
    },
    {
      ...
      label: {
        position: 'inside',
        formatter: `{data|{c}}\n{serie|{a}}`,
        rich: {
          data: {
            fontWeight: 'bold',
            fontSize: 24,
            color: `#f00`,
            lineHeight: 36,
            textBorderColor: `transparent`,
            textBorderWidth: 0
          },
          serie: {
            fontSize: 16,
            color: `#0f0`,
            lineHeight: 28,
            textBorderColor: `transparent`,
            textBorderWidth: 0
          }
        }
      },
      ...
    }
  ]
};
点击展开全文

相关文章

  1. 百度Echarts饼图系列之自定义效果
  2. 百度Echarts饼图系列之多个百分比环形图
  3. 百度Echarts饼图系列之科技感环图
  4. 百度Echarts饼图统计图表
  5. 百度echarts饼图之太极阴阳图