AppPear / ChartView

ChartView made in SwiftUI
MIT License
5.33k stars 652 forks source link

AppPear/ChartView - PieChartView support for segment/sector/pie description #13

Open patpatpat123 opened 5 years ago

patpatpat123 commented 5 years ago

Hello,

Wanted to say, this pie chart is simply beautiful. If I may, the definition of a pie chart is: (taken randomly from any dictionary on the web) pie chart noun a graphic representation of quantitative information by means of a circle divided into sectors, segment, in which the relative sizes of the areas (or central angles) of the sectors correspond to the relative sizes or proportions of the quantities.

Would it be possible to have a way to define the sectors, segments?

For instance, in your example: PieChartView(data: [8,23,54,32], title: "Title", legend: "Legendary") // legend is optional

Would it be possible to do something like: PieChartView(data: [8,23,54,32], segmentDescription: ["student", "active professional", "retired", "without job"], title: "category in % leaving in city X", legend: "Legendary") // legend is optional

So we can understand 8% are students, 23% are active professional, etc...

PieChartView(data: [8,23,54,32], segmentDescription: ["soccer player", "tennis player", "judo player", "gymnast"], title: "athlete going to the Olympic", legend: "Legendary") // legend is optional

So we can understand 8% are soccer players, 23% are tennis players, etc...

The main idea is to be able to provide description for one piece of the pie chart, not just an overall title/legend. For instance, in your picture, there is no way to say what corresponds to the smallest or biggest part of the pie without a lengthy Title/Legend.

I believe this would further increase the usage and the good experience using pie chart.

Thank you for your help

AppPear commented 4 years ago

I'm quite busy now but if you make a PR I'm happy to merge it! :)