Allow legend to the side of Donut chart, not only in tooltip #6987
Toshinaki
started this conversation in
Feature requests
Replies: 1 comment
-
Hey, I haven't worked much with Mantine and React yet. I'm currently tinkering with a private hobby project and experimenting with Remix and Mantine. I found the following solution that works for me. Since Mantine charts are based on Recharts, I use the Legend component from Recharts. I hope this helps you a bit. import {DonutChart} from '@mantine/charts';
import React from "react";
import {Legend} from "recharts";
export const data = [
{name: 'USA', value: 400, color: 'indigo.6'},
{name: 'India', value: 300, color: 'yellow.6'},
{name: 'Japan', value: 100, color: 'teal.6'},
{name: 'Other', value: 200, color: 'gray.6'},
];
export default function route() {
return (
<>
<DonutChart withLabelsLine withLabels data={data}>
<Legend
verticalAlign="bottom" height={36}/>
</DonutChart>
</>
);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To be honest, showing the detail of the donut chart on hover, and covers almost all of the chart itself not seem very useful.
It would be great if we could control this behavior with for example:
Also, hover on the legend makes the corresponding bars highlight would look great in donut chart too.
Beta Was this translation helpful? Give feedback.
All reactions