PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.53k stars 9.01k forks source link

A piechart inside another piechart #3336

Open anfehernandez94 opened 7 years ago

anfehernandez94 commented 7 years ago

How I put a piechart in a piechart? I'm trying to obtain the coordinates of center with: getCenter(), getCenterTextOffset(), getCenterCircleBox(), getCenterOffsets(), getCircleBox() and getCenterOfView(), but the resullt values are zero or very small. And in this coordinates put another piechart.

Or what do I own to do? For to have 2 piechart one inside the other.

abbasalid commented 6 years ago

Hi I have done something like this but I don't know how to link these two charts if you could help?

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.github.mikephil.charting.charts.PieChart
                    android:id="@+id/piechart"
                    android:layout_width="300dp"
                    android:layout_height="300dp"
                    android:layout_centerInParent="true" />

                <LinearLayout
                    android:layout_width="240dp"
                    android:layout_height="240dp"
                    android:layout_centerInParent="true">

                    <com.github.mikephil.charting.charts.PieChart
                        android:id="@+id/piechart1"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent" />

                </LinearLayout>

            </RelativeLayout>