GithubHelp home page GithubHelp logo

chartengine's Introduction

ChartEngine

##Android 图表库。当前支持一下几种类型图表:

  • 点状图表
  • 折线图表
  • 柱状图表
  • 饼图
  • 支持通过拓展基类增加其他图表类型···

##当前支持以下特性: *通过设置Renderer类属性自定义图表样式,包括字体大小、颜色,线条颜色、大小等 *通过设置Renderer打开/关闭显示动画

基本示例截图如下所示:
*点状图表

*折线图表

*柱状图表

*饼图

使用方法:

  • 获取点状图表
ChartView chartView = ChartFactory.getPointChartView(this,generateSeries(),generatePointRenderer());
private LineChartSeries generateSeries() {
    String[] xLabels = new String[]{"1","2","3","4","5","6","7","8","9","10","11","12"};
    String[] yLabels = new String[]{"0","10","20","30","40","50","60","70","80","90","100"};
    int[] xValues = new int[]{1,2,3,4,5,6,7,8,9,10,11,12};
    int[] yValues = new int[]{12,34,56,34,23,11,6,10,25,0,77,100};
    LineChartSeries series = new LineChartSeries(xValues, yValues, xLabels, yLabels,0,12,0,100);
    return series;
}    
private PointChartRenderer generatePointRenderer() {
    PointChartRenderer render = new PointChartRenderer(getApplicationContext());
    render.setApplyBgColor(true);
    render.setmBgColor(Color.BLACK);
    render.setmTitle("我是标题");

    render.setmXTitle("我是x轴");
    render.setmYTitle("我是y轴");

    render.setmLegendHeight(SystemUtil.dip2px(this, 90));

    return render;
}
  • 获取其他类型图表View方法类似,可参考ChartActivity中相关用法。

chartengine's People

Contributors

vincent85 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.