diff --git a/packages/react-charting/src/components/DonutChart/Arc/Arc.tsx b/packages/react-charting/src/components/DonutChart/Arc/Arc.tsx index 25809f9715fbac..e5da540d81bf4e 100644 --- a/packages/react-charting/src/components/DonutChart/Arc/Arc.tsx +++ b/packages/react-charting/src/components/DonutChart/Arc/Arc.tsx @@ -6,7 +6,6 @@ import { getStyles } from './Arc.styles'; import { IChartDataPoint } from '../index'; import { IArcProps, IArcStyles } from './index'; import { wrapTextInsideDonut } from '../../../utilities/index'; -import { IProcessedStyleSet } from '../../../Styling'; export interface IArcState { isCalloutVisible?: boolean; @@ -21,7 +20,6 @@ export class Arc extends React.Component { public state: {} = {}; - private _classNames: IProcessedStyleSet; private currentRef = React.createRef(); public static getDerivedStateFromProps(nextProps: Readonly): Partial | null { @@ -40,7 +38,7 @@ export class Arc extends React.Component { public render(): JSX.Element { const { arc, href, focusedArcId } = this.props; const getClassNames = classNamesFunction(); - this._classNames = getClassNames(getStyles, { + const classNames = getClassNames(getStyles, { color: this.props.color, href: href!, theme: this.props.theme!, @@ -52,13 +50,13 @@ export class Arc extends React.Component { return ( {!!focusedArcId && focusedArcId === id && ( - + )} { aria-label={this._getAriaLabel()} role="img" /> - - - {this.props.valueInsideDonut} + + + {this.props.valueInsideDonut!} diff --git a/packages/react-charting/src/utilities/utilities.ts b/packages/react-charting/src/utilities/utilities.ts index 7089e8d86072df..2813290ca2eb03 100644 --- a/packages/react-charting/src/utilities/utilities.ts +++ b/packages/react-charting/src/utilities/utilities.ts @@ -1130,7 +1130,8 @@ export function wrapTextInsideDonut(selectorClass: string, maxWidth: number): st line = [word]; tspanEllipsis.text(word); - // Determine if truncation is appending the text exceeds maximum width vertically or horizontally + // Determine if truncation is appending the text exceeds maximum height vertically or + // maximum width horizontally. In this case, maximum height vertically is same as maxWidth while ( tspanEllipsis.node()!.getComputedTextLength() > maxWidth - ellipsisLength || tspanEllipsis.node()!.getBoundingClientRect().y > maxWidth