File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { Rounding } from '../data/DataSet';
6
6
import { IDataSet } from '../interfaces/datasets/IDataSet' ;
7
7
import { Entry } from '../data/Entry' ;
8
8
import { getEntryXValue } from '../data/BaseEntry' ;
9
+ import { LineDataSet } from '../data/LineDataSet' ;
9
10
10
11
export class ChartHighlighter < T extends BarLineScatterCandleBubbleDataProvider > implements IHighlighter {
11
12
/**
@@ -148,17 +149,22 @@ export class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider>
148
149
entries = set . getEntriesAndIndexesForXValue ( getEntryXValue ( closest . entry , xKey , closest . index ) ) ;
149
150
}
150
151
}
151
-
152
152
if ( entries . length === 0 ) return highlights ;
153
153
154
154
for ( const r of entries ) {
155
155
const e = r . entry ;
156
+ let index = r . index ;
156
157
const xVal = getEntryXValue ( e , xKey , r . index ) ;
157
158
const pixels = this . mChart . getTransformer ( set . getAxisDependency ( ) ) . getPixelForValues ( xVal , e [ yKey ] ) ;
159
+ if ( ( set as any ) . isFiltered && ( set as LineDataSet ) . isFiltered ( ) ) {
160
+ ( set as LineDataSet ) . setIgnoreFiltered ( true ) ;
161
+ index = set . getEntryIndexForXValue ( xVal , NaN , Rounding . CLOSEST ) ;
162
+ ( set as LineDataSet ) . setIgnoreFiltered ( false ) ;
163
+ }
158
164
159
165
highlights . push ( {
160
166
entry : e ,
161
- entryIndex : r . index ,
167
+ entryIndex : index ,
162
168
x : xVal ,
163
169
y : e [ yKey ] ,
164
170
xPx : pixels . x ,
You can’t perform that action at this time.
0 commit comments