Skip to content

Commit

Permalink
Merge pull request #137 from AppDevNext/anisurrehman-patch-1
Browse files Browse the repository at this point in the history
Fix granularity when force label enabled
  • Loading branch information
hannesa2 authored Aug 3, 2023
2 parents fa9febb + e42da65 commit bf7ac56
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ protected void computeAxisValues(float min, float max) {
if (mAxis.isForceLabelsEnabled()) {

interval = (float) range / (float) (labelCount - 1);
// When force label is enabled
// If granularity is enabled, then do not allow the interval to go below specified granularity.
if (mAxis.isGranularityEnabled())
interval = interval < mAxis.getGranularity() ? mAxis.getGranularity() : interval;

mAxis.mEntryCount = labelCount;

// Ensure stops contains at least numStops elements.
Expand Down

0 comments on commit bf7ac56

Please sign in to comment.