1.需要添加支持
- 在 Project 级的
build.gradle
文件中添加:
allprojects { repositories { maven { url "https://jitpack.io" } } }
- 在 app 的
build.gradle
文件中添加:
dependencies { compile 'com.github.PhilJay:MPAndroidChart:v3.0.0' }
2.在layoyt文件中引用
<com.github.mikephil.charting.charts.LineChart
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent" />