Charts / Graphs library for android
Free chart / graph library for
Github link:- https://github.com/lecho/hellocharts-android
dependencies{
compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
}
Every chart view can be defined in layout xml file:
<lecho.lib.hellocharts.view.LineChartView
android:id="@+id/chart"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Programatically creating graph view
LineChartView chart = new LineChartView(context);
layout.addView(chart);
Use methods from *Chart classes to define chart behaviour, example methods:
Chart.setInteractive(boolean isInteractive);
Chart.setZoomType(ZoomType zoomType);
Chart.setContainerScrollEnabled(boolean isEnabled, ContainerScrollType type);
Use methods from data models to define how chart looks like, example methods:
ChartData.setAxisXBottom(Axis axisX);
ColumnChartData.setStacked(boolean isStacked);
Line.setStrokeWidth(int strokeWidthDp);
Every chart has its own method to set chart data and its own data model, example for line chart:
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);
Library Details:
- Github link:- https://github.com/lecho/hellocharts-android
minSDK : 8- API 14+ Recommended
- Library version: 1.5.8
License : Apache 2.0
NB:- Verify codes with GitHub current version before using in live projects.
Keywords:
android graph, android chart, android pie chart, line graph, bar graph, histogram, android graph library, android chart library, android pie chart library, android histogram library, including