Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Hide callout on legend hover",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ export class AreaChartBase extends React.Component<IAreaChartProps, IAreaChartSt
this._onLegendClick(singleChartData.legend);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onLegendHover(singleChartData.legend);
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export class DonutChartBase extends React.Component<IDonutChartProps, IDonutChar
}
},
hoverAction: () => {
this._handleChartMouseLeave();
this.setState({ activeLegend: point.legend! });
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ export class GroupedVerticalBarChartBase extends React.Component<
this._onLegendClick(point.legend);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onLegendHover(point.legend);
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ export class HeatMapChartBase extends React.Component<IHeatMapChartProps, IHeatM
this._onLegendClick(item.legend);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onLegendHover(item.legend);
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
this.setState({ activeLegend: '' });
},
hoverAction: () => {
this._handleChartMouseLeave();
this.setState({ activeLegend: point.legend });
},
...(point.legendShape && {
Expand Down Expand Up @@ -412,6 +413,7 @@ export class LineChartBase extends React.Component<ILineChartProps, ILineChartSt
this.setState({ activeLegend: '' });
},
hoverAction: () => {
this._handleChartMouseLeave();
this.setState({ activeLegend: title });
},
opacity: this._getColorFillBarOpacity(colorFillBar),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export class MultiStackedBarChartBase extends React.Component<IMultiStackedBarCh
this._onClick(point.legend!);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onHover(point.legend!);
},
onMouseOutAction: () => {
Expand All @@ -363,6 +364,7 @@ export class MultiStackedBarChartBase extends React.Component<IMultiStackedBarCh
this._onClick(point.legend!);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onHover(point.legend!);
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export class StackedBarChartBase extends React.Component<IStackedBarChartProps,
hoverAction:
total > 0
? () => {
this._handleChartMouseLeave();
this._onHover(point.legend!);
}
: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ export class VerticalBarChartBase extends React.Component<IVerticalBarChartProps
this._onLegendClick(point.legend!);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onLegendHover(point.legend!);
},
onMouseOutAction: () => {
Expand All @@ -656,6 +657,7 @@ export class VerticalBarChartBase extends React.Component<IVerticalBarChartProps
this._onLegendClick(lineLegendText);
},
hoverAction: () => {
this._handleChartMouseLeave();
this._onLegendHover(lineLegendText);
},
onMouseOutAction: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,12 @@ export class VerticalStackedBarChartBase extends React.Component<
action: () => {
this._onLegendClick(point.legend);
},
hoverAction: allowHoverOnLegend ? () => this._onLegendHover(point.legend) : undefined,
hoverAction: allowHoverOnLegend
? () => {
this._handleChartMouseLeave();
this._onLegendHover(point.legend);
}
: undefined,
onMouseOutAction: allowHoverOnLegend ? () => this._onLegendLeave() : undefined,
};

Expand All @@ -514,7 +519,12 @@ export class VerticalStackedBarChartBase extends React.Component<
action: () => {
this._onLegendClick(point.title);
},
hoverAction: allowHoverOnLegend ? () => this._onLegendHover(point.title) : undefined,
hoverAction: allowHoverOnLegend
? () => {
this._handleChartMouseLeave();
this._onLegendHover(point.title);
}
: undefined,
onMouseOutAction: allowHoverOnLegend ? () => this._onLegendLeave() : undefined,
};
legendsOfLine.push(legend);
Expand Down