Skip to content

Introduce a new annotated version of Horizontal Bar Charts #34825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png 30793 Changed
vr-tests-react-components/Drawer 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Drawer.overlay drawer full - High Contrast.chromium.png 6758 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 844 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 314 Changed
vr-tests-react-components/Skeleton converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Skeleton converged.Opaque Skeleton with circle - Dark Mode.default.chromium.png 3 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 659 Changed
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1321 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

"type": "minor",
"comment": "\u0016feat(react-charts) add a variant to horizontal bar charts with annotations",
"packageName": "@fluentui/react-charts",
"email": "[email protected]",
"dependentChangeType": "patch"
}
16 changes: 15 additions & 1 deletion packages/charts/react-charts/library/etc/react-charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,11 @@ export interface Chart {
}

// @public
export type ChartDataMode = 'default' | 'fraction' | 'percentage';
export type ChartDataMode = 'default' | 'fraction' | 'percentage' | 'hidden';

// @public (undocumented)
export interface ChartDataPoint {
annotationInformation?: string[];
callOutAccessibilityData?: AccessibilityProps;
color?: string;
data?: number;
Expand Down Expand Up @@ -721,14 +722,18 @@ export const HorizontalBarChart: React_2.FunctionComponent<HorizontalBarChartPro

// @public
export interface HorizontalBarChartProps extends React_2.RefAttributes<HTMLDivElement> {
allowHoverOnSegment?: boolean;
barHeight?: number;
calloutProps?: ChartPopoverProps;
calloutPropsPerDataPoint?: (dataPointCalloutProps: ChartDataPoint) => ChartPopoverProps;
chartDataMode?: ChartDataMode;
className?: string;
color?: string;
containerWidth?: number;
culture?: string;
data?: ChartProps[];
// (undocumented)
displayAnnotationIcon?: (segment: ChartDataPoint, index: number) => React_2.ReactNode;
hideLabels?: boolean;
hideRatio?: boolean[];
hideTooltip?: boolean;
Expand All @@ -737,6 +742,7 @@ export interface HorizontalBarChartProps extends React_2.RefAttributes<HTMLDivEl
// (undocumented)
legendsOverflowText?: any;
onRenderCalloutPerHorizontalBar?: (props: ChartDataPoint) => JSX.Element | undefined;
showAnnotationsInPercentage?: boolean;
showTriangle?: boolean;
styles?: HorizontalBarChartStyles;
variant?: HorizontalBarChartVariant;
Expand All @@ -749,6 +755,7 @@ export interface HorizontalBarChartStyles {
barWrapper: string;
benchmarkContainer: string;
chart: string;
chartAnnotationText: string;
chartDataTextDenominator: string;
chartTitle: string;
chartTitleLeft: string;
Expand Down Expand Up @@ -1253,6 +1260,13 @@ export interface Schema {
plotlySchema: any;
}

// @public (undocumented)
export type segment = {
percent: number;
adjustedPercent: number;
rawValue: number;
};

// @public (undocumented)
export const Shape: React_2.FunctionComponent<ShapeProps>;

Expand Down
Loading