react-native-echarts-wrapper icon indicating copy to clipboard operation
react-native-echarts-wrapper copied to clipboard

how to avoid pie chart's label out of range?

Open BeckWang0912 opened this issue 6 years ago • 0 comments

  series: [
    {
      name: 'mark',
      type: 'pie',
      radius: ['35%', '60%'],
      center: ['50%', '50%'],
      smooth: true,
      label: {
        normal: {
          show: false
        },
        emphasis: {
          show: true,
          formatter: function (params: any) {
            const arry = params.name.split('&')
            return arry[0]
          },
        }
      },
      labelLine: {
        normal: {
          show: false
        },
        emphasis: {
          show: true,
        }
      },
      data: this.props.pieData,
      itemStyle: {
        emphasis: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]

Question: “arry[0]” like this "Foreign-currency Time Deposit",
Label may be outside the canvas when it too long , use ("\n") 、("\nn") or ("
") not work , how to fix it ?

BeckWang0912 avatar Oct 09 '19 02:10 BeckWang0912