Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

How we use legend in PieChart #71

Open
slgauravsharma opened this issue Jun 9, 2021 · 2 comments
Open

How we use legend in PieChart #71

slgauravsharma opened this issue Jun 9, 2021 · 2 comments
Labels

Comments

@slgauravsharma
Copy link

How we use legend in PieChart?

Please share example code for the same

@WoodMKII
Copy link

@slgauravsharma The legend can be used in a similar way standard dc.js

For example, from App.js in the playground:

import * as dc from 'dc'
<PieChart
    dimension={gainOrLoss}
    group={gainOrLossGroup}
    width={180}
    height={180}
    radius={80}
    legend={dc.legend()}
/>

Or something slightly more custom:

<PieChart
    dimension={gainOrLoss}
    group={gainOrLossGroup}
    width={250}
    height={180}
    radius={80}
    legend={new dc.Legend().itemHeight(20).gap(5)}
/>

@plourenco
Copy link
Member

Adding to the comment above, ideally, this would soon become a feature (avoiding the use of dc directly), such as:

legend={{
    itemHeight: 20,
    gap: 5
}}

or even

legendItemHeight={20}
legendGap={5}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants