Skip to content

Pie chart can't be repositioned #304

@sambostock

Description

@sambostock

I am building a pie chart which must be contained inside a rather small box. Due to the size of the box, the legend overlaps with the pie chart.

Instead, I would like the chart on the left, with the legend on the right, with no overlap, roughly as follows:

+---------------+
|    ###    +--+|
|   #####   |  ||
|    ###    +--+|
+---------------+

There appears to be no way to shift the pie chart over, so it isn't in the centre of the container.

I was able to hack something together by lying about the width in the pie options I pass in, but that obviously isn't an ideal solution.

Would it be possible to add a pair of shift options to pass in?

// ...
  pie: {
  show: true,
  explode: 0,
  // ...
  shiftRight: -10  // px by default, but could be % instead or something
  shiftDown: 0
}
// ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions