添加 maven { url "https://jitpack.io" }

  • 旧版本在 project 的 build.gradle 中增加:
    allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
    }
  • 新版本在 project 的 settings.gradle 中增加:
    dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
        jcenter() // Warning: this repository is going to shut down soon
    }
    }

添加 implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

在 app 中的 build.gradle 中增加: implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'

在 xml 中增加:

<com.github.mikephil.charting.charts.LineChart
    android:id="@+id/mvDetailLineChart"
    android:layout_width="match_parent"
    android:layout_height="@dimen/dp200"/>

参考:

https://blog.csdn.net/briblue/article/details/77305697
https://blog.csdn.net/jinmie0193/article/details/90239935
https://www.cnblogs.com/leshen/p/12606161.html
MPAndroidChart个人使用总结(一)
https://www.jianshu.com/p/9746e2dd2fbe
MPAndroid 中文文档(转)
https://www.jianshu.com/p/fc31df1e8679
笑谈Android图表-MPAndroidChart
https://www.imooc.com/article/71442

标签: android_studio, application

添加新评论