Skip to content

marginInPercent right and left flipped #83

@tepedersen

Description

@tepedersen

Discovered a wierd bug.

When specifying marginInPercent for the number for left: will apply to the right hand margin, and vice versa!

I.e: marginInPercent={{top: 0.05, bottom: 0.05, left: 0.05, right: 0.1}} will give twice as big a margin at the left side of the svg canvas compared to the right hand side, which is the opposite of the intended effect

Had a quick peek at the code in chart.ts, the error is in centerGraph():

dimensions.current.margin.left =
        dimensions.current.width / 2 - dimensions.current.outerRadius + dimensions.current.margin.right;

it should be:

dimensions.current.margin.left =
        dimensions.current.width / 2 - dimensions.current.outerRadius + dimensions.current.margin.left;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions