@@ -98,8 +98,22 @@ export class ChartExtraTooltip extends AsyncStore<ReactiveTooltipState> {
9898 }
9999
100100 private onRenderTooltip = ( props : { point : null | Highcharts . Point ; group : readonly Highcharts . Point [ ] } ) => {
101- if ( this . context . chart ( ) . series . some ( ( s ) => s . type === "pie" ) ) {
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 ) {
102114 return this . onRenderTooltipPie ( props . group [ 0 ] ) ;
115+ } else if ( hasSolidGaugeSeries ) {
116+ return this . onRenderTooltipSolidGauge ( props . group [ 0 ] ) ;
103117 } else {
104118 return this . onRenderTooltipCartesian ( props ) ;
105119 }
@@ -128,6 +142,13 @@ export class ChartExtraTooltip extends AsyncStore<ReactiveTooltipState> {
128142 this . targetTrack . rect ( this . context . chart ( ) . renderer , { ...pointRect , ...this . commonTrackAttrs } ) ;
129143 } ;
130144
145+ private onRenderTooltipSolidGauge = ( point : Highcharts . Point ) => {
146+ // Solid gauge charts are similar to pie charts in that they have a circular shape
147+ // and don't support grouping. We use a similar approach to pie charts.
148+ const pointRect = getSolidGaugeTargetPlacement ( point ) ;
149+ this . targetTrack . rect ( this . context . chart ( ) . renderer , { ...pointRect , ...this . commonTrackAttrs } ) ;
150+ } ;
151+
131152 private get commonTrackAttrs ( ) {
132153 return { fill : "transparent" , zIndex : - 1 , style : "pointer-events:none" , direction : this . direction } ;
133154 }
@@ -217,3 +238,13 @@ function getPieMiddlePlacement(point: Highcharts.Point): Rect {
217238 ( typeof relativeDiameter === "number" ? relativeDiameter : ( relativeDiameter / 100 ) * chart . plotWidth ) / 2 ;
218239 return { x : centerX , y : centerY - radius , width : 1 , height : 2 * radius } ;
219240}
241+
242+ function getSolidGaugeTargetPlacement ( point : Highcharts . Point ) : Rect {
243+ const chart = point . series . chart ;
244+ return {
245+ x : chart . plotLeft + chart . plotWidth / 2 ,
246+ y : chart . plotTop + chart . plotHeight / 2 ,
247+ width : 0.1 ,
248+ height : 0.1 ,
249+ } ;
250+ }
0 commit comments