• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Androguide/HoloGraphLibrary: Fork of the HoloGraphLibrary by Daniel Nadeau with ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Androguide/HoloGraphLibrary

开源软件地址(OpenSource Url):

https://github.com/Androguide/HoloGraphLibrary

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

HoloGraphLibrary

Fork of the HoloGraphLibrary by Daniel Nadeau, with additionnal features

Welcome

This is a library written to allow beautiful graphs and charts to be easily incorporated into your Android application. Included are:

  • LineGraph view
  • BarGraph view
  • PieGraph view
  • MultiSeriesDonutGraph view

LineGraph BarGraph PieGraph MultiSeriesDonutGraph

Usage

LineGraph View

<com.echo.holographlibrary.LineGraph
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:id="@+id/graph"/>
Line l = new Line();
LinePoint p = new LinePoint();
p.setX(0);
p.setY(5);
l.addPoint(p);
p = new LinePoint();
p.setX(8);
p.setY(8);
l.addPoint(p);
p = new LinePoint();
p.setX(10);
p.setY(4);
l.addPoint(p);
l.setColor(Color.parseColor("#FFBB33"));
		
LineGraph li = (LineGraph)findViewById(R.id.graph);
li.addLine(l);
li.setRangeY(0, 10);
li.setLineToFill(0);

BarGraph View

<com.echo.holographlibrary.BarGraph
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:id="@+id/graph"/>
ArrayList<Bar> points = new ArrayList<Bar>();
Bar d = new Bar();
d.setColor(Color.parseColor("#99CC00"));
d.setName("Test1");
d.setValue(10);
Bar d2 = new Bar();
d2.setColor(Color.parseColor("#FFBB33"));
d2.setName("Test2");
d2.setValue(20);
points.add(d);
points.add(d2);

BarGraph g = (BarGraph)findViewById(R.id.graph);
g.setBars(points);
g.setUnit("$");

PieGraph View

<com.echo.holographlibrary.PieGraph
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:id="@+id/graph"/>
PieGraph pg = (PieGraph)findViewById(R.id.graph);
PieSlice slice = new PieSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(2);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#FFBB33"));
slice.setValue(3);
pg.addSlice(slice);
slice = new PieSlice();
slice.setColor(Color.parseColor("#AA66CC"));
slice.setValue(8);
pg.addSlice(slice);

#MultiSeriesDonutGraph View

<com.echo.holographlibrary.MultiSeriesDonutGraph
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:id="@+id/graph"/>
MultiSeriesDonutGraph mg = (MultiSeriesDonutGraph) v.findViewById(R.id.multiseriesdonutgraph);

MultiSeriesDonutSlice slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(2);
mg.addSlice(0, slice);
slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#FFBB33"));
slice.setValue(3);
mg.addSlice(0, slice);
slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#AA66CC"));
slice.setValue(8);
mg.addSlice(0, slice);

slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#99CC00"));
slice.setValue(8);
mg.addSlice(1, slice);
slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#FFBB33"));
slice.setValue(5);
mg.addSlice(1, slice);
slice = new MultiSeriesDonutSlice();
slice.setColor(Color.parseColor("#AA66CC"));
slice.setValue(3);
mg.addSlice(1, slice);

Have fun!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap