-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improve Pie- and Doughnut Chart Labels and Layout #286
Comments
|
I mean, even if I do orient the text to be in accordance with pie slice, it can still become cluttered right? |
As about orienting the data aligned with pie slices, not a problem, can be done like this |
The following example looks good: portfolio-performance/portfolio#2597 @himanshu-balasamanta Do you think, it's possible to get something similar as above? |
It most certainly is. I will get on to working on it. |
Great! Let me know if you need any assistance. |
BTW, I have experimented with the labels - see the screenshot below |
Hi Andreas,
cool, that looks good!
Can you create a Pull Request?
Best,
Philip
…On 04.12.22 07:02, Andreas Buchen wrote:
BTW, I have experimented with the labels
<https://github.com/buchen/portfolio/blob/master/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/chart/PieChart.java#L94-L154>
- see the screenshot below
Bildschirmfoto 2022-12-04 um 06 59 46
<https://user-images.githubusercontent.com/587976/205476949-8874a9aa-8e13-476e-b562-85741e4530ed.png>
—
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFHUTZ36CQEU5YX4KWWUA3WLQXWDANCNFSM5QQJWSSQ>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder ***@***.*** »http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
|
Thanks a lot for improving these!
Not sure if it fits this issue or if it is even working as intended, but I noticed that the SWT charts enforce a minimum covered angle of 1 degree per item. If the plot contains too many items that should take less than 1 degree the results can look wrong, drawn angles for parent are off. Context: org.eclipse.swtchart/src/org/eclipse/swtchart/model/Node.java, I think a fix would either require to forego the 1 degree limit and/or to drop slices that are too small. |
@csprunk writes:
It is a problem also for me. See here. This is my understanding: the underlaying GraphicsContext SWT GC#fillArc only supports integers for startAngle and arcAngle. The current code applies an heuristic which then fails for many small slices. |
For my project, I have done an alternative implementation. Instead of forcing the slices to be at least 1 degree, I am first assigning "free degrees" to the slices with 0 arc length (for example if rounding error lead to less than 360 degrees) and then I am inserting gaps to at least indicate that there is at least one slice not drawn. Because my data is typically sorted by size, there is one gap at the end. Not sure if that works as general behavior. So far I am quite happy with the resulting charts. If you are interested, I could try to make a contribution (the existing algorithm in Node runs after each update - thus has to handle incomplete charts as well) |
@buchen That sounds reasonable. I would be happy if you would like to contribute your alternative implementation. We could add an option to the chart settings, whether to use the current or your implementation. Let me know if you need assistance. |
Have a look at the examples:
portfolio-performance/portfolio#2597
https://gist.github.com/digedag/a708844ba36927aa9f74e831b78a6f4c
The text was updated successfully, but these errors were encountered: