Giter Club home page Giter Club logo

piechartview's Introduction

PieChartView

####饼状图图形报表控件,可自行设定多种参数

alt text

##使用方法,将PieChartView类和attr_pie_chart_view.xml文件直接拷贝到工程下,然后直接在xml布局中使用既可

      <com.dahanis.piechart.PieChartView
              android:id="@+id/pie_chart"
              android:layout_width="match_parent"
              android:layout_height="400dp"
              android:background="#ccc"
              android:paddingBottom="40dp"
              android:paddingLeft="20dp"
              app:circleRadius="100dp"
              app:textSize="13sp" />
  • circleRadius:饼状图的半径
  • textSize:指示文字的大小

##java类中的使用

        PieChartView pieChartView = (PieChartView) findViewById(R.id.pie_chart);

        List<PieChartView.PieceDataHolder> pieceDataHolders = new ArrayList<>();

        pieceDataHolders.add(new PieChartView.PieceDataHolder(100,0xFF77CCAA, "今天,1"));
        pieceDataHolders.add(new PieChartView.PieceDataHolder(1000, 0xFF11AA33, "明天,2"));
        pieceDataHolders.add(new PieChartView.PieceDataHolder(1200, Color.GRAY, "就是风,3"));
        pieceDataHolders.add(new PieChartView.PieceDataHolder(5000, Color.YELLOW, "呵呵,4"));
        pieceDataHolders.add(new PieChartView.PieceDataHolder(10000, Color.RED, "小京,5"));
        pieceDataHolders.add(new PieChartView.PieceDataHolder(13000, Color.BLUE, "花花,6"));

        pieChartView.setData(pieceDataHolders);

piechartview's People

Contributors

wuseal avatar

Watchers

James Cloos avatar Andy 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.