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
Philipp Jahoda edited this page Feb 14, 2016 · 10 revisions

Since v2.2.0, MPAndroidChart allows you to easily create your own custom DataSet objects and use them in the charts.

What you need to do

  • Create your own custom class (e.g. CustomDataSet)
  • Let it extend BaseDataSet<? extends Entry>
  • Let it implement the IDataSet interface of your choice (e.g. IBarDataSet) - depending on the kind of chart you want to create
  • Implement all (by you) required methods and let them return your values of choice

Example

Creating a custom BarDataSet to be used in a BarChart.

public class CustomBarDataSet extends BaseDataSet<BarEntry> implements IBarDataSet {
    // implement all by the extended class and interface required methods
}

After creating the CustomBarDataSet and implementing all methods required by the interface it can be used in any BarChart just like a normal BarDataSet.

Clone this wiki locally

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