Is there a way to prevent labels from overlapping in a victory pie chart?

186 views Asked by At

I am making a pie chart with Victory Charts in react (documentation here https://formidable.com/open-source/victory/docs/victory-pie) and in some conditions, the labels of my pie chart overlap because the slices are too small. pie chart w/ overalapping layers

I have tried to scour the docs and the internet but I can't find anything on how to make these labels not overlap. Does anyone have any ideas?

1

There are 1 answers

0
Elif Çetiner On

if didn't try , you can use labelComponent inside VictoryPie to give an angle to your labels like in this examle

  <VictoryPie
  data={sampleData}
  labels={({ datum }) => datum.y}
  labelComponent={<VictoryLabel angle={45}/>}
/>

or you if this can cover your need you can look at VictoryLegend

I hope this can cover your problem.