Giter Site home page Giter Site logo

android-compose-charts's Introduction

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.0.0'

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


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

android-compose-charts's People

Contributors

mahmoudibrahim3 avatar myfatoorahgcc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.