Skip to content

Commit f02e692

Browse files
committed
fix: setMaxFilterNumber still allows to highlight non filtered points
1 parent 57557a9 commit f02e692

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/charting/highlight/ChartHighlighter.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ export class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
135135
const yKey = set.yProperty;
136136
const highlights: Highlight[] = [];
137137

138+
if (set['setIgnoreFiltered']) {
139+
(set as LineDataSet).setIgnoreFiltered(true);
140+
}
138141
//noinspection unchecked
139142
let entries = set.getEntriesAndIndexesForXValue(xVal);
140143
if (entries.length === 0) {
@@ -149,14 +152,9 @@ export class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
149152

150153
for (const r of entries) {
151154
const e = r.entry;
152-
let index = r.index;
153-
const xVal = set.getEntryXValue(e, r.index);
155+
const index = r.index;
156+
const xVal = set.getEntryXValue(e, index);
154157
const pixels = this.mChart.getTransformer(set.getAxisDependency()).getPixelForValues(xVal, e[yKey]);
155-
if ((set as any).isFiltered && (set as LineDataSet).isFiltered()) {
156-
(set as LineDataSet).setIgnoreFiltered(true);
157-
index = set.getEntryIndexForXValue(xVal, NaN, Rounding.CLOSEST);
158-
(set as LineDataSet).setIgnoreFiltered(false);
159-
}
160158

161159
highlights.push({
162160
entry: e,
@@ -169,6 +167,9 @@ export class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
169167
axis: set.getAxisDependency()
170168
});
171169
}
170+
if (set['setIgnoreFiltered']) {
171+
(set as LineDataSet).setIgnoreFiltered(false);
172+
}
172173

173174
return highlights;
174175
}

0 commit comments

Comments
 (0)