Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PhilJay/MPAndroidChart-Realm

Open more actions menu

Repository files navigation

Twitter Twitter Android Arsenal Release API

alt tag

This repository contains all Realm.io related features of the MPAndroidChart library based on Realm v4.2.0 release.

Getting Started

  • To use this library, add the following to your project level build.gradle:
allprojects {
	repositories {
		maven { url "https://jitpack.io" }
	}
}
  • Add this to your app build.gradle:
dependencies {
	implementation 'com.github.PhilJay:MPAndroidChart-Realm:v3.0.3@aar'
	implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}

The MPAndroidChart-Realm dependency does not include the latest MPAndroidChart release, so you have to add the dependency to MPAndroidChart as well (as shown above). You also have to add the Realm.io dependency.

Sample

Using MPAndroidChart with Realm.io is easier than you think.

// get realm instance
Realm realm = Realm.getDefaultInstance();

// load your data from Realm.io database
RealmResults<YourData> results = realm.where(YourData.class).findAll();

// create a DataSet and specify fields, MPAndroidChart-Realm does the rest
RealmBarDataSet<YourData> dataSet = new RealmBarDataSet<YourData>(results, "xValue", "yValue");

// create a data object with the dataset 
BarData data = new BarData(dataSet);
chart.setData(data);
chart.invalidate(); // refresh

Tutorial

Here, you can find a full guide on how to plot data from Realm.io database with MPAndroidChart from scratch.

About

http://realm.io related features of the MPAndroidChart library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.