@fluentui/react-charting 5.14.24 → 5.14.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +22 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-charting.js +1 -1
- package/dist/react-charting.min.js +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js +13 -8
- package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.styles.js +20 -13
- package/lib/components/HorizontalBarChart/HorizontalBarChart.styles.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +8 -0
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js +7 -10
- package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.styles.js +16 -5
- package/lib/components/StackedBarChart/MultiStackedBarChart.styles.js.map +1 -1
- package/lib/components/StackedBarChart/MultiStackedBarChart.types.d.ts +8 -0
- package/lib/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.base.js +6 -8
- package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.styles.js +26 -23
- package/lib/components/StackedBarChart/StackedBarChart.styles.js.map +1 -1
- package/lib/components/StackedBarChart/StackedBarChart.types.d.ts +4 -0
- package/lib/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js +13 -8
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.styles.js +19 -12
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.styles.js.map +1 -1
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +8 -0
- package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js +7 -10
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.styles.js +15 -4
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.styles.js.map +1 -1
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.d.ts +8 -0
- package/lib-amd/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js +6 -8
- package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.styles.js +26 -23
- package/lib-amd/components/StackedBarChart/StackedBarChart.styles.js.map +1 -1
- package/lib-amd/components/StackedBarChart/StackedBarChart.types.d.ts +4 -0
- package/lib-amd/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js +13 -8
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.styles.js +19 -12
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.styles.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.d.ts +8 -0
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js +7 -10
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.styles.js +15 -4
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.styles.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.d.ts +8 -0
- package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.types.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js +6 -8
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.styles.js +26 -23
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.styles.js.map +1 -1
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.types.d.ts +4 -0
- package/lib-commonjs/components/StackedBarChart/StackedBarChart.types.js.map +1 -1
- package/package.json +1 -1
- package/src/components/HorizontalBarChart/HorizontalBarChart.types.ts +11 -0
- package/src/components/StackedBarChart/MultiStackedBarChart.types.ts +10 -0
- package/src/components/StackedBarChart/StackedBarChart.types.ts +5 -0
|
@@ -5,7 +5,7 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var Styling_1 = require("@fluentui/react/lib/Styling");
|
|
6
6
|
var getStyles = function (props) {
|
|
7
7
|
var _a, _b;
|
|
8
|
-
var className = props.className, width = props.width, barHeight = props.barHeight, shouldHighlight = props.shouldHighlight, theme = props.theme, href = props.href, benchmarkColor = props.benchmarkColor, benchmarkRatio = props.benchmarkRatio, targetColor = props.targetColor, targetRatio = props.targetRatio;
|
|
8
|
+
var className = props.className, width = props.width, barHeight = props.barHeight, shouldHighlight = props.shouldHighlight, theme = props.theme, href = props.href, benchmarkColor = props.benchmarkColor, benchmarkRatio = props.benchmarkRatio, targetColor = props.targetColor, targetRatio = props.targetRatio, showTriangle = props.showTriangle;
|
|
9
9
|
return {
|
|
10
10
|
root: [
|
|
11
11
|
theme.fonts.medium,
|
|
@@ -19,16 +19,18 @@ var getStyles = function (props) {
|
|
|
19
19
|
],
|
|
20
20
|
chart: {
|
|
21
21
|
width: '100%',
|
|
22
|
-
height: barHeight ? barHeight :
|
|
23
|
-
|
|
22
|
+
height: barHeight ? barHeight : 12,
|
|
23
|
+
display: 'block',
|
|
24
|
+
marginBottom: showTriangle ? '16px' : '10px',
|
|
24
25
|
},
|
|
25
|
-
chartTitle: tslib_1.__assign(tslib_1.__assign({}, theme.fonts.small), { display: 'flex', justifyContent: 'space-between'
|
|
26
|
+
chartTitle: tslib_1.__assign(tslib_1.__assign({}, theme.fonts.small), { display: 'flex', justifyContent: 'space-between' }),
|
|
26
27
|
chartTitleLeft: {
|
|
27
|
-
fontWeight: Styling_1.FontWeights.bold,
|
|
28
28
|
textOverflow: 'ellipsis',
|
|
29
29
|
overflow: 'hidden',
|
|
30
30
|
whiteSpace: 'nowrap',
|
|
31
31
|
display: 'block',
|
|
32
|
+
color: '#171717',
|
|
33
|
+
marginBottom: '5px',
|
|
32
34
|
},
|
|
33
35
|
legendContainer: {
|
|
34
36
|
margin: '4px 0px 0px 4px',
|
|
@@ -46,34 +48,35 @@ var getStyles = function (props) {
|
|
|
46
48
|
},
|
|
47
49
|
},
|
|
48
50
|
ratioNumerator: {
|
|
49
|
-
fontSize: Styling_1.FontSizes.
|
|
51
|
+
fontSize: Styling_1.FontSizes.medium,
|
|
50
52
|
fontWeight: Styling_1.FontWeights.semibold,
|
|
51
|
-
color: theme.palette.
|
|
53
|
+
color: theme.palette.neutralPrimary,
|
|
52
54
|
},
|
|
53
55
|
ratioDenominator: {
|
|
54
|
-
fontSize: Styling_1.FontSizes.
|
|
55
|
-
color: theme.palette.
|
|
56
|
-
opacity: '0.6',
|
|
56
|
+
fontSize: Styling_1.FontSizes.medium,
|
|
57
|
+
color: theme.palette.neutralPrimary,
|
|
57
58
|
},
|
|
58
59
|
benchmarkContainer: {
|
|
59
60
|
position: 'relative',
|
|
60
|
-
height: '
|
|
61
|
+
height: '7px',
|
|
62
|
+
marginTop: '-3px',
|
|
63
|
+
marginBottom: '-1px',
|
|
61
64
|
},
|
|
62
65
|
benchmark: {
|
|
63
66
|
position: 'absolute',
|
|
64
|
-
left: 'calc(' + benchmarkRatio + '% -
|
|
67
|
+
left: 'calc(' + benchmarkRatio + '% - 4px)',
|
|
65
68
|
width: '0',
|
|
66
69
|
height: '0',
|
|
67
|
-
borderLeft: '
|
|
68
|
-
borderRight: '
|
|
69
|
-
borderTop: '
|
|
70
|
+
borderLeft: '4px solid transparent',
|
|
71
|
+
borderRight: '4px solid transparent',
|
|
72
|
+
borderTop: '7px solid',
|
|
70
73
|
borderTopColor: benchmarkColor,
|
|
71
74
|
marginBottom: '4px',
|
|
72
75
|
selectors: (_a = {},
|
|
73
76
|
_a[Styling_1.HighContrastSelector] = {
|
|
74
77
|
border: '0px',
|
|
75
|
-
height: '
|
|
76
|
-
width: '
|
|
78
|
+
height: '7px',
|
|
79
|
+
width: '7px',
|
|
77
80
|
clipPath: 'polygon(50% 100%, 0 0, 100% 0)',
|
|
78
81
|
backgroundImage: "linear-gradient(to right, " + benchmarkColor + ", " + benchmarkColor + ")",
|
|
79
82
|
},
|
|
@@ -81,19 +84,19 @@ var getStyles = function (props) {
|
|
|
81
84
|
},
|
|
82
85
|
target: {
|
|
83
86
|
position: 'absolute',
|
|
84
|
-
left: 'calc(' + targetRatio + '% -
|
|
87
|
+
left: 'calc(' + targetRatio + '% - 4px)',
|
|
85
88
|
width: '0',
|
|
86
89
|
height: '0',
|
|
87
|
-
borderLeft: '
|
|
88
|
-
borderRight: '
|
|
89
|
-
borderTop: '
|
|
90
|
+
borderLeft: '4px solid transparent',
|
|
91
|
+
borderRight: '4px solid transparent',
|
|
92
|
+
borderTop: '7px solid',
|
|
90
93
|
borderTopColor: targetColor,
|
|
91
94
|
marginBottom: '4px',
|
|
92
95
|
selectors: (_b = {},
|
|
93
96
|
_b[Styling_1.HighContrastSelector] = {
|
|
94
97
|
border: '0px',
|
|
95
|
-
height: '
|
|
96
|
-
width: '
|
|
98
|
+
height: '7px',
|
|
99
|
+
width: '7px',
|
|
97
100
|
clipPath: 'polygon(50% 100%, 0 0, 100% 0)',
|
|
98
101
|
backgroundImage: "linear-gradient(to right, " + targetColor + ", " + targetColor + ")",
|
|
99
102
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackedBarChart.styles.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.styles.ts"],"names":[],"mappings":";;;;AACA,uDAAmG;AAE5F,IAAM,SAAS,GAAG,UAAC,KAAiC;;IAEvD,IAAA,SAAS,
|
|
1
|
+
{"version":3,"file":"StackedBarChart.styles.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.styles.ts"],"names":[],"mappings":";;;;AACA,uDAAmG;AAE5F,IAAM,SAAS,GAAG,UAAC,KAAiC;;IAEvD,IAAA,SAAS,GAWP,KAAK,UAXE,EACT,KAAK,GAUH,KAAK,MAVF,EACL,SAAS,GASP,KAAK,UATE,EACT,eAAe,GAQb,KAAK,gBARQ,EACf,KAAK,GAOH,KAAK,MAPF,EACL,IAAI,GAMF,KAAK,KANH,EACJ,cAAc,GAKZ,KAAK,eALO,EACd,cAAc,GAIZ,KAAK,eAJO,EACd,WAAW,GAGT,KAAK,YAHI,EACX,WAAW,GAET,KAAK,YAFI,EACX,YAAY,GACV,KAAK,aADK,CACJ;IACV,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,KAAK,CAAC,MAAM;YAClB,oBAAoB;YACpB;gBACE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;gBAC7B,OAAO,EAAE,MAAM;gBACf,aAAa,EAAE,QAAQ;aACxB;YACD,SAAS;SACV;QACD,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;YAClC,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;SAC7C;QACD,UAAU,wCACL,KAAK,CAAC,KAAK,CAAC,KAAK,KACpB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,eAAe,GAChC;QACD,cAAc,EAAE;YACd,YAAY,EAAE,UAAU;YACxB,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;YAChB,YAAY,EAAE,KAAK;SACpB;QACD,eAAe,EAAE;YACf,MAAM,EAAE,iBAAiB;SAC1B;QACD,oBAAoB,EAAE;YACpB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;YACrC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACpC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;YAC3B,WAAW,EAAE,CAAC;YACd,SAAS,EAAE;gBACT,SAAS,EAAE;oBACT,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;oBAC3B,WAAW,EAAE,KAAK;iBACnB;aACF;SACF;QACD,cAAc,EAAE;YACd,QAAQ,EAAE,mBAAS,CAAC,MAAM;YAC1B,UAAU,EAAE,qBAAW,CAAC,QAAQ;YAChC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;SACpC;QACD,gBAAgB,EAAE;YAChB,QAAQ,EAAE,mBAAS,CAAC,MAAM;YAC1B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;SACpC;QACD,kBAAkB,EAAE;YAClB,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,MAAM;YACjB,YAAY,EAAE,MAAM;SACrB;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU;YAC3C,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,UAAU,EAAE,uBAAuB;YACnC,WAAW,EAAE,uBAAuB;YACpC,SAAS,EAAE,WAAW;YACtB,cAAc,EAAE,cAAc;YAC9B,YAAY,EAAE,KAAK;YACnB,SAAS;gBACP,GAAC,8BAAoB,IAAG;oBACtB,MAAM,EAAE,KAAK;oBACb,MAAM,EAAE,KAAK;oBACb,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,gCAAgC;oBAC1C,eAAe,EAAE,+BAA6B,cAAc,UAAK,cAAc,MAAG;iBACzE;mBACZ;SACF;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU;YACxC,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;YACX,UAAU,EAAE,uBAAuB;YACnC,WAAW,EAAE,uBAAuB;YACpC,SAAS,EAAE,WAAW;YACtB,cAAc,EAAE,WAAW;YAC3B,YAAY,EAAE,KAAK;YACnB,SAAS;gBACP,GAAC,8BAAoB,IAAG;oBACtB,MAAM,EAAE,KAAK;oBACb,MAAM,EAAE,KAAK;oBACb,KAAK,EAAE,KAAK;oBACZ,QAAQ,EAAE,gCAAgC;oBAC1C,eAAe,EAAE,+BAA6B,WAAW,UAAK,WAAW,MAAG;iBACnE;mBACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAnHW,QAAA,SAAS,aAmHpB","sourcesContent":["import { IStackedBarChartStyleProps, IStackedBarChartStyles } from './StackedBarChart.types';\nimport { FontSizes, FontWeights, HighContrastSelector, IStyle } from '@fluentui/react/lib/Styling';\n\nexport const getStyles = (props: IStackedBarChartStyleProps): IStackedBarChartStyles => {\n const {\n className,\n width,\n barHeight,\n shouldHighlight,\n theme,\n href,\n benchmarkColor,\n benchmarkRatio,\n targetColor,\n targetRatio,\n showTriangle,\n } = props;\n return {\n root: [\n theme.fonts.medium,\n 'ms-StackedBarChart',\n {\n width: width ? width : '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n className,\n ],\n chart: {\n width: '100%',\n height: barHeight ? barHeight : 12,\n display: 'block',\n marginBottom: showTriangle ? '16px' : '10px',\n },\n chartTitle: {\n ...theme.fonts.small,\n display: 'flex',\n justifyContent: 'space-between',\n },\n chartTitleLeft: {\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n display: 'block',\n color: '#171717',\n marginBottom: '5px',\n },\n legendContainer: {\n margin: '4px 0px 0px 4px',\n },\n opacityChangeOnHover: {\n opacity: shouldHighlight ? '' : '0.1',\n cursor: href ? 'pointer' : 'default',\n stroke: theme.palette.white,\n strokeWidth: 2,\n selectors: {\n '&:focus': {\n stroke: theme.palette.black,\n strokeWidth: '2px',\n },\n },\n },\n ratioNumerator: {\n fontSize: FontSizes.medium,\n fontWeight: FontWeights.semibold,\n color: theme.palette.neutralPrimary,\n },\n ratioDenominator: {\n fontSize: FontSizes.medium,\n color: theme.palette.neutralPrimary,\n },\n benchmarkContainer: {\n position: 'relative',\n height: '7px',\n marginTop: '-3px',\n marginBottom: '-1px',\n },\n benchmark: {\n position: 'absolute',\n left: 'calc(' + benchmarkRatio + '% - 4px)',\n width: '0',\n height: '0',\n borderLeft: '4px solid transparent',\n borderRight: '4px solid transparent',\n borderTop: '7px solid',\n borderTopColor: benchmarkColor,\n marginBottom: '4px',\n selectors: {\n [HighContrastSelector]: {\n border: '0px',\n height: '7px',\n width: '7px',\n clipPath: 'polygon(50% 100%, 0 0, 100% 0)',\n backgroundImage: `linear-gradient(to right, ${benchmarkColor}, ${benchmarkColor})`,\n } as IStyle,\n },\n },\n target: {\n position: 'absolute',\n left: 'calc(' + targetRatio + '% - 4px)',\n width: '0',\n height: '0',\n borderLeft: '4px solid transparent',\n borderRight: '4px solid transparent',\n borderTop: '7px solid',\n borderTopColor: targetColor,\n marginBottom: '4px',\n selectors: {\n [HighContrastSelector]: {\n border: '0px',\n height: '7px',\n width: '7px',\n clipPath: 'polygon(50% 100%, 0 0, 100% 0)',\n backgroundImage: `linear-gradient(to right, ${targetColor}, ${targetColor})`,\n } as IStyle,\n },\n },\n };\n};\n"]}
|
|
@@ -157,6 +157,10 @@ export interface IStackedBarChartStyleProps {
|
|
|
157
157
|
* the ratio position for the target triangle
|
|
158
158
|
*/
|
|
159
159
|
targetRatio?: number;
|
|
160
|
+
/**
|
|
161
|
+
* prop to check if benchmark data or target data is provided
|
|
162
|
+
*/
|
|
163
|
+
showTriangle?: boolean;
|
|
160
164
|
}
|
|
161
165
|
export interface IStackedBarChartStyles {
|
|
162
166
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\nexport interface IStackedBarChart {}\nimport { IChartProps, IChartDataPoint } from './index';\n\nexport interface IStackedBarChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\n\n /**\n * Benchmark Data to render in the chart.\n */\n benchmarkData?: IChartDataPoint;\n\n /**\n * Target Data to render in the chart.\n */\n targetData?: IChartDataPoint;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Do not show the legend at the bottom of chart\n * when there are more than two datapoints\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show number/ratio on top of bar\n *\n * @default false\n */\n hideNumberDisplay?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IStackedBarChartStyleProps, IStackedBarChartStyles>;\n\n /**\n * Color setting of bar background color, this will show while all data points value is 0\n */\n barBackgroundColor?: string;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set, the fixed display pattern for less than 2 data points chart will be ignore\n */\n ignoreFixStyle?: boolean;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n */\n hideDenominator?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /**\n * overflow props for the legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\nexport interface IStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of bar in the chart.\n */\n barHeight?: number;\n\n /**\n * prop to show data of the chart with appropriate legend color\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check which specific section of the stacked bar chart is selected or hovered upon\n */\n isChartSelected?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * the color for the benchmark triangle\n */\n benchmarkColor?: string;\n\n /**\n * the ratio position for the benchmark triangle\n */\n benchmarkRatio?: number;\n\n /**\n * the color for the target triangle\n */\n targetColor?: string;\n\n /**\n * the ratio position for the target triangle\n */\n targetRatio?: number;\n}\n\nexport interface IStackedBarChartStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * Style for the chart.\n */\n chart: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style for the legend container div\n */\n legendContainer: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: IStyle;\n\n /**\n * Style for the benchmark triangle\n */\n benchmark: IStyle;\n\n /**\n * Style for the target triangle\n */\n target: IStyle;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StackedBarChart.types.js","sourceRoot":"../src/","sources":["components/StackedBarChart/StackedBarChart.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { ICalloutProps } from '@fluentui/react/lib/Callout';\nimport { IRenderFunction, IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\nimport { IOverflowSetProps } from '@fluentui/react/lib/OverflowSet';\nimport { IFocusZoneProps } from '@fluentui/react-focus';\nimport { ILegendsProps } from '../Legends/index';\n\nexport interface IStackedBarChart {}\nimport { IChartProps, IChartDataPoint } from './index';\n\nexport interface IStackedBarChartProps {\n /**\n * Data to render in the chart.\n */\n data?: IChartProps;\n\n /**\n * Benchmark Data to render in the chart.\n */\n benchmarkData?: IChartDataPoint;\n\n /**\n * Target Data to render in the chart.\n */\n targetData?: IChartDataPoint;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of each bar in the chart.\n */\n barHeight?: number;\n\n /**\n * Do not show the legend at the bottom of chart\n * when there are more than two datapoints\n *\n * @default false\n */\n hideLegend?: boolean;\n\n /**\n * Do not show number/ratio on top of bar\n *\n * @default false\n */\n hideNumberDisplay?: boolean;\n\n /**\n * Do not show tooltips in chart\n *\n * @default false\n */\n hideTooltip?: boolean;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IStackedBarChartStyleProps, IStackedBarChartStyles>;\n\n /**\n * Color setting of bar background color, this will show while all data points value is 0\n */\n barBackgroundColor?: string;\n\n /**\n * Url that the data-viz needs to redirect to upon clicking on it\n */\n href?: string;\n\n /**\n * If this value is set, the fixed display pattern for less than 2 data points chart will be ignore\n */\n ignoreFixStyle?: boolean;\n\n /**\n * If this value is set to true the denominator will not be shown for the ratio above the chart\n */\n hideDenominator?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledLegendsWrapLines?: boolean;\n\n /**\n * overflow props for the legend\n */\n legendsOverflowProps?: Partial<IOverflowSetProps>;\n\n /**\n * text for overflow legends string\n */\n legendsOverflowText?: string;\n\n /**\n * focus zone props in hover card for legends\n */\n focusZonePropsForLegendsInHoverCard?: IFocusZoneProps;\n\n /**\n * props for the legends in the chart\n */\n legendProps?: Partial<ILegendsProps>;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: IRenderFunction<IChartDataPoint>;\n\n /**\n * props for the callout in the chart\n */\n calloutProps?: Partial<ICalloutProps>;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n}\n\nexport interface IStackedBarChartStyleProps {\n /**\n * Theme (provided through customization.)\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es) to apply to the StackedBarChart.\n */\n className?: string;\n\n /**\n * Width of the chart.\n */\n width?: number;\n\n /**\n * Height of bar in the chart.\n */\n barHeight?: number;\n\n /**\n * prop to show data of the chart with appropriate legend color\n */\n legendColor?: string;\n\n /**\n * prop to check if the chart is selcted or hovered upon to determine opacity\n */\n shouldHighlight?: boolean;\n\n /**\n * prop to check which specific section of the stacked bar chart is selected or hovered upon\n */\n isChartSelected?: boolean;\n\n /**\n * prop to check to decide cursor type\n */\n href?: string;\n\n /**\n * the color for the benchmark triangle\n */\n benchmarkColor?: string;\n\n /**\n * the ratio position for the benchmark triangle\n */\n benchmarkRatio?: number;\n\n /**\n * the color for the target triangle\n */\n targetColor?: string;\n\n /**\n * the ratio position for the target triangle\n */\n targetRatio?: number;\n\n /**\n * prop to check if benchmark data or target data is provided\n */\n showTriangle?: boolean;\n}\n\nexport interface IStackedBarChartStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n\n /**\n * Style for the chart.\n */\n chart: IStyle;\n\n /**\n * Style for the chart Title.\n */\n chartTitle: IStyle;\n\n /**\n * Style for left side text of the chart title\n */\n chartTitleLeft: IStyle;\n\n /**\n * Style for the legend container div\n */\n legendContainer: IStyle;\n\n /**\n * Style to change the opacity of bars in dataviz when we hover on a single bar or legends\n */\n opacityChangeOnHover: IStyle;\n\n /**\n * Style for the chart ratio numerator\n */\n ratioNumerator: IStyle;\n\n /**\n * Style for the chart ratio denominator\n */\n ratioDenominator: IStyle;\n\n /**\n * Style for the benchmark container\n */\n benchmarkContainer: IStyle;\n\n /**\n * Style for the benchmark triangle\n */\n benchmark: IStyle;\n\n /**\n * Style for the target triangle\n */\n target: IStyle;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -104,6 +104,11 @@ export interface IHorizontalBarChartStyleProps {
|
|
|
104
104
|
* @default 15
|
|
105
105
|
*/
|
|
106
106
|
barHeight?: number;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* prop to check if benchmark data is provided
|
|
110
|
+
*/
|
|
111
|
+
showTriangle?: boolean;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
export interface IHorizontalBarChartStyles {
|
|
@@ -116,6 +121,7 @@ export interface IHorizontalBarChartStyles {
|
|
|
116
121
|
* Styling for each item in the container
|
|
117
122
|
*/
|
|
118
123
|
items: IStyle;
|
|
124
|
+
|
|
119
125
|
/**
|
|
120
126
|
* Style for the chart.
|
|
121
127
|
*/
|
|
@@ -146,6 +152,11 @@ export interface IHorizontalBarChartStyles {
|
|
|
146
152
|
*/
|
|
147
153
|
chartDataTextDenominator: IStyle;
|
|
148
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Style for the benchmark container
|
|
157
|
+
*/
|
|
158
|
+
benchmarkContainer: IStyle;
|
|
159
|
+
|
|
149
160
|
/**
|
|
150
161
|
* Style for the benchmark triangle
|
|
151
162
|
*/
|
|
@@ -178,6 +178,16 @@ export interface IMultiStackedBarChartStyles {
|
|
|
178
178
|
*/
|
|
179
179
|
opacityChangeOnHover: IStyle;
|
|
180
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Style for the chart ratio numerator
|
|
183
|
+
*/
|
|
184
|
+
ratioNumerator: IStyle;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Style for the chart ratio denominator
|
|
188
|
+
*/
|
|
189
|
+
ratioDenominator: IStyle;
|
|
190
|
+
|
|
181
191
|
/**
|
|
182
192
|
* Style to change the opacity of placeholder data point when we hover a single bar or legend
|
|
183
193
|
*/
|
|
@@ -192,6 +192,11 @@ export interface IStackedBarChartStyleProps {
|
|
|
192
192
|
* the ratio position for the target triangle
|
|
193
193
|
*/
|
|
194
194
|
targetRatio?: number;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* prop to check if benchmark data or target data is provided
|
|
198
|
+
*/
|
|
199
|
+
showTriangle?: boolean;
|
|
195
200
|
}
|
|
196
201
|
|
|
197
202
|
export interface IStackedBarChartStyles {
|