Git Product home page Git Product logo

cakeview's Introduction

cakeview

带动画的饼图

github github github

详细说明参见:

http://www.eoeandroid.com/thread-540249-2-1.html

使用方法

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
cakeSurfaceView = (CakeSurfaceView) findViewById(R.id.cakeSurfaceView1);
List<CakeSurfaceView.CakeValue> cakeValues2 = new ArrayList<CakeSurfaceView.CakeValue>();
cakeValues2.add(new CakeSurfaceView.CakeValue("猫猫猫", 12f,"详细信息"));
cakeValues2.add(new CakeSurfaceView.CakeValue("狗狗狗", 0f,"详细信息自动换行"));
cakeValues2.add(new CakeSurfaceView.CakeValue("acorn", 24f,"橡果"));
cakeValues2.add(new CakeSurfaceView.CakeValue("人人人", 0f));
cakeValues2.add(new CakeSurfaceView.CakeValue("瓜皮", 0f));
cakeValues2.add(new CakeSurfaceView.CakeValue("鸭嘴兽", 1f));
cakeSurfaceView.setData(cakeValues2);
//设置饼图信息的显示位置(目前只有bottom模式支持点击动画)
cakeSurfaceView.setGravity(Gravity.bottom);
//设置饼图信息与饼图的间隔(dp)
cakeSurfaceView.setDetailTopSpacing(15);
//设置饼图的每一项的点击事件
cakeSurfaceView.setOnItemClickListener(new OnItemClickListener() {


@Override
public void onItemClick(int position) {
Toast.makeText(MainActivity.this, "点击:" + position, 0).show();
}
});
}

cakeview's People

Contributors

oneacorn avatar

Watchers

James Cloos avatar carrot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.