diff --git a/MPChartLib/src/main/java/com/github/mikephil/charting/formatter/PercentFormatter.java b/MPChartLib/src/main/java/com/github/mikephil/charting/formatter/PercentFormatter.java index 6bf1bd3c33..012fab77f9 100644 --- a/MPChartLib/src/main/java/com/github/mikephil/charting/formatter/PercentFormatter.java +++ b/MPChartLib/src/main/java/com/github/mikephil/charting/formatter/PercentFormatter.java @@ -7,7 +7,7 @@ /** * This IValueFormatter is just for convenience and simply puts a "%" sign after - * each value. (Recommeded for PieChart) + * each value. (Recommended for PieChart) * * @author Philipp Jahoda */ @@ -16,9 +16,11 @@ public class PercentFormatter extends ValueFormatter public DecimalFormat mFormat; private PieChart pieChart; + private boolean percentSignSeparated; public PercentFormatter() { mFormat = new DecimalFormat("###,###,##0.0"); + percentSignSeparated = true; } // Can be used to remove percent signs if the chart isn't in percent mode @@ -27,9 +29,15 @@ public PercentFormatter(PieChart pieChart) { this.pieChart = pieChart; } + // Can be used to remove percent signs if the chart isn't in percent mode + public PercentFormatter(PieChart pieChart, boolean percentSignSeparated) { + this(pieChart); + this.percentSignSeparated = percentSignSeparated; + } + @Override public String getFormattedValue(float value) { - return mFormat.format(value) + " %"; + return mFormat.format(value) + (percentSignSeparated ? " %" : "%"); } @Override diff --git a/README.md b/README.md index d358d90f17..044a84f9a6 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ All MPAndroidChart users are entitled to a special **discount of 5%** off the -## [Daily Coding Newsletter](https://philjay.substack.com/subscribe) +## [Bi-Weekly Coding Newsletter](https://weeklycoding.com) -Sign up for my [daily coding newsletter](https://philjay.substack.com/subscribe) to get quick updates on Kotlin and Android development related topics. +Sign up for my [coding newsletter](https://weeklycoding.com) to get quick updates on Kotlin and Android development related topics.

Quick Start :chart_with_upwards_trend:

@@ -78,7 +78,7 @@ dependencies {

Documentation :notebook_with_decorative_cover:

-See the [**documentation**](https://github.com/PhilJay/MPAndroidChart/wiki) for examples and general use of MPAndroidChart. +See the [**documentation**](https://weeklycoding.com/mpandroidchart/) for examples and general use of MPAndroidChart. See the [**javadocs**](https://jitpack.io/com/github/PhilJay/MPAndroidChart/v3.1.0/javadoc/) for more advanced documentation. @@ -96,7 +96,7 @@ Download the [MPAndroidChart Example App](https://play.google.com/store/apps/det This repository's issue tracker is only for bugs and feature requests. The maintainers ask that you refrain from asking questions about how to use MPAndroidChart through the issue tracker. -Please read the [**documentation**](https://github.com/PhilJay/MPAndroidChart/wiki) first, then ask all your questions on [stackoverflow.com](https://stackoverflow.com/questions/tagged/mpandroidchart) for the fastest answer. +Please read the [**documentation**](https://weeklycoding.com/mpandroidchart/) first, then ask all your questions on [stackoverflow.com](https://stackoverflow.com/questions/tagged/mpandroidchart) for the fastest answer.
@@ -133,7 +133,7 @@ If you like this library, please tell others about it :two_hearts: :two_hearts: [![Share on Google+](https://github.com/PhilJay/MPAndroidChart/blob/master/design/googleplus_icon.png)](https://plus.google.com/share?url=https://github.com/PhilJay/MPAndroidChart) [![Share on Facebook](https://github.com/PhilJay/MPAndroidChart/blob/master/design/facebook_icon.png)](https://www.facebook.com/sharer/sharer.php?u=https://github.com/PhilJay/MPAndroidChart) -You can follow me on Twitter [**@PhilippJahoda**](https://twitter.com/PhilippJahoda) or sign up for my [**daily coding newsletter**](https://philjay.substack.com/subscribe). +You can follow me on Twitter [**@PhilippJahoda**](https://twitter.com/PhilippJahoda) or sign up for my [**coding newsletter**](https://weeklycoding.com).
@@ -209,7 +209,7 @@ You can follow me on Twitter [**@PhilippJahoda**](https://twitter.com/PhilippJah

License :page_facing_up:

-Copyright 2018 Philipp Jahoda +Copyright 2019 Philipp Jahoda Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.