hellocharts-android开源图表库(效果非常好)
来源:互联网 发布:windows热键设置 编辑:程序博客网 时间:2024/06/06 12:58
摘要 之前我们介绍了一个非常优秀开源图表库MPAndroidChart,但是我们今天介绍的将是一个更为优秀的图表库,比MPAndroidChart性能更好,功能更完善,UI风格更美观,坐标轴更精细。 他就是github上出现的新项目 HelloCharts 。 HelloCharts支持以下chart类型 : Li
之前我们介绍了一个非常优秀开源图表库 MPAndroidChart ,但是我们今天介绍的将是一个更为优秀的图表库,比MPAndroidChart性能更好,功能更完善,UI风格更美观,坐标轴更精细。
他就是github上出现的新项目HelloCharts。
HelloCharts支持以下chart类型:
Line chart(cubic lines, filled lines, scattered points)
Column chart(grouped, stacked, negative values)
Pie chart
Bubble chart
Combo chart(columns/lines)
Preview charts(for column chart and line chart)
此外还具有以下特点:
支持缩放、滑动以及平移。Zoom(pinch to zoom, double tap zoom), scroll and fling
支持自定义坐标轴(比如坐标轴位置:上下左右内部),支持自动生成坐标轴。Custom and auto-generated axes(top, bottom, left, right, inside)
动画(Animations)
支持预览,即在chart下面会有一个坐标密度更细的附属chart,当选中附属chart的某一区域,附属chart上面的chart会显示选中区域的更详细情况。
下面是一些效果截图:
我能用妙趣横生来形容吗、、
编译以及使用方法
需要使用android 5.0的sdk编译且需要导入appcompat v21兼容包。
每一种chart都可以在xml中定义:
<lecho.lib.hellocharts.view.LineChartView
android:id=
"@+id/chart"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
当然也可以在java代码中直接创建:
LineChartView chart =
new
LineChartView(context);
layout.addView(chart);
可以通过一些公共方法设置其行为属性,下面是一些例子:
Chart.setInteractive(boolean isInteractive);
Chart.setZoomType(ZoomType zoomType);
Chart.setContainerScrollEnabled(boolean isEnabled, ContainerScrollType type);
或者是用数据模型定义一些显示的方式:
ChartData.setAxisXBottom(Axis axisX);
ColumnChartData.setStacked(boolean isStacked);
Line.setStrokeWidth(int strokeWidthDp);
每一种chart都有自己的数据模型以及设置数据的方法,下面以LineChart为例:
List<PointValue> values =
new
ArrayList<PointValue>();
values.add(
new
PointValue(0, 2));
values.add(
new
PointValue(1, 4));
values.add(
new
PointValue(2, 3));
values.add(
new
PointValue(3, 4));
//In most cased you can call data model methods in builder-pattern-like manner.
Line line =
new
Line(values).setColor(Color.Blue).setCubic(
true
);
List<Line> lines =
new
ArrayList<Line>();
lines.add(line);
LineChartData data =
new
LineChartData();
data.setLines(lines);
LineChartView chart =
new
LineChartView(context);
chart.setLineChartData(data);
代码下载地址
http://jcodecraeer.com/a/opensource/2014/1107/1931.html
- hellocharts-android开源图表库(效果非常好)
- hellocharts-android开源图表库(效果非常好)
- hellocharts-android开源图表库(效果非常好)
- hellocharts-android开源图表库(效果非常好)
- hellocharts-android开源图表库(效果非常好)
- Android开源图表库:HelloCharts
- HelloCharts开源图表库(一)之折线图
- Android开源图表控件hellocharts-android简单使用
- 关于开源图表hellocharts-android的一些使用心得
- hellocharts-android图表库之饼状图:PieChartView
- hellocharts-android图表库之柱状图:ColunmChartView
- hellocharts-android图表库使用详解
- 使用HelloCharts开源图表库制作柱状图
- android开源图表框架HelloChart的使用 (hellocharts-library-1.5.8.jar)
- Android 图表开源框架HelloCharts 之 柱状图、折线图、饼状图,Fragment
- HelloCharts优秀的图表库
- HelloCharts图表库之柱状图
- HelloCharts图表库之饼状图
- 结构体——用结构体完成比较计数
- jsoncpp在vs2013下的安装
- 产品名称:iWX JAVA微信管理平台源码-微友1314
- firebug--console
- java各种时间处理
- hellocharts-android开源图表库(效果非常好)
- android-----notifyDataSetInvalidated()和notifyDataSetChanged()有什么区别
- Mysql 查询缓存
- (window)Android Studio安装以及Fetching android sdk component information超时的解决方案
- 第十六周 复习 问题 B: 按要求输出
- 数据结构c++ 随堂笔记4
- jsoncpp 扩展
- MQ直连 并通过线程池ExecutorService发送消息
- iOS疯狂详解之Svn基本命令