Skip to content

Commit c628c49

Browse files
committed
Fix granularity when force label enabled
1 parent 0481bb7 commit c628c49

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/AxisRenderer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ protected void computeAxisValues(float min, float max) {
188188
if (mAxis.isForceLabelsEnabled()) {
189189

190190
interval = (float) range / (float) (labelCount - 1);
191+
if (mAxis.isGranularityEnabled())
192+
interval = interval < mAxis.getGranularity() ? mAxis.getGranularity() : interval;
193+
191194
mAxis.mEntryCount = labelCount;
192195

193196
// Ensure stops contains at least numStops elements.

0 commit comments

Comments
 (0)