Skip to content
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

Updating pie chart labels and handling smaller charts #349

Open
paul-dorsetcouncil opened this issue Apr 22, 2024 · 0 comments
Open

Updating pie chart labels and handling smaller charts #349

paul-dorsetcouncil opened this issue Apr 22, 2024 · 0 comments

Comments

@paul-dorsetcouncil
Copy link

Describe the solution you'd like
I need to be able to display values on my pie charts rather than percentages. I notice issue #333 is also looking to be able to control the font of pie chart labels. Whilst investigating displaying values I also discovered that pie charts don't render as expected if you make the size of the chart smaller within a QGIS layout. This might be important in a layout with multiple pie charts next to each other.

I'm proposing that I create an update to allow:

  • Switching the labels between Percentage and Value
  • Allowing the zoom factor of the element to be controlled from the layout UI
  • Allowing the labels of zero to be hidden if requested
  • Allowing for the resizing of the font used from the UI

Describe alternatives you've considered
Whilst I've added a couple of other peoples requests to the list above my focus was on the first two items in the list. I've already created a branch with a possible solution to create the desired changes. You can see the diff in #348 which is a PR I created a bit ahead of time.

I'd be grateful for feedback on the work I've done so far and if wanted I could continue on to try and resolve the final two bullet points in the list. Hiding zero values is as simple as replacing '0' or '0%' with null in the "text" : [] object.

I believe the last one may be harder as I'd probably need to add an option to the options section that is used for other font settings.

This is my first contribution to this project so I'm not convinced my existing coding is perfect so suggestions on how to improve it would be welcomed and thank you for putting together this great plugin!

Additional context
Here are some screenshots from my initial work:
Before:
image

After:
image
© Crown copyright [and database rights] [2024] AC0000830671.

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

No branches or pull requests

1 participant