diff --git a/change/@fluentui-react-charting-20c8ae70-f2a4-4ef4-89b6-7ca932f7481d.json b/change/@fluentui-react-charting-20c8ae70-f2a4-4ef4-89b6-7ca932f7481d.json new file mode 100644 index 0000000000000..609bfb15d61b8 --- /dev/null +++ b/change/@fluentui-react-charting-20c8ae70-f2a4-4ef4-89b6-7ca932f7481d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fixed the focus indicator bug in horizontal bar chart and multi stack bar chart", + "packageName": "@fluentui/react-charting", + "email": "yushsingla@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-charting/src/components/HorizontalBarChart/HorizontalBarChart.base.tsx b/packages/react-charting/src/components/HorizontalBarChart/HorizontalBarChart.base.tsx index c9208fb923533..72f3f627659fe 100644 --- a/packages/react-charting/src/components/HorizontalBarChart/HorizontalBarChart.base.tsx +++ b/packages/react-charting/src/components/HorizontalBarChart/HorizontalBarChart.base.tsx @@ -30,6 +30,7 @@ export interface IHorizontalBarChartState { yCalloutValue?: string; barCalloutProps?: IChartDataPoint; callOutAccessibilityData?: IAccessibilityProps; + barSpacingInPercent: number; } export class HorizontalBarChartBase extends React.Component { @@ -40,6 +41,7 @@ export class HorizontalBarChartBase extends React.Component; private _emptyChartId: string; constructor(props: IHorizontalBarChartProps) { @@ -54,12 +56,23 @@ export class HorizontalBarChartBase extends React.Component(); + } + + public componentDidMount(): void { + const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0; + const MARGIN_WIDTH_IN_PX = 3; + if (svgWidth) { + const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100; + this.setState({ barSpacingInPercent: currentBarSpacing }); + } } public render(): JSX.Element { @@ -113,7 +126,7 @@ export class HorizontalBarChartBase extends React.Component {points!.chartData![0].data && this._createBenchmark(points!)} - + elements, which form the bars + * For each bar an x value, and a width needs to be specified + * The computations are done based on percentages + * Extra margin is also provided, in the x value to provide some spacing in between the bars + */ + private _createBars(data: IChartProps, palette: IPalette): JSX.Element[] { + const noOfBars = + data.chartData?.reduce((count: number, point: IChartDataPoint) => (count += (point.data || 0) > 0 ? 1 : 0), 0) || + 1; + const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1); const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black]; // calculating starting point of each bar and it's range const startingPoint: number[] = []; @@ -312,7 +336,15 @@ export class HorizontalBarChartBase extends React.Component This needs to be scaled down to 95%, not 100% + * since that's only space available to the bars + */ + const scalingRatio = sumOfPercent !== 0 ? (sumOfPercent - totalMarginPercent) / 100 : 1; const bars = data.chartData!.map((point: IChartDataPoint, index: number) => { const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)]; @@ -359,7 +391,11 @@ export class HorizontalBarChartBase extends React.Component { @@ -52,6 +53,7 @@ export class MultiStackedBarChartBase extends React.Component; private _emptyChartId: string; private _barId: string; private _barIdPlaceholderPartToWhole: string; @@ -70,16 +72,27 @@ export class MultiStackedBarChartBase extends React.Component(); this._emptyChartId = getId('_MSBC_empty'); this._barId = getId('_MSBC_rect_'); this._barIdPlaceholderPartToWhole = getId('_MSBC_rect_partToWhole_'); this._barIdEmpty = getId('_MSBC_rect_empty'); } + public componentDidMount(): void { + const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0; + const MARGIN_WIDTH_IN_PX = 3; + if (svgWidth) { + const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100; + this.setState({ barSpacingInPercent: currentBarSpacing }); + } + } + public render(): JSX.Element { if (!this._isChartEmpty()) { const { data, theme, culture } = this.props; @@ -155,6 +168,13 @@ export class MultiStackedBarChartBase extends React.Component elements, which form the bars + * For each bar an x value, and a width needs to be specified + * The computations are done based on percentages + * Extra margin is also provided, in the x value to provide some spacing + */ + private _createBarsAndLegends( data: IChartProps, barHeight: number, @@ -163,6 +183,10 @@ export class MultiStackedBarChartBase extends React.Component (count += (point.data || 0) > 0 ? 1 : 0), 0) || + 1; + const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1); const { culture } = this.props; const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black]; // calculating starting point of each bar and it's range @@ -177,7 +201,9 @@ export class MultiStackedBarChartBase extends React.Component { const pointData = point.data ? point.data : 0; - let value = (pointData / total) * 100 ? (pointData / total) * 100 : 0; + const currValue = (pointData / total) * 100; + let value = currValue ? currValue : 0; + if (value < 1 && value !== 0) { value = 1; } else if (value > 99 && value !== 100) { @@ -201,7 +227,16 @@ export class MultiStackedBarChartBase extends React.Component This needs to be scaled down to 95%, not 100% + * since that's only space available to the bars + */ + + const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1; let prevPosition = 0; let value = 0; @@ -257,7 +292,11 @@ export class MultiStackedBarChartBase extends React.Component
- + {bars}
diff --git a/packages/react-charting/src/components/StackedBarChart/MultiStackedBarChart.styles.ts b/packages/react-charting/src/components/StackedBarChart/MultiStackedBarChart.styles.ts index 39c68270760b9..e571b68a29e66 100644 --- a/packages/react-charting/src/components/StackedBarChart/MultiStackedBarChart.styles.ts +++ b/packages/react-charting/src/components/StackedBarChart/MultiStackedBarChart.styles.ts @@ -49,8 +49,6 @@ export const getMultiStackedBarChartStyles = (props: IMultiStackedBarChartStyleP opacityChangeOnHover: { opacity: shouldHighlight ? '' : '0.1', cursor: href ? 'pointer' : 'default', - stroke: theme.palette.white, - strokeWidth: 2, selectors: { '&:focus': { stroke: theme.palette.black, @@ -70,8 +68,6 @@ export const getMultiStackedBarChartStyles = (props: IMultiStackedBarChartStyleP placeHolderOnHover: { opacity: shouldHighlight ? '' : '0.1', cursor: 'default', - stroke: theme.palette.white, - strokeWidth: '2', selectors: { '&:focus': { stroke: theme.palette.black, diff --git a/packages/react-charting/src/components/StackedBarChart/StackedBarChart.base.tsx b/packages/react-charting/src/components/StackedBarChart/StackedBarChart.base.tsx index 7ddd4ccd358fe..fe71c5212a60c 100644 --- a/packages/react-charting/src/components/StackedBarChart/StackedBarChart.base.tsx +++ b/packages/react-charting/src/components/StackedBarChart/StackedBarChart.base.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { IProcessedStyleSet, IPalette } from '@fluentui/react/lib/Styling'; -import { classNamesFunction, getId } from '@fluentui/react/lib/Utilities'; +import { classNamesFunction, getId, getRTL } from '@fluentui/react/lib/Utilities'; import { ILegend, Legends } from '../Legends/index'; import { IAccessibilityProps, IChartDataPoint, IChartProps } from './index'; import { IRefArrayData, IStackedBarChartProps, IStackedBarChartStyleProps, IStackedBarChartStyles } from '../../index'; @@ -23,6 +23,7 @@ export interface IStackedBarChartState { dataPointCalloutProps?: IChartDataPoint; callOutAccessibilityData?: IAccessibilityProps; calloutLegend: string; + barSpacingInPercent: number; } export class StackedBarChartBase extends React.Component { @@ -37,6 +38,8 @@ export class StackedBarChartBase extends React.Component; + private _isRTL = getRTL(); public constructor(props: IStackedBarChartProps) { super(props); @@ -50,6 +53,7 @@ export class StackedBarChartBase extends React.Component(); + } + + public componentDidMount(): void { + const svgWidth = this.barChartSvgRef.current?.getBoundingClientRect().width || 0; + const MARGIN_WIDTH_IN_PX = 3; + if (svgWidth) { + const currentBarSpacing = (MARGIN_WIDTH_IN_PX / svgWidth) * 100; + this.setState({ barSpacingInPercent: currentBarSpacing }); + } } public render(): JSX.Element { @@ -145,7 +159,7 @@ export class StackedBarChartBase extends React.Component
- + {bars[0]} elements, which form the bars + * For each bar an x value, and a width needs to be specified + * The computations are done based on percentages + * Extra margin is also provided, in the x value to provide some spacing + */ + private _createBarsAndLegends( data: IChartProps, barHeight: number, @@ -209,6 +230,11 @@ export class StackedBarChartBase extends React.Component (count += (point.data || 0) > 0 ? 1 : 0), 0) || + 1; + const totalMarginPercent = this.state.barSpacingInPercent * (noOfBars - 1); + const defaultPalette: string[] = [palette.blueLight, palette.blue, palette.blueMid, palette.red, palette.black]; const legendDataItems: ILegend[] = []; // calculating starting point of each bar and it's range @@ -234,7 +260,15 @@ export class StackedBarChartBase extends React.Component This needs to be scaled down to 95%, not 100% + * since that's only space available to the bars + */ + const scalingRatio = sumOfPercent !== 0 ? sumOfPercent / (100 - totalMarginPercent) : 1; const bars = data.chartData!.map((point: IChartDataPoint, index: number) => { const color: string = point.color ? point.color : defaultPalette[Math.floor(Math.random() * 4 + 1)]; @@ -307,7 +341,11 @@ export class StackedBarChartBase extends React.Component @@ -142,8 +143,6 @@ exports[`StackedBarChart - mouse events Should render callout correctly on mouse { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -176,8 +175,6 @@ exports[`StackedBarChart - mouse events Should render callout correctly on mouse { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -503,6 +500,7 @@ exports[`StackedBarChart - mouse events Should render customized callout on mous display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -514,8 +512,6 @@ exports[`StackedBarChart - mouse events Should render customized callout on mous { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -548,8 +544,6 @@ exports[`StackedBarChart - mouse events Should render customized callout on mous { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -792,6 +786,7 @@ exports[`StackedBarChart snapShot testing renders StackedBarChart correctly 1`] display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -803,8 +798,6 @@ exports[`StackedBarChart snapShot testing renders StackedBarChart correctly 1`] { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -835,8 +828,6 @@ exports[`StackedBarChart snapShot testing renders StackedBarChart correctly 1`] { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1001,6 +992,7 @@ exports[`StackedBarChart snapShot testing renders enabledLegendsWrapLines correc display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1012,8 +1004,6 @@ exports[`StackedBarChart snapShot testing renders enabledLegendsWrapLines correc { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1044,8 +1034,6 @@ exports[`StackedBarChart snapShot testing renders enabledLegendsWrapLines correc { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1200,6 +1188,7 @@ exports[`StackedBarChart snapShot testing renders hideDenominator correctly 1`] display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1211,8 +1200,6 @@ exports[`StackedBarChart snapShot testing renders hideDenominator correctly 1`] { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1243,8 +1230,6 @@ exports[`StackedBarChart snapShot testing renders hideDenominator correctly 1`] { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1409,6 +1394,7 @@ exports[`StackedBarChart snapShot testing renders hideLegend correctly 1`] = ` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1420,8 +1406,6 @@ exports[`StackedBarChart snapShot testing renders hideLegend correctly 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1452,8 +1436,6 @@ exports[`StackedBarChart snapShot testing renders hideLegend correctly 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1592,6 +1574,7 @@ exports[`StackedBarChart snapShot testing renders hideNumberDisplay correctly 1` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1603,8 +1586,6 @@ exports[`StackedBarChart snapShot testing renders hideNumberDisplay correctly 1` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1635,8 +1616,6 @@ exports[`StackedBarChart snapShot testing renders hideNumberDisplay correctly 1` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1801,6 +1780,7 @@ exports[`StackedBarChart snapShot testing renders hideTooltip correctly 1`] = ` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1812,8 +1792,6 @@ exports[`StackedBarChart snapShot testing renders hideTooltip correctly 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1844,8 +1822,6 @@ exports[`StackedBarChart snapShot testing renders hideTooltip correctly 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1984,6 +1960,7 @@ exports[`StackedBarChart snapShot testing renders ignoreFixStyle correctly 1`] = display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } > @@ -1995,8 +1972,6 @@ exports[`StackedBarChart snapShot testing renders ignoreFixStyle correctly 1`] = { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -2027,8 +2002,6 @@ exports[`StackedBarChart snapShot testing renders ignoreFixStyle correctly 1`] = { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; diff --git a/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChartRTL.test.tsx.snap b/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChartRTL.test.tsx.snap index 9c19f42a1b871..204fd4efc7b33 100644 --- a/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChartRTL.test.tsx.snap @@ -84,6 +84,7 @@ exports[`Screen resolution Should remain unchanged on zoom in 1`] = ` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } focusable="false" @@ -96,8 +97,6 @@ exports[`Screen resolution Should remain unchanged on zoom in 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -124,8 +123,6 @@ exports[`Screen resolution Should remain unchanged on zoom in 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -152,8 +149,6 @@ exports[`Screen resolution Should remain unchanged on zoom in 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -180,8 +175,6 @@ exports[`Screen resolution Should remain unchanged on zoom in 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -700,6 +693,7 @@ exports[`Screen resolution Should remain unchanged on zoom out 1`] = ` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } focusable="false" @@ -712,8 +706,6 @@ exports[`Screen resolution Should remain unchanged on zoom out 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -740,8 +732,6 @@ exports[`Screen resolution Should remain unchanged on zoom out 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -768,8 +758,6 @@ exports[`Screen resolution Should remain unchanged on zoom out 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -796,8 +784,6 @@ exports[`Screen resolution Should remain unchanged on zoom out 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -1329,6 +1315,7 @@ exports[`Should reflect theme change 1`] = ` display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } focusable="false" @@ -1341,8 +1328,6 @@ exports[`Should reflect theme change 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #1b1a19; } &:focus { stroke-width: 2px; @@ -1369,8 +1354,6 @@ exports[`Should reflect theme change 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #1b1a19; } &:focus { stroke-width: 2px; @@ -1397,8 +1380,6 @@ exports[`Should reflect theme change 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #1b1a19; } &:focus { stroke-width: 2px; @@ -1425,8 +1406,6 @@ exports[`Should reflect theme change 1`] = ` { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #1b1a19; } &:focus { stroke-width: 2px; @@ -1946,6 +1925,7 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with em display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } focusable="false" @@ -1957,8 +1937,6 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with em { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -2473,6 +2451,7 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with no display: block; height: 12px; margin-bottom: 10px; + overflow: visible; width: 100%; } focusable="false" @@ -2485,8 +2464,6 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with no { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -2513,8 +2490,6 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with no { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -2541,8 +2516,6 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with no { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; @@ -2569,8 +2542,6 @@ exports[`Stacked bar chart rendering Should render the stacked bar chart with no { cursor: default; opacity: ; - stroke-width: 2px; - stroke: #ffffff; } &:focus { stroke-width: 2px; diff --git a/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Example.tsx b/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Example.tsx index e9c9973474660..d168bde86803d 100644 --- a/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Example.tsx +++ b/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChart.Example.tsx @@ -1,37 +1,85 @@ import * as React from 'react'; import { IChartDataPoint, MultiStackedBarChart, IChartProps } from '@fluentui/react-charting'; -export const MultiStackedBarChartExample: React.FunctionComponent = () => { +export const MultiStackedBarChartBasicExample: React.FunctionComponent = () => { const firstChartPoints: IChartDataPoint[] = [ { legend: 'Debit card numbers (EU and USA)', data: 40, color: '#0099BC', - callOutAccessibilityData: { ariaLabel: 'Bar series 1 of 5 Debit card numbers (EU and USA) 40' }, + callOutAccessibilityData: { ariaLabel: 'Bar series 1 of 13 Debit card numbers (EU and USA) 40' }, }, { legend: 'Passport numbers (USA)', data: 23, color: '#77004D', - callOutAccessibilityData: { ariaLabel: 'Bar series 2 of 5 Passport numbers (USA) 23' }, + callOutAccessibilityData: { ariaLabel: 'Bar series 2 of 13 Passport numbers (USA) 23' }, }, { legend: 'Social security numbers', data: 35, color: '#4F68ED', - callOutAccessibilityData: { ariaLabel: 'Bar series 3 of 5 Social security numbers 35' }, + callOutAccessibilityData: { ariaLabel: 'Bar series 3 of 13 Social security numbers 35' }, }, { legend: 'Credit card numbers', data: 87, color: '#AE8C00', - callOutAccessibilityData: { ariaLabel: 'Bar series 4 of 5 Credit card numbers 87' }, + callOutAccessibilityData: { ariaLabel: 'Bar series 4 of 13 Credit card numbers 87' }, }, { legend: 'Tax identification numbers (USA)', data: 87, color: '#004E8C', - callOutAccessibilityData: { ariaLabel: 'Bar series 5 of 5 Tax identification numbers (USA) 87' }, + callOutAccessibilityData: { ariaLabel: 'Bar series 5 of 13 Tax identification numbers (USA) 87' }, + }, + { + legend: "Driver's license numbers (USA)", + data: 0.5, + color: '#00A6A6', + callOutAccessibilityData: { ariaLabel: "Bar series 6 of 13 Driver's license numbers (USA) 0.5" }, + }, + { + legend: 'Email addresses', + data: 0.5, + color: '#FF5733', + callOutAccessibilityData: { ariaLabel: 'Bar series 7 of 13 Email addresses 0.5' }, + }, + { + legend: 'Phone numbers', + data: 0.5, + color: '#7E2F8E', + callOutAccessibilityData: { ariaLabel: 'Bar series 8 of 13 Phone numbers 0.5' }, + }, + { + legend: 'Health insurance numbers', + data: 0.5, + color: '#00B300', + callOutAccessibilityData: { ariaLabel: 'Bar series 9 of 13 Health insurance numbers 0.5' }, + }, + { + legend: 'Bank account numbers', + data: 0.5, + color: '#8C4D00', + callOutAccessibilityData: { ariaLabel: 'Bar series 10 of 13 Bank account numbers 0.5' }, + }, + { + legend: 'Employee identification numbers', + data: 0.5, + color: '#B34D9A', + callOutAccessibilityData: { ariaLabel: 'Bar series 11 of 13 Employee identification numbers 0.5' }, + }, + { + legend: 'Vehicle registration numbers', + data: 0.5, + color: '#FF9A00', + callOutAccessibilityData: { ariaLabel: 'Bar series 12 of 13 Vehicle registration numbers 0.5' }, + }, + { + legend: 'Student identification numbers', + data: 0.5, + color: '#007E00', + callOutAccessibilityData: { ariaLabel: 'Bar series 13 of 13 Student identification numbers 0.5' }, }, ]; const firstChartPoints1: IChartDataPoint[] = [ diff --git a/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChartPage.tsx b/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChartPage.tsx index 91bb42c6b7b5b..c83c24cad82e0 100644 --- a/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChartPage.tsx +++ b/packages/react-examples/src/react-charting/MultiStackedBarChart/MultiStackedBarChartPage.tsx @@ -6,7 +6,7 @@ import { PropertiesTableSet, } from '@fluentui/react-docsite-components'; -import { MultiStackedBarChartExample } from './MultiStackedBarChart.Example'; +import { MultiStackedBarChartBasicExample } from './MultiStackedBarChart.Example'; import { MultiStackedBarChartWithPlaceholderExample } from './MultiStackedBarChartWithPlaceHolder.Example'; import { MultiStackedBarChartVariantExample } from './MultiStackedBarChart.Variant.Example'; @@ -26,7 +26,7 @@ export class MultiStackedBarChartPage extends React.Component - +