From 9914438a3c82ccc95b61980f07bce5d5d0d9e698 Mon Sep 17 00:00:00 2001 From: Dor Alon Date: Thu, 2 Jul 2015 10:54:19 +0300 Subject: [PATCH] ChartData.removeEntryByXIndex removes the wrong entry #182 --- Charts/Classes/Data/ChartData.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Charts/Classes/Data/ChartData.swift b/Charts/Classes/Data/ChartData.swift index 9d8ac45636..c3310d17d8 100644 --- a/Charts/Classes/Data/ChartData.swift +++ b/Charts/Classes/Data/ChartData.swift @@ -687,6 +687,11 @@ public class ChartData: NSObject var entry = _dataSets[dataSetIndex].entryForXIndex(xIndex) + if (entry?.xIndex != xIndex) + { + return false + } + return removeEntry(entry, dataSetIndex: dataSetIndex) }