Skip to content

Idtk/PieChart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CustomView

此项目已合并至SmallChart

Introduction

    可定义环形块颜色与名称,显示数据百分比的环形图。用户可自定义动画效果,内外圆半径比,百分比小数位,画笔颜色,字体大小等。

Version

SdkVersion >= 19

Usage

  • 新建Pieview
PieView mPieView = new PieView(this);

or

<com.example.administrator.customviewdeom.PieChart.PieChart
        android:id="@+id/pieChart"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:textSize="20dp"
        app:name="Demo"/>
        
PieChart pieChart = (PieChart) findViewById(R.id.pieChart);
  • 设置初始角度
mPieView.setStartAngle(0);
  • 设置数据
mPieView.setPieData(mPieDatas);
//初始化mPieView
private void initData(){
        for (int i=0; i<9; i++){
            PieData pieData = new PieData();
            pieData.setName("区域名);
            pieData.setValue(i+1);
            pieData.setColor(mColors[i]);
            Log.i("colorOld",Integer.toHexString(mColors[i]));
            mPieDatas.add(pieData);
        }
    }

More

  • PieView更多设置请查看源码

Demo

PieChart


About

  博客: www.idtkm.com
  GitHub: https://github.com/Idtk
  微博: http://weibo.com/Idtk
  邮箱: [email protected]

About

百分比环形图

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages