Skip to content

Commit

Permalink
[HorizontalBarChartWithAxis] Initialization of state variables and up…
Browse files Browse the repository at this point in the history
…dating checks (#33532)
  • Loading branch information
srmukher authored Dec 31, 2024
1 parent 73b823a commit db1eb85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Initialization of state variables and updating for HorizontalBarChartWithAxis chart",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class HorizontalBarChartWithAxisBase
activeXdataPoint: null,
YValueHover: [],
hoverXValue: '',
selectedLegends: [],
selectedLegends: props.legendProps?.selectedLegends || [],
};
this._calloutId = getId('callout');
this._tooltipId = getId('HBCWATooltipID_');
Expand Down Expand Up @@ -605,7 +605,7 @@ export class HorizontalBarChartWithAxisBase
const { useSingleColor = false } = this.props;
const bars = this._points.map((point: IHorizontalBarChartWithAxisDataPoint, index: number) => {
let shouldHighlight = true;
if (this._getHighlightedLegend().length > 0) {
if (this.state.isLegendHovered || this.state.isLegendSelected) {
shouldHighlight = this._isLegendHighlighted(point.legend);
}
this._classNames = getClassNames(this.props.styles!, {
Expand Down

0 comments on commit db1eb85

Please sign in to comment.