-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: show each item count in legend #34
Comments
The legend does show the value of each section and the % of chart area it's taking when you hover over it.
You can actually set the |
Ok, I need the value to be shown directly, so I will modify it maybe.
I tried to do that, but it didn't work as expected, only half of the pie was fullfilled! |
Yup, you can customize it with the
I just tried it in jsfiddle using your example of 6, 3, 3 and it seems to be working fine. https://jsfiddle.net/dumptyd/Lukxrb2p/ . |
Oh! Thank you I was looking for that!
Probably it's my current configuration, I'm using Vuetify and there are some flaws in the code, due to some upgraded libraries and some legacy ones. Anyway, the legend was the most important part! Ty :-) P.s: I can share the code if you want, I think that would be nice to have total count in the legend, enabled with one option |
Could you share a screenshot of what you have in mind? |
I also want to control the legends <vc-donut hasLegend legendPlacement="bottom" total="100" size="150" :thickness="45" :sections="sections">
<template v-slot:legendItem="props">
{{props.color}} <!--from donut sections-->
{{props.value}} <!--from donut sections-->
{{props.percent}} <!--virtual field = value/total*100%-->
{{props.label}} <!--from donut sections-->
</template>
</vc-donut> |
Hello, nice chart!
What about showing the total count for each section in the legend? Or even in a tooltip while hovering each slice?
My service is returning an array of objects, each contains it's value... so let's say there are 3 sections, first with value = 3, second = 3, third = 6, with this formula I've converted these values into percentages:
Total is the sum of all the values. Yeah I know...it's easy but I think that would be nice to have it implemented as an option, in order to avoid this conversion every time. :-)
The text was updated successfully, but these errors were encountered: