Diego Quintana
Diego Quintana

Reputation: 21

Show multiple MPandroidChart in a RecycledView

i'm starting to use MPandroidChart and for my is awesome, I'm already developing 2 examples and works fine, but in need implement a specific solution and I don´t know if is feasible to do. Basically, I have a screen with 2 fragments, on the left, I have a list, on de right i have a details view that I show when I select an list's item. I need to show 4 or 5 diferent charts, from diferent sources like a grid. For example, using a recycledView as a grid I will show two pieChart and 3 barChart. I know, as a the example show me, i can use a listview with chart, ok, but, can I use a RecycledView with MPandroidChar to show multiple charts? I hope this question be understandable and sorry for my mistakes writing english.

Kind Regards

Upvotes: 0

Views: 1885

Answers (1)

Diego Quintana
Diego Quintana

Reputation: 21

thanks for the answersat the end I realized how to use graphics with CardView and is very easy, Definis the card and put him in control. that's it

                <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
                    android:id="@+id/Prueba3"
                    android:layout_width="match_parent"
                    android:layout_height="0px"
                    android:layout_gravity="center"
                    android:layout_marginBottom="5dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_weight="4"
                    card_view:cardBackgroundColor="#FFFFFF"
                    card_view:cardCornerRadius="4dp">

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

                </android.support.v7.widget.CardView>

Upvotes: 2

Related Questions