File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,7 @@ function ChartInner<TDatum>({
526
526
const base = {
527
527
color :
528
528
getOptions ( ) . defaultColors [
529
- series . index % ( getOptions ( ) . defaultColors . length - 1 )
529
+ series . index % getOptions ( ) . defaultColors . length
530
530
] ,
531
531
}
532
532
@@ -544,7 +544,7 @@ function ChartInner<TDatum>({
544
544
...series [ datum . seriesIndex ] ?. style ,
545
545
color :
546
546
getOptions ( ) . defaultColors [
547
- datum . seriesIndex % ( getOptions ( ) . defaultColors . length - 1 )
547
+ datum . seriesIndex % getOptions ( ) . defaultColors . length
548
548
] ,
549
549
}
550
550
Original file line number Diff line number Diff line change @@ -71,7 +71,10 @@ function PrimaryVoronoi<TDatum>({
71
71
72
72
return React . useMemo ( ( ) => {
73
73
const columns = series [ 0 ] . datums
74
- . filter ( datum => {
74
+ . filter ( ( datum , i , all ) => {
75
+ if ( all . findIndex ( d => d . primaryValue === datum . primaryValue ) !== i ) {
76
+ return false
77
+ }
75
78
const primaryValue = datum . primaryValue
76
79
return primaryValue !== 'undefined' && primaryValue !== null
77
80
} )
@@ -203,8 +206,8 @@ function PrimaryVoronoi<TDatum>({
203
206
>
204
207
{ columns . map ( ( column , i ) => {
205
208
return (
206
- < React . Fragment key = { `${ column . primaryPx } _${ i } ` } >
207
- { column . datumBoundaries . map ( datumBoundary => {
209
+ < g key = { `${ column . primaryPx } _${ i } ` } >
210
+ { column . datumBoundaries . map ( ( datumBoundary , i ) => {
208
211
const x1 = ! primaryAxis . isVertical
209
212
? column . primaryStart
210
213
: datumBoundary . secondaryStart
@@ -229,7 +232,7 @@ function PrimaryVoronoi<TDatum>({
229
232
return (
230
233
< rect
231
234
{ ...{
232
- key : ` ${ column . primaryPx } _ ${ datumBoundary . datum . seriesIndex } ` ,
235
+ key : i ,
233
236
x,
234
237
y,
235
238
width,
@@ -248,7 +251,7 @@ function PrimaryVoronoi<TDatum>({
248
251
/>
249
252
)
250
253
} ) }
251
- </ React . Fragment >
254
+ </ g >
252
255
)
253
256
} ) }
254
257
</ g >
You can’t perform that action at this time.
0 commit comments