From 0e3e5b7c1d8f8bf045470486e000a917b9636506 Mon Sep 17 00:00:00 2001
From: Tim Molter <tim.molter@gmail.com>
Date: Wed, 19 Feb 2014 22:44:08 +0100
Subject: [PATCH] fix for decade axis tick location missing values

---
 .../internal/chartpart/AxisTickLogarithmicCalculator.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java b/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java
index b335cc95..db3f0cbe 100644
--- a/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java
+++ b/xchart/src/main/java/com/xeiam/xchart/internal/chartpart/AxisTickLogarithmicCalculator.java
@@ -54,7 +54,7 @@ public class AxisTickLogarithmicCalculator extends AxisTickCalculator {
     }
 
     // tick space - a percentage of the working space available for ticks
-    int tickSpace = (int)(styleManager.getAxisTickSpaceRatio() * workingSpace); // in plot space
+    int tickSpace = (int) (styleManager.getAxisTickSpaceRatio() * workingSpace); // in plot space
 
     // where the tick should begin in the working space in pixels
     int margin = Utils.getTickStartOffset(workingSpace, tickSpace); // in plot space double gridStep = getGridStepForDecimal(tickSpace);
@@ -109,7 +109,7 @@ public class AxisTickLogarithmicCalculator extends AxisTickCalculator {
         }
 
         // only add labels for the decades
-        if (Math.log10(j) % 1 == 0.0) {
+        if (Math.abs(Math.log10(j) % 1) < 0.00000001) {
           tickLabels.add(numberFormatter.formatNumber(j));
         }
         else {
-- 
GitLab