Open buchen opened 1 year ago
(I will fix the copyright headers once we agreed on the API and I polished the pull request up)
That looks really promising. Let me inspect it in detail and give you a feedback soon.
@buchen I have refactored the Pie charts handling, see https://github.com/eclipse/swtchart/issues/319.
I will start a release of SWTChart by Monday, 16th of January. If you'd like to merge your improvements for the next release, please let me know.
Issue: #286
This is draft to enables labels on pie and doughnut charts.
I propose to extend the ISeriesLabel to add options for positioning and a label provider. I happy to discuss alternatives how to integrate it into the existing API.
There are three things that I would love to hear your thoughts:
First, I would love to enable multiple label placements (say the percentage inside the pie slice, the label placed outside). But that does not really fit to the existing ISeriesLabel interface with the get/setter for the ISeriesLabel. One could add a
createAdditionalLabel
method.Second, in PP I am rendering the label color - if placed inside the pie slice - based on the color of the slice (dark slice = white; bright slice = black). Again, I could ignore the Foreground method in the interface, but it is not intuitive as the interface has the method
Third, I am using
Function<Node, String> labelProvider
to not introduce a dependency to JFace. Any better idea?Examples for the use of the new API:
Example charts: