Skip to content

Commit

Permalink
Fix granularity when force label enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Aug 3, 2023
1 parent 0481bb7 commit c628c49
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ protected void computeAxisValues(float min, float max) {
if (mAxis.isForceLabelsEnabled()) {

interval = (float) range / (float) (labelCount - 1);
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 c628c49

Please sign in to comment.