An open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use

Overview

android-compose-charts

This is an open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use. Just couples of lines.

Usage:

  • Add this line to your project gradle file:

    maven { url 'https://jitpack.io' }
  • Add this dependency to your app gradle file:

    implementation 'com.github.MahmoudIbrahim3:android-compose-charts:'

1. Bar Chart:

val barChartData = listOf(
  BarChartEntity(150.0f, Color(0xFF618A32), "1"),
  BarChartEntity(450.0f, Color(0xFFC32A33), "2"),
  BarChartEntity(300.0f, Color.Blue, "3"),
  BarChartEntity(150.0f, Color.Cyan, "4"),
  BarChartEntity(500.0f, Color.Magenta, "5")
)

val verticalAxisValues = listOf(0.0f, 100.0f, 200.0f, 300.0f, 400.0f, 500.0f)

BarChart(
    barChartData = barChartData,
    verticalAxisValues = verticalAxisValues
)

The following code snippet demonstrates a lot of attributes to custom and design your Bar Chart as you like:

BarChart(
  barChartData = barChartData,
  verticalAxisValues = verticalAxisValues,
  axisColor = Color.Red,
  verticalAxisLabelColor = Color.Blue,
  verticalAxisLabelFontSize = 20.sp,
  horizontalAxisLabelColor = Color.Magenta,
  horizontalAxisLabelFontSize = 24.sp,
  paddingBetweenBars = 16.dp,
  isShowVerticalAxis = true,
  isShowHorizontalLines = false,
)

Bar Chart Samples:

1 2


2. Line Chart:

val lineChartData = listOf(
    LineChartEntity(150.0f, "A"),
    LineChartEntity(250.0f, "B"),
    LineChartEntity(50.0f, "C"),
    LineChartEntity(300.0f, "D"),
    LineChartEntity(400.0f, "E")
)

LineChart(
    lineChartData = lineChartData,
    verticalAxisValues = verticalAxisValues
)

Custom attributes:

LineChart(
    lineChartData = lineChartData2,
    verticalAxisValues = verticalAxisValues2,
    lineColor = Color.Red,
    strokeWidth = 6.dp,
    axisColor = Color(0xF0E47A8A),
    verticalAxisLabelColor = Color.Blue,
    verticalAxisLabelFontSize = 20.sp,
    horizontalAxisLabelColor = Color.Black,
    horizontalAxisLabelFontSize = 20.sp,
    isShowVerticalAxis = true,
    isShowHorizontalLines = true,
)

Line Chart Samples:

Default line chart

LineChart1

Custom line chart

LineChart2


Feel free to fork the repo and make any changes or suggestions you see and make a pull request.

Wait a lot of other types of charts using compose, coming soon Insha-Allah :)

You might also like...
Android Library to rapidly develop attractive and insightful charts in android applications.
Android Library to rapidly develop attractive and insightful charts in android applications.

williamchart Williamchart is an Android Library to rapidly implement attractive and insightful charts in android applications. Note: WilliamChart v3 h

Android Library to rapidly develop attractive and insightful charts in android applications.
Android Library to rapidly develop attractive and insightful charts in android applications.

williamchart Williamchart is an Android Library to rapidly implement attractive and insightful charts in android applications. Note: WilliamChart v3 h

Charts/graphs library for Android compatible with API 8+, several chart types with support for scaling, scrolling and animations
Charts/graphs library for Android compatible with API 8+, several chart types with support for 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 1

Android图表库(XCL-Charts is a free charting library for Android platform.),基于Android Canvas来绘制各种图表,使用简便,定制灵活。目前支持3D/非3D/背向式/横向/竖向柱形图(Bar Chart)、3D/非3D饼图(Pie Chart)、堆叠图(Stacked Bar Chart)、面积图(Area Chart)、 折线图(Line Chart)、曲线图(Spline Chart)、环形图(Dount Chart)、南丁格尔玫瑰图(Rose Chart)、仪表盘(Dial Chart)、刻度盘(Gauge Chart)、雷达图(Radar Chart)、漏斗图(Funnel Chart)、圆形图(Circle Chart)、弧线比较图、散点图(Scatter Chart)、气泡图(Bubble Chart)、范围条形图(RangeBar Chart)等图表。其它特性还包括支持图表缩放、手势移动、点击响应、动画效果、多轴显示、图表参考线、混合图表及同数据源不同图表类型切换等。 YBKChart is a library of 3D graphics charts for Android. 📊
YBKChart is a library of 3D graphics charts for Android. 📊

YBKChart is a library of 3D graphics charts for Android. 📊 For more information, see the Wiki. Chart List Pie Chart Download Use gradle. rep

Library for charts in android with animations
Library for charts in android with animations

Charts Gradle Setup Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories: allprojects {

Donut is an Android library which helps you to easily create beautiful doughnut-like charts.
Donut is an Android library which helps you to easily create beautiful doughnut-like charts.

Doughnut-like graph view capable of displaying multiple datasets with assignable colors

Straiberry Charts - An awesome Chart library for android
Straiberry Charts - An awesome Chart library for android

Straiberry Charts An awesome Chart library for android Straiberry · Report Bug · Request Feature Getting Started Adding dependecies Add it in your roo

Open-source native Android graph/chart framework includes line chart,stick chart,candlestick chart,pie chart,spider-web chart etc.
Open-source native Android graph/chart framework includes line chart,stick chart,candlestick chart,pie chart,spider-web chart etc.

Welcome to Android-Charts Welcome to Android-Charts project page on github.com. We just moved from Google Code. Android-Charts is an open-source andro

Releases(1.2.2)
Owner
Mahmoud Ibrahim
Mahmoud Ibrahim
Arc Chart View (Draw Creative Statistic Arc Charts)

ArcChartViewDemo You can use this library to draw Arc charts and show your statistics or anything you want or maybe get some ratings from user. you ca

Iman khoshabi 106 Nov 22, 2022
An easy-to-use Android charts library with animation.

AndroidCharts A simple Android charts library. Known Uses in Pomotodo Including in Your Project Eclipse Import /AndroidCharts folder. Move /java folde

HackPlan 1.3k Jan 2, 2023
Jetpack-linear-chart - A simple way to draw linear chart using Jetpack Compose

jetpack-linear-chart A simple way to draw linear chart using Jetpack Compose We

Bruno Gabriel dos Santos 8 Jan 4, 2023
Simple Jetpack Compose Charts for multi-platform. Including Android, Web, Desktop.

compose-charts Simple Jetpack Compose Charts for multi-platform. Including Android, Web, Desktop. Graph Effects How to use? 1, show Pie Chart in Jetpa

Chen Pan 112 Jan 8, 2023
Simple Compose Charts for multi-platform. Including Android, Web, Desktop.

compose-charts-desktop Simple Compose Charts for multi-platform. Including Android, Web, Desktop. Compose multiplatform for Android: compose-charts. G

Chen Pan 13 Dec 30, 2022
An android compose library with different Graphs and Charts

plot An android compose library with different Graphs and Charts (currently supports only Line graph, more types will be added soon) Download reposito

Madrapps 106 Dec 30, 2022
TChart - Simple and fast charts.

TChart - Simple and fast charts.

null 30 Sep 20, 2022
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Dec 31, 2022
AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.

AnyChart for Android AnyChart Android Charts is an amazing data visualization library for easily creating interactive charts in Android apps. It runs

AnyChart 2k Jan 4, 2023