Giter Club home page Giter Club logo

lcharts-android's Introduction

LCharts

综合了几种常用图表的绘制,目前支持饼状图,柱状图,雷达图,折线图。之后会慢慢更新,支持更多图表。 -图表

导入:

  implementation 'com.lixs.charts:charts:1.0.7'

也可以下载代码进行依赖

简单使用:


           <com.lixs.charts.PieChartView
               android:id="@+id/pieView"
               android:layout_width="300dp"
               android:layout_height="300dp"
               app:circleStrokeWidth='2dp'
               app:backColor="#ffd9d9d9"/>

           <com.lixs.charts.BarChart.LBarChartView
               android:id="@+id/frameNewBase"
               android:layout_width="350dp"
               android:layout_height="300dp"
               app:barShowNumber="6"
               app:borderColor="@color/colorAccent"
               app:bottomTextSpace="20dp"
               app:dataTextColor="@color/colorPrimaryDark"
               app:dataTextSize="12sp"
               app:descriptionTextColor="@color/colorPrimary"
               app:descriptionTextSize="20sp"
               app:isClickAnimation="true"
               app:labelTextColor="@color/colorPrimary"
               app:labelTextSize="10sp"
               app:leftTextSpace="30dp"
               app:title="柱状图实例"
               app:titleTextColor="@color/colorPrimaryDark"
               app:titleTextSize="20sp"
               app:topTextSpace="50dp" />

           <com.lixs.charts.RadarChartView
               android:id="@+id/radarView"
               android:layout_width="300dp"
               android:layout_height="300dp"
               app:itemTextColor="@color/colorAccent"
               app:itemTextSize="16dp"
               app:dataBackColor="@color/t_blue"
               app:polygonNumber="8"
               app:classNumber="3"/>

           <com.lixs.charts.LineChartView
               android:id="@+id/lineView"
               android:layout_width="350dp"
               android:layout_height="300dp"
               app:labelTextSize="10dp"
               app:title="折线图示例1"
               app:titleTextSize="20dp" />

   private void initRadarDatas() {
       List<Float> datas = new ArrayList<>();
       List<String> description = new ArrayList<>();

       datas.add(0.5f);
       datas.add(0.3f);
       datas.add(0.3f);
       datas.add(0.8f);
       datas.add(1f);
       datas.add(0.4f);

       description.add("one");
       description.add("two");
       description.add("three");
       description.add("four");
       description.add("five");
       description.add("six");

       //点击动画开启
       radarChartView.setCanClickAnimation(true);
       radarChartView.setDatas(datas);
       radarChartView.setPolygonNumbers(6);
       radarChartView.setDescriptions(description);
   }

柱状图

属性

attrs decription
barShowNumber 显示的数目
borderColor 边框颜色
bottomTextSpace 底部距离
dataTextColor 柱子上边的字体颜色
dataTextSize 柱子上边字体大小
descriptionTextColor 描述文字颜色
descriptionTextSize 描述文字大小
isClickAnimation 是否点击动画
labelTextColor 左边栏文字颜色
labelTextSize 左边栏字体大小
leftTextSpace 左边距离
topTextSpace 顶部距离
title 柱状图标题
titleTextColor 标题文字颜色
titleTextSize 标题文字大小
因为工作原因,这个项目停了很长时间。最近有同学在使用学习,故又重新优化代码和效果。新建技术讨论QQ群:776344631

lcharts-android's People

Contributors

teddyisme avatar

Watchers

 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.