label mpchart 饼图_MPAndroidChart饼图用法系列一

本文介绍了如何使用MPAndroidChart库在Android中创建饼图,包括添加依赖、XML布局、Java代码设置饼图样式和数据,以及交互功能的实现。通过实例展示了饼图的各种配置选项,如设置百分比、颜色、标签等。
摘要由CSDN通过智能技术生成

一、效果展示:

01.png

02.png

03.png

二、用法:

1、配置仓库:工程路径下面的build.gradle文件中引入 maven { url "https://jitpack.io" }

04.png

2、 引入jar包:

compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'

3、XML中使用饼图控件

05.png

4、

package com.cd.mobile.demochart;

import android.graphics.Color;

import android.graphics.Typeface;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.text.SpannableString;

import android.text.style.ForegroundColorSpan;

import android.text.style.RelativeSizeSpan;

import android.text.style.StyleSpan;

import com.github.mikephil.charting.animation.Easing;

import com.github.mikephil.charting.charts.PieChart;

import com.github.mikephil.charting.components.Legend;

import com.github.mikephil.charting.data.Entry;

import com.github.mikephil.charting.da

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值