Straiberry Charts - An awesome Chart library for android

Overview

License


Straiberry

Straiberry Charts

An awesome Chart library for android
Straiberry · Report Bug · Request Feature

Getting Started

Adding dependecies

  1. Add it in your root build.gradle at the end of repositories:
	allprojects {
  	repositories {
  		...
  		maven { url 'https://jitpack.io' }
  	}
  }
  1. Add the dependency
	dependencies {
          implementation 'com.github.STRAIBERRY-AI-INC:Straiberry-charts:1.1.0'
  }

How it's work

There is four type of chart in this library:

  1. Horizontal Bar Chart

Horizontal Bar Chart

">
  <com.straiberry.android.charts.view.HorizontalBarChartView
            android:id="@+id/horizontalBarChartViewBrushingDigit"
            style="@style/HorizontalChart"
            android:layout_width="310dp"
            android:layout_height="170dp"
            android:layout_marginBottom="10dp"
            android:clickable="false"
            android:focusable="false"
            app:chart_barsColorsList="@array/BrushingChartFilterColor"
            app:chart_barsRadius="17dp"
            app:chart_grid="full"
            app:chart_horizontal_y_label_type="fromZeroToSeven" or "isCharacter"
            app:chart_labelsSize="8sp"
            app:chart_spacing="13dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

Setup input data:

    /** Setup data for horizontal chart */
    private fun setupHorizontalChart() {

        val data = horizontalChartData(
            this, HorizontalChartXLabels(
                ContextCompat.getDrawable(this, R.drawable.ic_user)!!, "user",
                ContextCompat.getDrawable(this, R.drawable.ic_user)!!, "user",
                ContextCompat.getDrawable(this, R.drawable.ic_age)!!, "age",
                ContextCompat.getDrawable(this, R.drawable.ic_gender)!!, "gender",
                ContextCompat.getDrawable(this, R.drawable.ic_location)!!, "location",
                ContextCompat.getDrawable(this, R.drawable.ic_master)!!, "master",
            ), listOf(6F, 7F, 2F, 7F, 7F, 5F)
        )
        binding.horizontalBarChartViewBrushingDigit.animate(data)
    }
  1. Bar Chart

Horizontal Bar Chart

">
 <com.straiberry.android.charts.view.BarChartView
            android:id="@+id/barChartViewBrushing"
            android:layout_width="300dp"
            android:layout_height="170dp"
            android:layout_marginBottom="10dp"
            android:clickable="false"
            android:focusable="false"
            app:chart_barsColorsList="@array/BrushingChartColor"
            app:chart_barsRadius="17dp"
            android:layout_marginTop="50dp"
            app:chart_grid="horizontal"
            app:chart_gridColorY="@color/gray400WithOpacity14"
            app:chart_labelsSize="8dp"
            app:chart_labelsXColor="@color/linkWithoutButton"
            app:chart_labelsYColor="@color/linkWithoutButton"
            app:chart_spacing="20dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/horizontalBarChartViewBrushingCharacter" />

Setup input data:

private fun setupBarChart() {
        val currentDate = Date()
        val calendar = Calendar.getInstance()
        calendar.time = currentDate
        val data: ArrayList<HashMap<String, Int?>> = arrayListOf()
        
        repeat(7){
            data.add(hashMapOf(Pair(calendar.time.convertCurrentDateToChartDate(LINE_CHART_DATE_FORMAT),it+1)))
            calendar.add(Calendar.DATE, -1)
        }
        
        binding.barChartViewBrushing.animate(data.toChartData())
    }
  1. Bar percent chart

Horizontal Bar Chart

">
<com.straiberry.android.charts.view.BarPercentChartView
            android:id="@+id/barPercentChartWhitening"
            style="@style/WhiteningChart"
            android:layout_width="match_parent"
            android:layout_height="140dp"
            android:layout_marginBottom="10dp"
            android:layout_marginTop="40dp"
            android:clickable="false"
            android:focusable="false"
            android:layoutDirection="ltr"
            app:chart_axis="x"
            app:chart_labelsSize="10sp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/linearChartViewOralHygiene" />

Setup input data:

private fun setupBarPercentChart() {
        // Prepare the tooltip to show on chart
        val pointTooltip = PointTooltip()
        pointTooltip.onCreateTooltip(binding.content)
        binding.barPercentChartWhitening.apply {
            tooltip = pointTooltip
            currentAverage = 20
            average = 50
            previousAverage = 30
            createBarPercent()
            disableTouchAndClick()
        }
    }
  1. Line chart

Horizontal Bar Chart

">
<com.straiberry.android.charts.view.LineChartView
            android:id="@+id/linearChartViewOralHygiene"
            style="@style/OralHygieneChart"
            android:layout_width="325dp"
            android:layout_height="230dp"
            android:layout_marginBottom="8dp"
            android:layoutDirection="ltr"
            android:layout_marginTop="40dp"
            app:chart_grid="vertical"
            app:chart_gridEffect="dashed"
            app:chart_gridStrokeWidth="1dp"
            app:chart_labelsSize="8sp"
            app:chart_labelsXColor="@color/linkWithoutButton"
            app:chart_labelsYColor="@color/linkWithoutButton"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/barChartViewBrushing" />

Setup input data: You can refer to sample for setting up the Line chart



Copyright 2022 Straiberry

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

An easy-to-use Android charts library with animation.
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

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

An android compose library with different Graphs and Charts
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

An open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use
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

Simple Line, Circle, Bar chart for Android
Simple Line, Circle, Bar chart for Android

SimpleChart Simple Line, Circle, Bar chart for Android LineChart com.aghajari.simplechart.LineChart android:id="@+id/line_chart" android:layo

Comments
  • Better documentation

    Better documentation

    1. It would have been better if you had provided better documentation for the elements variable used in the library.
    2. The bar chart only supports int value better if it had support for float as well.
    3. Best if provided some usability as well.

    Screenshot 2022-05-29 163732

    Screenshot 2022-05-29 163732

    opened by brishav 1
Releases(1.1.0)
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
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
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

Leszek Wach 7.4k Jan 6, 2023
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
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
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
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 Android chart and graph library

EazeGraph EazeGraph is an Android library for creating beautiful and fancy charts. Its main goal was to create a lighweight library which is easy to u

Paul Cech 1.6k Dec 23, 2022
A powerful 🚀 Android range bar chart library as well as scaling, panning and animations.

RangeBarChart ⚡ Range bar chart library for Android using MPAndroidChart ⚡ There were no charts in MPAndroidChart to show ranges. We were forced to sh

Ted Park 8 Nov 24, 2022
An Elementary Chart library for Jetpack Compose

Charty : Elementary Chart library for Compose Chart Library built using Jetpack Compose and is highly customizable. Updates coming soon! Made with ❤️

Himanshu Singh 491 Jan 9, 2023