1 简介
MPAndroidChart是基于Android平台的一个比较强大图表库,具有丰富的图表类型。
GitHub项目地址:https://github.com/PhilJay/MPAndroidChart
API文档地址:https://jitpack.io/com/github/PhilJay/MPAndroidChart/v3.0.2/javadoc/
MPAndroidChart3使用详解二:图表控件抽象基类Chart
MPAndroidChart3使用详解三:LineChar(折线图)
MPAndroidChart3使用详解四:BarChart(柱形图)
MPAndroidChart3使用详解五:PieChart(饼状图)
MPAndroidChart3使用详解六:Legend(图例)
2 使用
1. Gradle dependency (recommended)
- Add the following to your project level
build.gradle:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}- Add this to your app
build.gradle:
dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}2. Maven
- Add the following to the
<repositories>section of yourpom.xml:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>- Add the following to the
<dependencies>section of yourpom.xml:
<dependency>
<groupId>com.github.PhilJay</groupId>
<artifactId>MPAndroidChart</artifactId>
<version>v3.0.3</version>
</dependency>3. clone whole repository (not recommended)