diff --git a/change/@fluentui-react-charting-fd86b4aa-b2f7-413c-83e4-4cb434fe6a75.json b/change/@fluentui-react-charting-fd86b4aa-b2f7-413c-83e4-4cb434fe6a75.json new file mode 100644 index 0000000000000..1683e09d73c65 --- /dev/null +++ b/change/@fluentui-react-charting-fd86b4aa-b2f7-413c-83e4-4cb434fe6a75.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Modify hover card as per design", + "packageName": "@fluentui/react-charting", + "email": "kumarkshitij@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChart.test.tsx.snap b/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChart.test.tsx.snap index dd51632647b90..9f91f5ffad5a5 100644 --- a/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChart.test.tsx.snap +++ b/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChart.test.tsx.snap @@ -423,38 +423,32 @@ exports[`AreaChart - mouse events Should render callout correctly on mouseover 1 className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+
-
-
- - metaData1 -
-
+ + +
- 80 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style={ + Object { + "marginRight": "24px", + } + } + > + metaData1 +
+
+ 80
diff --git a/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChartRTL.test.tsx.snap b/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChartRTL.test.tsx.snap index 8df081a9230a2..4345da0667a56 100644 --- a/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/AreaChart/__snapshots__/AreaChartRTL.test.tsx.snap @@ -750,38 +750,32 @@ exports[`AreaChart - mouse events Should render callout correctly on mouseover 1 className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+
-
-
- - metaData1 -
-
+ + +
- 80 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style={ + Object { + "marginRight": "24px", + } + } + > + metaData1 +
+
+ 80
diff --git a/packages/react-charting/src/components/CommonComponents/CartesianChart.base.tsx b/packages/react-charting/src/components/CommonComponents/CartesianChart.base.tsx index dd9fd3cec6264..2c7ca58ed424f 100644 --- a/packages/react-charting/src/components/CommonComponents/CartesianChart.base.tsx +++ b/packages/react-charting/src/components/CommonComponents/CartesianChart.base.tsx @@ -32,6 +32,7 @@ import { calculateLongestLabelWidth, createYAxisLabels, ChartTypes, + ChartHoverCardVariant, } from '../../utilities/index'; import { LegendShape, Shape } from '../Legends/index'; @@ -509,12 +510,10 @@ export class CartesianChartBase extends React.Component { const yValueHoverSubCountsExists: boolean = this._yValueHoverSubCountsExists(calloutProps.YValueHover); + return (
-
+
- {this._getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)} -
+ +
+ {this._getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)} +
+ {shouldDrawBorderBottom &&
} + ); })} - {!!calloutProps.descriptionMessage && ( -
{calloutProps.descriptionMessage}
- )}
+ {!!calloutProps.descriptionMessage && ( + <> +
+
{calloutProps.descriptionMessage}
+ + )}
); }; @@ -583,46 +576,41 @@ export class CartesianChartBase extends React.Component +
{yValueHoverSubCountsExists && ( -
+
{xValue.legend!} ({yValue})
)} -
- {toDrawShape && ( - - )} -
-
{xValue.legend}
-
- {convertToLocaleString( - xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, - culture, - )} + {(yValueHoverSubCountsExists || calloutVariant === ChartHoverCardVariant.LongLegend) && ( +
+ {xValue.legend} +
+ )} +
+ + {!yValueHoverSubCountsExists && calloutVariant !== ChartHoverCardVariant.LongLegend && ( +
+ {xValue.legend}
+ )} +
+ {convertToLocaleString( + xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, + culture, + )}
@@ -630,16 +618,27 @@ export class CartesianChartBase extends React.Component -
+
+
{xValue.legend!} ({yValue})
- {Object.keys(subcounts).map((subcountName: string) => { + {Object.keys(subcounts).map((subcountName: string, idx, sc) => { return ( -
-
{convertToLocaleString(subcountName, culture)}
-
- {convertToLocaleString(subcounts[subcountName], culture)} +
+
+ {convertToLocaleString(subcountName, culture)} +
+
+ +
+ {convertToLocaleString(subcounts[subcountName], culture)} +
); diff --git a/packages/react-charting/src/components/CommonComponents/CartesianChart.styles.ts b/packages/react-charting/src/components/CommonComponents/CartesianChart.styles.ts index 783b67fb24f27..ec3b227afe3ef 100644 --- a/packages/react-charting/src/components/CommonComponents/CartesianChart.styles.ts +++ b/packages/react-charting/src/components/CommonComponents/CartesianChart.styles.ts @@ -1,12 +1,12 @@ import { ICartesianChartStyleProps, ICartesianChartStyles } from './CartesianChart.types'; -import { HighContrastSelectorBlack, HighContrastSelector } from '@fluentui/react/lib/Styling'; +import { HighContrastSelectorBlack, FontWeights, FontSizes } from '@fluentui/react/lib/Styling'; import { isIE11 } from '@fluentui/react'; const isIE11Var: boolean = isIE11(); export const getStyles = (props: ICartesianChartStyleProps): ICartesianChartStyles => { - const { className, theme, isRtl, shouldHighlight, href, lineColor = 'transparent', toDrawShape } = props; - const { fonts } = theme!; + const { className, theme, isRtl, shouldHighlight, href } = props; + return { root: [ theme.fonts.medium, @@ -99,85 +99,54 @@ export const getStyles = (props: ICartesianChartStyleProps): ICartesianChartStyl marginLeft: '20px', }, ], - calloutContentRoot: [ - { - display: 'grid', - overflow: 'hidden', - padding: '11px 16px 10px 16px', - backgroundColor: theme.semanticColors.bodyBackground, - backgroundBlendMode: 'normal, luminosity', - }, - ], + + calloutContentRoot: { + ...theme.fonts.medium, + color: theme.semanticColors.bodyText, + padding: '16px', + backgroundColor: theme.semanticColors.bodyBackground, + backgroundBlendMode: 'normal, luminosity', + }, + calloutDateTimeContainer: { + marginBottom: '8px', + }, + + calloutContentX: { + fontWeight: FontWeights.semibold, + }, + + calloutBlockContainer: { display: 'flex', - flexDirection: 'row', - justifyContent: 'space-between', + alignItems: 'center', }, - calloutContentX: [ - { - ...fonts.small, - lineHeight: '16px', - opacity: '0.8', - color: theme.semanticColors.bodySubtext, - }, - ], - calloutBlockContainer: [ - theme.fonts.mediumPlus, - { - marginTop: '13px', - color: theme.semanticColors.bodyText, - }, - !toDrawShape && { - selectors: { - [HighContrastSelector]: { - forcedColorAdjust: 'none', - }, - }, - borderLeft: `4px solid ${lineColor}`, - paddingLeft: '8px', - }, - toDrawShape && { - display: 'flex', - }, - ], + shapeStyles: { marginRight: '8px', + flexShrink: 0, }, + calloutlegendText: { - ...fonts.small, - lineHeight: '16px', - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - color: theme.semanticColors.bodySubtext, + textOverflow: 'ellipsis', + overflow: 'hidden', + whiteSpace: 'nowrap', + flexGrow: 1, + }, + + calloutContentY: { + fontWeight: FontWeights.semibold, + flexShrink: 0, + }, + + divider: { + height: '1px', + backgroundColor: '#c8c8c8', + marginTop: '8px', + marginBottom: '8px', + }, + + descriptionMessage: { + fontSize: FontSizes.small, }, - calloutContentY: [ - { - ...fonts.mediumPlus, - fontWeight: 'bold', - lineHeight: '22px', - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - }, - ], - descriptionMessage: [ - theme.fonts.small, - { - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - color: theme.semanticColors.bodyText, - marginTop: '10px', - paddingTop: '10px', - borderTop: `1px solid ${theme.semanticColors.menuDivider}`, - }, - ], }; }; diff --git a/packages/react-charting/src/components/CommonComponents/CartesianChart.types.ts b/packages/react-charting/src/components/CommonComponents/CartesianChart.types.ts index f479a0b4b372f..1c445ed8176b7 100644 --- a/packages/react-charting/src/components/CommonComponents/CartesianChart.types.ts +++ b/packages/react-charting/src/components/CommonComponents/CartesianChart.types.ts @@ -6,7 +6,7 @@ import { IFocusZoneProps, FocusZoneDirection } from '@fluentui/react-focus'; import { ICalloutProps } from '@fluentui/react/lib/Callout'; import { ILegendsProps } from '../Legends/index'; import { IAccessibilityProps, IMargins } from '../../types/index'; -import { ChartTypes, IChartHoverCardProps, XAxisTypes, YAxisType } from '../../utilities/index'; +import { ChartHoverCardVariant, ChartTypes, IChartHoverCardProps, XAxisTypes, YAxisType } from '../../utilities/index'; import * as d3TimeFormat from 'd3-time-format'; export interface ICartesianChartStyleProps { @@ -49,16 +49,6 @@ export interface ICartesianChartStyleProps { * prop to check if the Page is in Rtl */ isRtl?: boolean; - - /** - * color of the line - */ - lineColor?: string; - - /** - * boolean flag which determines if shape is drawn in callout - */ - toDrawShape?: boolean; } export interface ICartesianChartStyles { @@ -151,6 +141,11 @@ export interface ICartesianChartStyles { * Styles for the chart wrapper div */ chartWrapper?: IStyle; + + /** + * Styles for the group divider in callout + */ + divider?: IStyle; } export interface ICartesianChartProps { @@ -380,6 +375,12 @@ export interface ICartesianChartProps { * @default True for LineChart but False for other charts */ enableReflow?: boolean; + + /** + * Specifies the variant of hover card to be rendered + * @defaultvalue ChartHoverCardVariant.ShortLegend + */ + calloutVariant?: ChartHoverCardVariant; } export interface IYValueHover { diff --git a/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChart.test.tsx.snap b/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChart.test.tsx.snap index 530573c78d09e..919da1b80955e 100644 --- a/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChart.test.tsx.snap +++ b/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChart.test.tsx.snap @@ -199,87 +199,74 @@ exports[`DonutChart - mouse events Should render callout correctly on mouseover className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ 2020/04/30
-
- 2020/04/30 -
+ +
20,000 diff --git a/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChartRTL.test.tsx.snap b/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChartRTL.test.tsx.snap index 551ad53f5f2a7..6095723f1e96d 100644 --- a/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/DonutChart/__snapshots__/DonutChartRTL.test.tsx.snap @@ -172,87 +172,74 @@ exports[`Donut chart interactions Should hide callout on mouse leave 1`] = ` class= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ 2020/04/30
-
- 2020/04/30 -
+ +
20,000 @@ -1234,87 +1221,74 @@ exports[`DonutChart - mouse events Should render callout correctly on mouseover className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ 2020/04/30
-
- 2020/04/30 -
+ +
20,000 diff --git a/packages/react-charting/src/components/GaugeChart/GaugeChart.base.tsx b/packages/react-charting/src/components/GaugeChart/GaugeChart.base.tsx index bb9514b785679..130ad44a3fd35 100644 --- a/packages/react-charting/src/components/GaugeChart/GaugeChart.base.tsx +++ b/packages/react-charting/src/components/GaugeChart/GaugeChart.base.tsx @@ -10,6 +10,7 @@ import { } from './GaugeChart.types'; import { IProcessedStyleSet } from '@fluentui/react/lib/Styling'; import { + ChartHoverCardVariant, Points, convertToLocaleString, formatValueWithSIPrefix, @@ -518,12 +519,10 @@ export class GaugeChartBase extends React.Component { const yValueHoverSubCountsExists: boolean = this._yValueHoverSubCountsExists(calloutProps.YValueHover); + return (
-
+
- {this._getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)} -
+ +
+ {this._getCalloutContent(yValue, index, yValueHoverSubCountsExists, isLast)} +
+ {shouldDrawBorderBottom &&
} + ); })} - {!!calloutProps.descriptionMessage && ( -
{calloutProps.descriptionMessage}
- )}
+ {!!calloutProps.descriptionMessage && ( + <> +
+
{calloutProps.descriptionMessage}
+ + )}
); }; @@ -592,42 +585,41 @@ export class GaugeChartBase extends React.Component +
{yValueHoverSubCountsExists && ( -
+
{xValue.legend!} ({yValue})
)} -
- {toDrawShape && ( - - )} -
-
{xValue.legend}
-
- {convertToLocaleString( - xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, - culture, - )} + {(yValueHoverSubCountsExists || calloutVariant === ChartHoverCardVariant.LongLegend) && ( +
+ {xValue.legend} +
+ )} +
+ + {!yValueHoverSubCountsExists && calloutVariant !== ChartHoverCardVariant.LongLegend && ( +
+ {xValue.legend}
+ )} +
+ {convertToLocaleString( + xValue.yAxisCalloutData ? xValue.yAxisCalloutData : xValue.y || xValue.data, + culture, + )}
@@ -635,16 +627,27 @@ export class GaugeChartBase extends React.Component -
+
+
{xValue.legend!} ({yValue})
- {Object.keys(subcounts).map((subcountName: string) => { + {Object.keys(subcounts).map((subcountName: string, idx, sc) => { return ( -
-
{convertToLocaleString(subcountName, culture)}
-
- {convertToLocaleString(subcounts[subcountName], culture)} +
+
+ {convertToLocaleString(subcountName, culture)} +
+
+ +
+ {convertToLocaleString(subcounts[subcountName], culture)} +
); diff --git a/packages/react-charting/src/components/GaugeChart/GaugeChart.styles.ts b/packages/react-charting/src/components/GaugeChart/GaugeChart.styles.ts index ccc767b32e0ab..fdab05b3b6e94 100644 --- a/packages/react-charting/src/components/GaugeChart/GaugeChart.styles.ts +++ b/packages/react-charting/src/components/GaugeChart/GaugeChart.styles.ts @@ -1,8 +1,8 @@ -import { FontSizes, FontWeights, HighContrastSelector, HighContrastSelectorBlack } from '@fluentui/react'; +import { FontSizes, FontWeights } from '@fluentui/react'; import { IGaugeChartStyleProps, IGaugeChartStyles } from './GaugeChart.types'; export const getStyles = (props: IGaugeChartStyleProps): IGaugeChartStyles => { - const { theme, chartValueSize, chartWidth, chartHeight, className, lineColor, toDrawShape } = props; + const { theme, chartValueSize, chartWidth, chartHeight, className } = props; return { root: [ @@ -58,85 +58,53 @@ export const getStyles = (props: IGaugeChartStyleProps): IGaugeChartStyles => { width: chartWidth, }, - calloutContentRoot: [ - { - display: 'grid', - overflow: 'hidden', - padding: '11px 16px 10px 16px', - backgroundColor: theme.semanticColors.bodyBackground, - backgroundBlendMode: 'normal, luminosity', - }, - ], + calloutContentRoot: { + ...theme.fonts.medium, + color: theme.semanticColors.bodyText, + padding: '16px', + backgroundColor: theme.semanticColors.bodyBackground, + backgroundBlendMode: 'normal, luminosity', + }, + calloutDateTimeContainer: { + marginBottom: '8px', + }, + + calloutContentX: { + fontWeight: FontWeights.semibold, + }, + + calloutBlockContainer: { display: 'flex', - flexDirection: 'row', - justifyContent: 'space-between', + alignItems: 'center', }, - calloutContentX: [ - { - ...theme.fonts.small, - lineHeight: '16px', - opacity: '0.8', - color: theme.semanticColors.bodySubtext, - }, - ], - calloutBlockContainer: [ - theme.fonts.mediumPlus, - { - marginTop: '13px', - color: theme.semanticColors.bodyText, - }, - !toDrawShape && { - selectors: { - [HighContrastSelector]: { - forcedColorAdjust: 'none', - }, - }, - borderLeft: `4px solid ${lineColor}`, - paddingLeft: '8px', - }, - toDrawShape && { - display: 'flex', - }, - ], + shapeStyles: { marginRight: '8px', + flexShrink: 0, }, + calloutlegendText: { - ...theme.fonts.small, - lineHeight: '16px', - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - color: theme.semanticColors.bodySubtext, + textOverflow: 'ellipsis', + overflow: 'hidden', + whiteSpace: 'nowrap', + flexGrow: 1, + }, + + calloutContentY: { + fontWeight: FontWeights.semibold, + flexShrink: 0, + }, + + divider: { + height: '1px', + backgroundColor: '#c8c8c8', + marginTop: '8px', + marginBottom: '8px', + }, + + descriptionMessage: { + fontSize: FontSizes.small, }, - calloutContentY: [ - { - ...theme.fonts.mediumPlus, - fontWeight: 'bold', - lineHeight: '22px', - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - }, - ], - descriptionMessage: [ - theme.fonts.small, - { - selectors: { - [HighContrastSelectorBlack]: { - color: 'rgb(255, 255, 255)', - }, - }, - color: theme.semanticColors.bodyText, - marginTop: '10px', - paddingTop: '10px', - borderTop: `1px solid ${theme.semanticColors.menuDivider}`, - }, - ], }; }; diff --git a/packages/react-charting/src/components/GaugeChart/GaugeChart.types.ts b/packages/react-charting/src/components/GaugeChart/GaugeChart.types.ts index 49a1456494c4f..469251c683e7e 100644 --- a/packages/react-charting/src/components/GaugeChart/GaugeChart.types.ts +++ b/packages/react-charting/src/components/GaugeChart/GaugeChart.types.ts @@ -3,6 +3,7 @@ import { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities'; import { ILegendsProps } from '../Legends/index'; import { IAccessibilityProps } from '../../types/index'; import { ICalloutProps } from '@fluentui/react/lib/Callout'; +import { ChartHoverCardVariant } from '../../utilities/index'; export interface IGaugeChartSegment { /** @@ -126,6 +127,12 @@ export interface IGaugeChartProps { * Props for the callout in the chart */ calloutProps?: Partial; + + /** + * Specifies the variant of hover card to be rendered + * @defaultvalue ChartHoverCardVariant.ShortLegend + */ + calloutVariant?: ChartHoverCardVariant; } export interface IGaugeChartStyleProps { @@ -153,16 +160,6 @@ export interface IGaugeChartStyleProps { * Additional CSS class(es) to apply to the chart */ className?: string; - - /** - * Color of the line - */ - lineColor?: string; - - /** - * Boolean flag which determines if shape is drawn in callout - */ - toDrawShape?: boolean; } export interface IGaugeChartStyles { @@ -255,4 +252,9 @@ export interface IGaugeChartStyles { * Styles for the shape object in the callout */ shapeStyles?: IStyle; + + /** + * Styles for the group divider in callout + */ + divider?: IStyle; } diff --git a/packages/react-charting/src/components/GaugeChart/__snapshots__/GaugeChart.test.tsx.snap b/packages/react-charting/src/components/GaugeChart/__snapshots__/GaugeChart.test.tsx.snap index e460dbf1020bc..74122d81236d6 100644 --- a/packages/react-charting/src/components/GaugeChart/__snapshots__/GaugeChart.test.tsx.snap +++ b/packages/react-charting/src/components/GaugeChart/__snapshots__/GaugeChart.test.tsx.snap @@ -533,37 +533,32 @@ exports[`GaugeChart - event listeners testing should show a callout when the mou class= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
-
- - Low Risk -
-
+ + +
- 0 - 33 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style="margin-right: 24px;" + > + Low Risk +
+
+ 0 - 33
@@ -640,64 +628,57 @@ exports[`GaugeChart - event listeners testing should show a callout when the mou
-
-
- - Medium Risk -
-
+ + +
- 34 - 67 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style="margin-right: 24px;" + > + Medium Risk +
+
+ 34 - 67
@@ -705,64 +686,57 @@ exports[`GaugeChart - event listeners testing should show a callout when the mou
-
-
- - High Risk -
-
+ + +
- 68 - 100 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style="margin-right: 24px;" + > + High Risk +
+
+ 68 - 100
diff --git a/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChart.test.tsx.snap b/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChart.test.tsx.snap index eccc78c98f254..b04ec3684f852 100644 --- a/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChart.test.tsx.snap @@ -660,85 +660,73 @@ exports[`GroupedVerticalBarChart - mouse events Should render callout correctly className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+ height={14} + transform="rotate(0, 0, 0)" + viewBox="-1 -1 14 14" + width={14} + > + +
66 diff --git a/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChartRTL.test.tsx.snap b/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChartRTL.test.tsx.snap index 3bd8ef6e150d3..0c01964f4d971 100644 --- a/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/GroupedVerticalBarChart/__snapshots__/GroupedVerticalBarChartRTL.test.tsx.snap @@ -1202,85 +1202,73 @@ exports[`GroupedVerticalBarChart - mouse events Should render callout correctly className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+ height={14} + transform="rotate(0, 0, 0)" + viewBox="-1 -1 14 14" + width={14} + > + +
66 diff --git a/packages/react-charting/src/components/HeatMapChart/__snapshots__/HeatMapChart.test.tsx.snap b/packages/react-charting/src/components/HeatMapChart/__snapshots__/HeatMapChart.test.tsx.snap index 78a1e9731e086..d157723e2d737 100644 --- a/packages/react-charting/src/components/HeatMapChart/__snapshots__/HeatMapChart.test.tsx.snap +++ b/packages/react-charting/src/components/HeatMapChart/__snapshots__/HeatMapChart.test.tsx.snap @@ -408,144 +408,120 @@ exports[`HeatMapChart - mouse events Should render callout correctly on mouseove className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ Execllent (0-200)
-
- Execllent (0-200) -
+ +
50
-
-
- - 50 - - / - - 2,391 - + { + font-weight: 600; + } + > + 50 + + + / 2,391 + +
+
a good day to start with in Texas with best air quality diff --git a/packages/react-charting/src/components/HorizontalBarChart/__snapshots__/HorizontalBarChart.test.tsx.snap b/packages/react-charting/src/components/HorizontalBarChart/__snapshots__/HorizontalBarChart.test.tsx.snap index 495795292a967..a7a8a8c097598 100644 --- a/packages/react-charting/src/components/HorizontalBarChart/__snapshots__/HorizontalBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/HorizontalBarChart/__snapshots__/HorizontalBarChart.test.tsx.snap @@ -416,87 +416,74 @@ exports[`HorizontalBarChart - mouse events Should render callout correctly on mo className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ 2020/04/30
-
- 2020/04/30 -
+ +
19% diff --git a/packages/react-charting/src/components/HorizontalBarChartWithAxis/__snapshots__/HorizontalBarChartWithAxis.test.tsx.snap b/packages/react-charting/src/components/HorizontalBarChartWithAxis/__snapshots__/HorizontalBarChartWithAxis.test.tsx.snap index 047636d3e3e73..f537640fa736f 100644 --- a/packages/react-charting/src/components/HorizontalBarChartWithAxis/__snapshots__/HorizontalBarChartWithAxis.test.tsx.snap +++ b/packages/react-charting/src/components/HorizontalBarChartWithAxis/__snapshots__/HorizontalBarChartWithAxis.test.tsx.snap @@ -1087,37 +1087,32 @@ exports[`HorizontalBarChartWithAxis - mouse events Should render callout correct className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
37% @@ -1125,35 +1120,45 @@ exports[`HorizontalBarChartWithAxis - mouse events Should render callout correct
+ + +
Apples @@ -1162,13 +1167,8 @@ exports[`HorizontalBarChartWithAxis - mouse events Should render callout correct className= { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - color: #00188f; - font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; - font-size: 28px; - font-weight: bold; - line-height: 36px; + flex-shrink: 0; + font-weight: 600; } > 2020/04/30 diff --git a/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap b/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap index 5bfa9e1a48c8d..7ddf80b13278a 100644 --- a/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap +++ b/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap @@ -405,38 +405,32 @@ exports[`LineChart - mouse events Should render callout correctly on mouseover 1 className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+
-
-
- - metaData1 -
-
+ + +
- 50 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style={ + Object { + "marginRight": "24px", + } + } + > + metaData1 +
+
+ 50
diff --git a/packages/react-charting/src/components/LineChart/__snapshots__/LineChartRTL.test.tsx.snap b/packages/react-charting/src/components/LineChart/__snapshots__/LineChartRTL.test.tsx.snap index 1e8b8514ba0ac..08d8b0ad218d7 100644 --- a/packages/react-charting/src/components/LineChart/__snapshots__/LineChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/LineChart/__snapshots__/LineChartRTL.test.tsx.snap @@ -721,38 +721,32 @@ exports[`LineChart - mouse events Should render callout correctly on mouseover 1 className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
-
+
-
-
- - metaData1 -
-
+ + +
- 50 -
+ { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + style={ + Object { + "marginRight": "24px", + } + } + > + metaData1 +
+
+ 50
diff --git a/packages/react-charting/src/components/StackedBarChart/__snapshots__/MultiStackedBarChart.test.tsx.snap b/packages/react-charting/src/components/StackedBarChart/__snapshots__/MultiStackedBarChart.test.tsx.snap index 5d9bc64f1b2a5..17a95493e822e 100644 --- a/packages/react-charting/src/components/StackedBarChart/__snapshots__/MultiStackedBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/StackedBarChart/__snapshots__/MultiStackedBarChart.test.tsx.snap @@ -570,87 +570,74 @@ exports[`MultiStackedBarChart - mouse events Should render callout correctly on className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ 2020/04/30
-
- 2020/04/30 -
+ +
40% diff --git a/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChart.test.tsx.snap b/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChart.test.tsx.snap index 2b3a46ccbecef..b707bbdaf12f1 100644 --- a/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/StackedBarChart/__snapshots__/StackedBarChart.test.tsx.snap @@ -275,87 +275,74 @@ exports[`StackedBarChart - mouse events Should render callout correctly on mouse className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
+ first Lorem ipsum dolor sit amet
-
- first Lorem ipsum dolor sit amet -
+ +
40 diff --git a/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChart.test.tsx.snap b/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChart.test.tsx.snap index 828e8962dccc6..c6c558ee13c2e 100644 --- a/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChart.test.tsx.snap @@ -615,37 +615,32 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
2020/04/30 @@ -653,35 +648,45 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous
+ + +
Second @@ -690,13 +695,8 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous className= { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - color: #002050; - font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; - font-size: 28px; - font-weight: bold; - line-height: 36px; + flex-shrink: 0; + font-weight: 600; } > 20% diff --git a/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChartRTL.test.tsx.snap b/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChartRTL.test.tsx.snap index 7ddc5bc624d93..64d195b98fb12 100644 --- a/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChartRTL.test.tsx.snap +++ b/packages/react-charting/src/components/VerticalBarChart/__snapshots__/VerticalBarChartRTL.test.tsx.snap @@ -3263,37 +3263,32 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
2020/04/30 @@ -3301,35 +3296,45 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous
+ + +
Second @@ -3338,13 +3343,8 @@ exports[`VerticalBarChart - mouse events Should render callout correctly on mous className= { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - color: #002050; - font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; - font-size: 28px; - font-weight: bold; - line-height: 36px; + flex-shrink: 0; + font-weight: 600; } > 20% diff --git a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx index a91183d816c10..b434b6d600632 100644 --- a/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx +++ b/packages/react-charting/src/components/VerticalStackedBarChart/VerticalStackedBarChart.test.tsx @@ -9,6 +9,7 @@ import { IVerticalStackedBarChartProps, VerticalStackedBarChart, IVerticalStackedChartProps, + ChartHoverCardVariant, } from '../../index'; import { IVerticalStackedBarChartState, VerticalStackedBarChartBase } from './VerticalStackedBarChart.base'; import toJson from 'enzyme-to-json'; @@ -320,6 +321,25 @@ describe('VerticalStackedBarChart - mouse events', () => { const tree = toJson(wrapper, { mode: 'deep' }); expect(tree).toMatchSnapshot(); }); + + it('Should render long legend variant of callout correctly on mouseover', async () => { + wrapper = mount( + , + ); + + // Wait for the chart to be resized + await new Promise(resolve => setTimeout(resolve)); + wrapper.update(); + + wrapper.find('rect').at(0).simulate('mouseover'); + const tree = toJson(wrapper, { mode: 'deep' }); + expect(tree).toMatchSnapshot(); + }); }); describe('Render empty chart aria label div when chart is empty', () => { diff --git a/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap b/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap index d2915a27babcf..0516a409ee530 100644 --- a/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap +++ b/packages/react-charting/src/components/VerticalStackedBarChart/__snapshots__/VerticalStackedBarChart.test.tsx.snap @@ -554,37 +554,32 @@ exports[`VerticalStackedBarChart - mouse events Should render callout correctly className= { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; background-blend-mode: normal, luminosity; background-color: #ffffff; - display: grid; - overflow: hidden; - padding-bottom: 10px; + color: #323130; + font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; + font-size: 14px; + font-weight: 400; + padding-bottom: 16px; padding-left: 16px; padding-right: 16px; - padding-top: 11px; + padding-top: 16px; } >
2020/04/30 @@ -592,35 +587,45 @@ exports[`VerticalStackedBarChart - mouse events Should render callout correctly
+ + +
Metadata1 @@ -629,13 +634,8 @@ exports[`VerticalStackedBarChart - mouse events Should render callout correctly className= { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - color: #0078d4; - font-family: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif; - font-size: 28px; - font-weight: bold; - line-height: 36px; + flex-shrink: 0; + font-weight: 600; } > 40% @@ -1914,6 +1914,928 @@ exports[`VerticalStackedBarChart - mouse events Should render customized callout
`; +exports[`VerticalStackedBarChart - mouse events Should render long legend variant of callout correctly on mouseover 1`] = ` +