File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -98,21 +98,11 @@ export class ChartExtraTooltip extends AsyncStore<ReactiveTooltipState> {
9898 }
9999
100100 private onRenderTooltip = ( props : { point : null | Highcharts . Point ; group : readonly Highcharts . Point [ ] } ) => {
101- let hasPieSeries = false ;
102- let hasSolidGaugeSeries = false ;
103- for ( const s of this . context . chart ( ) . series ) {
104- if ( s . type === "pie" ) {
105- hasPieSeries = true ;
106- break ;
107- }
108- if ( s . type === "solidgauge" ) {
109- hasSolidGaugeSeries = true ;
110- break ;
111- }
112- }
113- if ( hasPieSeries ) {
101+ const chartType =
102+ this . context . chart ( ) . series . find ( ( s ) => s . type === "pie" || s . type === "solidgauge" ) ?. type ?? "cartesian" ;
103+ if ( chartType === "pie" ) {
114104 return this . onRenderTooltipPie ( props . group [ 0 ] ) ;
115- } else if ( hasSolidGaugeSeries ) {
105+ } else if ( chartType === "solidgauge" ) {
116106 return this . onRenderTooltipSolidGauge ( props . group [ 0 ] ) ;
117107 } else {
118108 return this . onRenderTooltipCartesian ( props ) ;
You can’t perform that action at this time.
0 commit comments