Nivo: Labels overflow on Pie chart

Created on 5 Sep 2017  路  1Comment  路  Source: plouc/nivo

If I have a pie chart with labels, some labels end up outside of the drawn SVG and are since not shown:
image
In this image, I gave the SVG tag a gray border color so it is clear what is been cut off.

The code for the chart looks like this:

<Pie 
    data={this.props.chartData}
    height={500} 
    width={500}
    margin={{
      left: 10,
      right: 50,
      top: 10,
      bottom: 10
    }}
    // not relevant other info
 />
question wontfix

Most helpful comment

@SammyIsra, yes, you have to add more margin to correctly display your labels, computing the required space for labels is far too costly in svg because you'll have to render the chart, compute labels size & original position, then recompute the whole chart & re-render, and this process will be invoked in each frame when animating.

>All comments

@SammyIsra, yes, you have to add more margin to correctly display your labels, computing the required space for labels is far too costly in svg because you'll have to render the chart, compute labels size & original position, then recompute the whole chart & re-render, and this process will be invoked in each frame when animating.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pratikguru picture pratikguru  路  3Comments

danpettay picture danpettay  路  3Comments

vagnervst picture vagnervst  路  4Comments

stahlmanDesign picture stahlmanDesign  路  3Comments

KENNYSOFT picture KENNYSOFT  路  3Comments