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 Nov 6, 2015 · 4 revisions

The FillFormatter interface allows to customize where the filled line of a LineDataSet should end. All that needs to be done is create a new class and implement the FillFormatter interface. Use the

public float getFillLinePosition(LineDataSet dataSet, LineDataProvider provider)

method of the interface for implementing a custom logic that calculates the ending point of the fill line for the individual LineDataSet.

Creating a class the implements the interface:

public class MyCustomFillFormatter implements FillFormatter {

    @Override
    public float getFillLinePosition(LineDataSet dataSet, LineDataProvider dataProvider) {

        float myDesiredFillPosition = ...;
        // put your logic here...

        return myDesiredFillPosition;
    }
}

And then set the custom-formatter to your LineDataSet:

lineDataSet.setFillFormatter(new MyCustomFillFormatter());

Here is the default implementation (logic) of the DefaultFillFormatter.

Clone this wiki locally

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