GithubHelp home page GithubHelp logo

lchart's Introduction

LChart

这是一个折线图框架,它提供了几个非常实用的功能,简单易用。

功能特色

  1. 支持缩放,拖拽
  2. 支持多条数据线
  3. 支持预览模式:预览图谱
  4. 支持点击数据点时的十字高亮与数值提示
  5. 支持高亮点的左右移动
  6. 支持添加预警线
  7. 支持实时数据的添加
  8. 有效的处理滑动冲突
  9. 折线展现上的动画效果

效果展示

基本使用

添加依赖

compile 'com.linheimx.library:lchart:1.2.6'

给LineChart添加数据

// step1: 设置x,y轴
XAxis xAxis = lineChart.get_XAxis();
xAxis.set_unit("单位:s");
xAxis.set_ValueAdapter(new DefaultValueAdapter(1));

YAxis yAxis = lineChart.get_YAxis();
yAxis.set_unit("单位:m");
yAxis.set_ValueAdapter(new DefaultValueAdapter(3));// 默认精度到小数点后2位,现在修改为3位精度

// step2: 为一条数据线添加数据
Line line = new Line();
List<Entry> list = new ArrayList<>();
list.add(new Entry(1, 5));
list.add(new Entry(2, 4));
list.add(new Entry(3, 2));
list.add(new Entry(4, 3));
list.add(new Entry(10, 8));
line.setEntries(list);

// step3: 将数据放到 lineChart上
Lines lines = new Lines();
lines.addLine(line);

lineChart.setLines(lines);

项目分析

博客地址:http://www.jianshu.com/p/d03ff80ad508

欢迎反馈问题,我会尽力来解决的,希望我们会做的更好 : )

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.