Skip to content

Commit 730e5d3

Browse files
committed
Fixed last label of line chart not rendering
1 parent c83d2f4 commit 730e5d3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/utils/Transformer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ public float[] generateTransformedValuesBubble(IBubbleDataSet data, float phaseY
169169
* @return
170170
*/
171171
public float[] generateTransformedValuesLine(ILineDataSet data,
172-
float phaseX, float phaseY, int from, int to) {
172+
float phaseX, float phaseY,
173+
int min, int max) {
173174

174-
final int count = (int) ((to - from) * phaseX) * 2;
175+
final int count = ((int) ((max - min) * phaseX) + 1) * 2;
175176

176177
if (valuePointsForGenerateTransformedValuesLine.length != count) {
177178
valuePointsForGenerateTransformedValuesLine = new float[count];
@@ -180,7 +181,7 @@ public float[] generateTransformedValuesLine(ILineDataSet data,
180181

181182
for (int j = 0; j < count; j += 2) {
182183

183-
Entry e = data.getEntryForIndex(j / 2 + from);
184+
Entry e = data.getEntryForIndex(j / 2 + min);
184185

185186
if (e != null) {
186187
valuePoints[j] = e.getX();

0 commit comments

Comments
 (0)