Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

hellocharts-android

> 编程语言
Open source

Charts library for Android compatible with API 8+, several chart types with scaling, scrolling and animations

7.6K stars0 likes3 views
WebsiteGitHub

About

Charts library for Android compatible with API 8+, several chart types with scaling, scrolling and animations

HelloCharts for Android

Charting library for Android compatible with API 8+(Android 2.2). Works best when hardware acceleration is available, so API 14+(Android 4.0) is recommended. Apache License 2.0.

## Features
  • 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

Screens and Demos

  • Code of a demo application is in hellocharts-samples directory, requires appcompat v21.
  • The demo app is also ready for download on Google Play.
  • Short video is available on YouTube.

Download and Import

Android Studio/Gradle

  • Maven Central/jCenter, add dependency to your build.gradle:
groovy
dependencies{
		compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
}
  • JitPack.io, add jitpack.io repositiory and dependency to your build.gradle:
groovy
   repositories {
       maven {
           url "https://jitpack.io"
       }
   }

   dependencies {
       compile 'com.github.lecho:hellocharts-android:v1.5.8'
   }

Eclipse/ADT

  • Download the latest release jar file.
  • Copy hellocharts-library-<version>.jar into the libs folder of your application project.

Usage

Every chart view can be defined in layout xml file:

xml
   <lecho.lib.hellocharts.view.LineChartView
       android:id="@+id/chart"
       android:layout_width="match_parent"
       android:layout_height="match_parent" />

or created in code and added to layout later:

java
   LineChartView chart = new LineChartView(context);
   layout.addView(chart);

Use methods from *Chart classes to define chart behaviour, example methods:

java
   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:

java
   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:

…

After the chart data has been set you can still modify its attributes but right after that you should call set*ChartData() method again to let chart recalculate and redraw data. There is also an option to use copy constructor for deep copy of chart data. You can safely modify copy in other threads and pass it to set*ChartData() method later.

Contributing

Yes:) If you found a bug, have an idea how to improve library or have a question, please create new issue or comment existing one. If you would like to contribute code fork the repository and send a pull request.

License

HelloCharts	
Copyright 2014 Leszek Wach

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

 HelloCharts library uses code from InteractiveChart sample available 
 on Android Developers page:
 
   http://developer.android.com/training/gestures/scale.html

Issues· 292 open

View all issuesOpen on GitHub
  • #540

    Hellocharts android library not rendering chart when there is a single value or when y axis values are same

    Updated Nov 2, 2024
  • #556

    垂直折线图

    Updated Oct 8, 2023
  • #555

    LineChartView can not make steps of 0.5f

    Updated May 9, 2023
  • #554

    library configuration

    Updated Jun 19, 2022
  • #552

    Unsupported Modules Detected

    Updated Oct 19, 2021
  • #228

    How to set a integer Y axis values?

    Updated Sep 25, 2021
  • #378

    Float value not displaying

    Updated Aug 11, 2021
  • #551

    About the problem that the y-axis is not displayed.

    Updated Aug 10, 2021
  • #550

    关于一个点问题(已解决)

    Updated Jun 12, 2021
  • #548

    Horizontal spacing between points

    Updated Apr 5, 2021

> Tags

Javaandroidchart

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言