diff --git a/src/shared/components/plots/BoxScatterPlot.tsx b/src/shared/components/plots/BoxScatterPlot.tsx
index 49b987763cb..0c9b217969b 100644
--- a/src/shared/components/plots/BoxScatterPlot.tsx
+++ b/src/shared/components/plots/BoxScatterPlot.tsx
@@ -102,6 +102,7 @@ export type BoxModel = {
q3: number;
x?: number;
y?: number;
+ eventkey?: number;
sortedVector: number[];
};
@@ -168,6 +169,7 @@ export default class BoxScatterPlot<
@observable.ref private container: HTMLDivElement;
@observable.ref private boxPlotTooltipModel: any | null;
@observable private mousePosition = { x: 0, y: 0 };
+ @observable.ref private axisLabelTooltipModel: any | null;
private scatterPlotTooltipHelper: ScatterPlotTooltipHelper = new ScatterPlotTooltipHelper();
@@ -224,6 +226,41 @@ export default class BoxScatterPlot<
}
return [];
}
+ private get axisLabelEvents() {
+ if (this.props.boxPlotTooltip) {
+ const self = this;
+ return [
+ {
+ target: 'tickLabels',
+ eventHandlers: {
+ onMouseEnter: (event: any, props: any) => {
+ const groupIndex = props.index;
+ if (
+ groupIndex !== undefined &&
+ self.boxPlotData[groupIndex]
+ ) {
+ self.axisLabelTooltipModel = {
+ datum: self.boxPlotData[groupIndex],
+ eventkey: groupIndex,
+ };
+ self.mousePosition = {
+ x: event.pageX,
+ y: event.pageY,
+ };
+ }
+ return [];
+ },
+
+ onMouseLeave: () => {
+ self.axisLabelTooltipModel = null;
+ return [];
+ },
+ },
+ },
+ ];
+ }
+ return [];
+ }
private get title() {
if (this.props.title) {
@@ -641,6 +678,7 @@ export default class BoxScatterPlot<
}
/>
}
+ events={this.axisLabelEvents}
/>
);
}
@@ -687,6 +725,7 @@ export default class BoxScatterPlot<
axisLabelComponent={