An android compose library with different Graphs and Charts

Overview

plot

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

Line Graph 1

Line Graph 1  Line Graph 2  Line Graph 3  Line Graph 4

Download

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.github.madrapps:plot:0.1.1'
}

Features

  • Full customization of the various parts of the graph (like the point, line between the points, highlight when selected, the values in x-axis and y-axis, etc...)
  • Supports scrolling, zooming and touch drag selection

Usage

Just add the LineGraph composable and pass it a LinePlot with all your configuration and customisation. Please take a look at the sample app to see the various customisations available. Almost every aspect of the graph is customisable. You can even override the default draw implementations and can draw a Rectangle instead of a Circle, etc. The below code renders the Orange graph that you see in the above screenshots.

@Composable
fun SampleLineGraph(lines: List<List<DataPoint>>) {
    LineGraph(
        plot = LinePlot(
            listOf(
                LinePlot.Line(
                    lines[0],
                    LinePlot.Connection(color = Red300),
                    LinePlot.Intersection(color = Red500),
                    LinePlot.Highlight(color = Yellow700),
                )
            ),
            grid = LinePlot.Grid(Red100, steps = 4),
        ),
        modifier = Modifier.fillMaxWidth().height(200.dp),
        onSelection = { xLine, points ->
            // Do whatever you want here
        }
    )
}

License

plot by Madrapps is licensed under the Apache License 2.0.

Comments
  • Build file does not have the maven publishing code

    Build file does not have the maven publishing code

    The build.gradle.kts file contains the code for creating a nexus repository. BUt where is the code which enables the publish plugin to actually publish the artifact??

    opened by Chinmay-Kalmane 1
  • Add option to round / scale YAxis intervals to

    Add option to round / scale YAxis intervals to "nice numbers"

    Add option to round YAxis intervals / ticks to nice numbers, i.e. 1,2,5 and all power-of-ten multiples of these numbers, like in this stackoverflow thread.

    Standard intervals: Chart_1

    Nice number intervals: Chart_2

    opened by jns-codeworks 1
  • LineWidth is not synchronized to XAxisWidth

    LineWidth is not synchronized to XAxisWidth

    It seems like XAxis.stepSize is not synchronized to the xOffset between DataPoints. Changing stepSize only has effect on XAxis, not on Line

        val ethereumOneWeek = listOf(
            DataPoint(1f, 2938.67f),
            DataPoint(2f, 2971.3f),
            DataPoint(3f, 2887.21f),
            DataPoint(4f, 2704.42f),
            DataPoint(5f, 2646.03f),
            DataPoint(6f, 2637.95f),
            DataPoint(7f, 2548.08f),
        )
    
        LineGraph(
            plot = LinePlot(
                grid = LinePlot.Grid(Color.White.copy(alpha = 0.12f)),
                lines = listOf(
                    element = LinePlot.Line(
                        dataPoints = ethereumOneWeek,
                        connection = LinePlot.Connection(color, 2.dp),
                        intersection = null,
                    ),
                ),
                xAxis = LinePlot.XAxis(
                    steps = 7,
                    stepSize = 40.dp,
                ),
            ),
            modifier = Modifier
                .fillMaxWidth()
                .height(200.dp)
        )
    

    chart

    opened by jns-codeworks 0
  • Add graph background color argument

    Add graph background color argument

    The background color for the canvas is hard coded to MaterialTheme.colors.surface

    Just add an optional argument to the LineGraph composable for the graph background color, then set the bgColor variable in the composable to be equal to this argument. You can default it to the surface color if you wish and make it optional.

    opened by daniel-eh 2
  • data reduction (Douglas Peucker)

    data reduction (Douglas Peucker)

    I am currently using MPAndroidChart, but this library seems much more practical for my needs and do plan on switching over to it

    However, the biggest downfall of what I'm currently using is the lack of data reduction. Which makes the chart look very weird when you have tens of thousands of points on a device as small as a phone.

    is there such a feature with this library or could one be added?

    question 
    opened by TheRedSpy15 2
Releases(0.1.1)
Owner
Madrapps
Madrapps
Android library for drawing Pie charts and Donut charts with the ability to customize almost anything in it.

A Pie/Donut*/Ring chart for Android, customizable to the most extent possible. For tutorial and examples refer to the website. build.gradle[.kts] impl

Mahdi Hosseinzadeh 20 Nov 18, 2022
Android Graph Library for creating zoomable and scrollable line and bar graphs.

Chart and Graph Library for Android Project maintainer wanted! For time reasons I can not continue to maintain GraphView. Contact me if you are intere

Jonas Gehring 2.7k Jan 5, 2023
Android Graph Library for creating zoomable and scrollable line and bar graphs.

Chart and Graph Library for Android Project maintainer wanted! For time reasons I can not continue to maintain GraphView. Contact me if you are intere

Jonas Gehring 2.7k Jan 2, 2023
Android Tableau library supports variety of graphs which developers simply integrate visualization reports on Android application.

Android Tableau Library Android Tableau library supports variety of graphs which developers simply integrate visualization reports on Android applicat

Sung Hyun 54 Jan 1, 2023
An open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use

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

Mahmoud Ibrahim 17 Dec 31, 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
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
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
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

Diogo Bernardino 4.9k Dec 30, 2022
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

Diogo Bernardino 4.8k Dec 22, 2021
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
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

ByungKwan Yun 10 Jun 19, 2022
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 {

Ayush Saini 4 Dec 30, 2022
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

Futured 509 Jan 3, 2023
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

StrAIberry 30 Dec 30, 2022
TChart - Simple and fast charts.

TChart - Simple and fast charts.

null 30 Sep 20, 2022