diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 933b6473c..9a050f54e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Thu Oct 17 16:01:25 WEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java b/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java index 3bb4156ca..5f9304f94 100644 --- a/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java +++ b/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java @@ -174,21 +174,31 @@ public void setVerticalLabels(String[] verticalLabels) { * false if it is a value for the y axis * @return */ + static int oldIdx = -1; + String result = ""; @Override - public String formatLabel(double value, boolean isValueX) { + synchronized public String formatLabel(double value, boolean isValueX) { + if (isValueX && mHorizontalLabels != null) { double minX = mViewport.getMinX(false); double maxX = mViewport.getMaxX(false); double range = maxX - minX; - value = value-minX; - int idx = (int)((value/range) * (mHorizontalLabels.length-1)); - return mHorizontalLabels[idx]; + value = value - minX; + int idx = (int) ((value / range) * (mHorizontalLabels.length - 1)); + // Log.e("StaticLabelsFormatter i= "+i, "formatLabel idx ="+idx+" " + mHorizontalLabels[i