A powerful ๐Ÿš€ Android range bar chart library as well as scaling, panning and animations.

Related tags

Charts RangeBarChart
Overview

RangeBarChart

โšก Range bar chart library for Android using MPAndroidChart โšก

  • There were no charts in MPAndroidChart to show ranges.
  • We were forced to show the range charts we wanted using a similarly capable candlestick chart.
  • This library can be used when you want to create charts that can represent ranges such as weather and heart rate.
Default Min/Max Draw Label


Demo



Setup

Gradle

Maven Central

repositories {
  google()
  mavenCentral()
  maven { url 'https://jitpack.io' } // For using MPAndroidChart
}

dependencies {
    implementation 'io.github.ParkSangGwon:range-bar-chart:x.y.z'
    //implementation 'io.github.ParkSangGwon:range-bar-chart:0.0.6'
}

If you think this library is useful, please press star button at upside.



How to use

  • The usage of this library is perfectly consistent with that of MPAndroidChart
  • Please read official document
  • A detailed explanation can be understood immediately by looking at the code of the sample project.

RangeBarEntry

  • min
  • max

Setup Chart

private fun RangeBarChart.setup() {
    setScaleEnabled(false)
    setDrawGridBackground(false)
    setBackgroundColor(Color.TRANSPARENT)
    description.isEnabled = false
    xAxis.apply {
        position = XAxis.XAxisPosition.BOTTOM
        setDrawGridLines(false)
    }
    axisLeft.apply {
        setDrawGridLines(false)
        axisMinimum = -20f
        axisMaximum = 40f
    }
    axisRight.isEnabled = false
    legend.isEnabled = false
    data = RangeBarData(createSet())
}

Create DataSet

RangeBarDataSet(null, "RangeBar").apply {
    color = Color.parseColor("#2BDD9E")
    barWidth = 0.4f
    isHighlightEnabled = true
    highLightColor = Color.CYAN
    minColor = Color.parseColor("#22BCFE")
    maxColor = Color.parseColor("#FC351E")
    setDrawValues(false)
    valueTextSize = 12f
    valueFormatter = object : ValueFormatter() {
        override fun getFormattedValue(value: Float): String = "${value.toInt()}ยฐC"
    }
}

Add your entries

private fun getWeatherEntries(): List<RangeBarEntry> {
    val values = mutableListOf<RangeBarEntry>()
    values.add(RangeBarEntry(1f, -7f, 1f))
    values.add(RangeBarEntry(2f, -4f, 4f))
    values.add(RangeBarEntry(3f, 2f, 11f))
    values.add(RangeBarEntry(4f, 8f, 18f))
    values.add(RangeBarEntry(5f, 14f, 23f))
    values.add(RangeBarEntry(6f, 19f, 26f))
    values.add(RangeBarEntry(7f, 23f, 28f))
    values.add(RangeBarEntry(8f, 25f, 33f))
    values.add(RangeBarEntry(9f, 17f, 25f))
    values.add(RangeBarEntry(10f, 10f, 18f))
    values.add(RangeBarEntry(11f, 3f, 11f))
    values.add(RangeBarEntry(12f, -3f, 4f))
    return values
}
private fun RangeBarChart.addData() {
    val data = data ?: return
    val rangeBarDataSet = data.getDataSetByIndex(0) ?: return
    val values = getWeatherEntries()
    rangeBarDataSet.values = values
    data.notifyDataChanged()
    notifyDataSetChanged()
}



Customize

RangeBarDataSet

variable Description
barWidth Adjust board width
minColor Min color int
maxColor Max color int

FAQ

Can I use BarChart's function/variable?

  • Yes, RangeBarChart is a class implemented by inheriting from BarChart.
  • So you can use all the features that BarChart uses.

How is it different from candlestick charts?

  • Candle charts must specify a starting and ending point as well as a minimum and maximum.
  • It is used for the purpose of using stock charts, not to display only the range we want.
  • RangeBarChart only shows the minimum and maximum ranges.



License

Copyright 2022 Ted Park

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...
ChartPOC - Chart POC-Android
ChartPOC - Chart POC-Android

ChartPOC Chart POC-Android Time Frame Bar Chart Component To use the component j

Arc Chart View (Draw Creative Statistic Arc Charts)
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

Android Graph Library for creating zoomable and scrollable line and bar graphs.
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

Android Graph Library for creating zoomable and scrollable line and bar graphs.
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

โœจ A very Minimal, Sleek and Powerful Graph library for Android using Jetpack Compose
โœจ A very Minimal, Sleek and Powerful Graph library for Android using Jetpack Compose

Composable-Graphs ( Jetpack Compose ) โœจ A very Minimal, Sleek and Lightweight Graph library for Android using Jetpack Compose Gradle Setup allprojects

A Powerful Android Charting Library by https://www.numetriclabz.com/
A Powerful Android Charting Library by https://www.numetriclabz.com/

numAndroidCharts A Powerful Android Charting Library by Numetric Technologies Features Core features: [Line Chart](#Line Chart) [Bar Chart](#Bar Chart

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 {

BubbleTabBar is bottom navigation bar with customizable bubble like tabs
BubbleTabBar is bottom navigation bar with customizable bubble like tabs

BubbleTabBar BubbleTabBar is bottom navigation bar with customizable bubble like tabs Download AIX : Download Aix License Licensed under the Apache Li

 PopupBarChart ๐Ÿ“Š can shows a tooltip when user click on the bar ๐Ÿ˜ ๐Ÿคฉ
PopupBarChart ๐Ÿ“Š can shows a tooltip when user click on the bar ๐Ÿ˜ ๐Ÿคฉ

PopupBarChart ๐Ÿ“Š can shows a tooltip when user click on the bar ๐Ÿ˜ ๐Ÿคฉ

Releases(0.0.6)
Owner
Ted Park
In South Korea. Android / Node.js / AWS Architecture
Ted Park
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
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

limc.cn 813 Dec 20, 2022
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
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
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 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

AmirHosseinAghajari 5 Jul 28, 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
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
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
A basic chart written by kotlin. Support animation loading, touch event monitoring and JSON data.

A basic chart written by kotlin. Support animation loading, touch event monitoring and JSON data.

null 2 Dec 21, 2022