sag_components 1.0.896 → 1.0.897
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.
|
@@ -24,6 +24,8 @@ const SingleBarLineCharts = props => {
|
|
|
24
24
|
className,
|
|
25
25
|
width,
|
|
26
26
|
height,
|
|
27
|
+
barSize,
|
|
28
|
+
maxRange,
|
|
27
29
|
barChartHeight,
|
|
28
30
|
lineChartHeight,
|
|
29
31
|
showSecondBar,
|
|
@@ -81,9 +83,8 @@ const SingleBarLineCharts = props => {
|
|
|
81
83
|
x: x + width / 2,
|
|
82
84
|
y: y - radius,
|
|
83
85
|
fontWeight: 400,
|
|
84
|
-
fontSize: "
|
|
85
|
-
textAnchor: "middle"
|
|
86
|
-
dominantBaseline: "middle"
|
|
86
|
+
fontSize: "0.6em",
|
|
87
|
+
textAnchor: "middle"
|
|
87
88
|
}, "0"));
|
|
88
89
|
}
|
|
89
90
|
if (value === null || value === undefined) {
|
|
@@ -91,7 +92,7 @@ const SingleBarLineCharts = props => {
|
|
|
91
92
|
x: x + width / 2,
|
|
92
93
|
y: y - radius,
|
|
93
94
|
fontWeight: 400,
|
|
94
|
-
fontSize: "
|
|
95
|
+
fontSize: "0.6em",
|
|
95
96
|
textAnchor: "middle",
|
|
96
97
|
dominantBaseline: "middle"
|
|
97
98
|
}, "N/A"));
|
|
@@ -100,7 +101,7 @@ const SingleBarLineCharts = props => {
|
|
|
100
101
|
x: x + width / 2,
|
|
101
102
|
y: y - radius,
|
|
102
103
|
fontWeight: 400,
|
|
103
|
-
fontSize: "
|
|
104
|
+
fontSize: "0.6em",
|
|
104
105
|
textAnchor: "middle",
|
|
105
106
|
dominantBaseline: "middle"
|
|
106
107
|
}, `${currencySign}${(0, _CommonFunctions.getFormattedValue)(value)}${(0, _CommonFunctions.getFormattedUnits)(value)}${isTopBarPercent ? '%' : ''}`));
|
|
@@ -126,9 +127,6 @@ const SingleBarLineCharts = props => {
|
|
|
126
127
|
if (data && data.length > 0 && payload) {
|
|
127
128
|
const retailerData = data.filter(item => item.retailer === payload.value);
|
|
128
129
|
if (retailerData && retailerData.length > 0) {
|
|
129
|
-
const {
|
|
130
|
-
offerType
|
|
131
|
-
} = retailerData[0];
|
|
132
130
|
return /*#__PURE__*/_react.default.createElement("g", {
|
|
133
131
|
transform: `translate(${x},${y})`
|
|
134
132
|
// onMouseEnter={() => handleMouseEnter(offerType)}
|
|
@@ -142,12 +140,17 @@ const SingleBarLineCharts = props => {
|
|
|
142
140
|
}, /*#__PURE__*/_react.default.createElement(_SingleBarLineCharts.LabelBoldText, {
|
|
143
141
|
textAnchor: "middle",
|
|
144
142
|
x: "0",
|
|
145
|
-
dy: "
|
|
146
|
-
fontWeight:
|
|
147
|
-
}, retailerData[0].retailer), showPeriod && /*#__PURE__*/_react.default.createElement(
|
|
143
|
+
dy: "30",
|
|
144
|
+
fontWeight: 500
|
|
145
|
+
}, retailerData[0].retailer)), showPeriod && /*#__PURE__*/_react.default.createElement("text", {
|
|
146
|
+
x: 0,
|
|
147
|
+
y: 0,
|
|
148
|
+
dy: 16,
|
|
149
|
+
fill: "#212121"
|
|
150
|
+
}, /*#__PURE__*/_react.default.createElement(_SingleBarLineCharts.LabelText, {
|
|
148
151
|
textAnchor: "middle",
|
|
149
152
|
x: "0",
|
|
150
|
-
dy: "
|
|
153
|
+
dy: "50",
|
|
151
154
|
fontSize: 14,
|
|
152
155
|
fontWeight: 400
|
|
153
156
|
}, retailerData[0].period)));
|
|
@@ -169,7 +172,7 @@ const SingleBarLineCharts = props => {
|
|
|
169
172
|
dy: -8,
|
|
170
173
|
fill: stroke,
|
|
171
174
|
fontWeight: isLineChartBolded ? 600 : 400,
|
|
172
|
-
fontSize:
|
|
175
|
+
fontSize: "0.6em",
|
|
173
176
|
textAnchor: "middle"
|
|
174
177
|
}, `${value}${isLineChartPercent ? '%' : ''}`);
|
|
175
178
|
};
|
|
@@ -212,19 +215,23 @@ const SingleBarLineCharts = props => {
|
|
|
212
215
|
left: 30,
|
|
213
216
|
bottom: 5
|
|
214
217
|
}
|
|
215
|
-
}, /*#__PURE__*/_react.default.createElement(_recharts.
|
|
216
|
-
stroke: "#D0D0D0",
|
|
217
|
-
strokeDasharray: "5 4",
|
|
218
|
-
vertical: false
|
|
219
|
-
}), /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
218
|
+
}, /*#__PURE__*/_react.default.createElement(_recharts.XAxis, {
|
|
220
219
|
dataKey: "retailer",
|
|
221
220
|
tick: CustomizedTickBarChart,
|
|
222
221
|
tickLine: false,
|
|
223
222
|
height: 120,
|
|
224
223
|
stroke: "#D0D0D0",
|
|
225
|
-
fill: "#212121"
|
|
224
|
+
fill: "#212121",
|
|
225
|
+
allowDataOverflow: true
|
|
226
|
+
}), /*#__PURE__*/_react.default.createElement(_recharts.YAxis, {
|
|
227
|
+
type: "number",
|
|
228
|
+
width: 0,
|
|
229
|
+
display: "none",
|
|
230
|
+
domain: [0, dataMax => dataMax * maxRange],
|
|
231
|
+
allowDataOverflow: true
|
|
226
232
|
}), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
227
233
|
dataKey: "barValue",
|
|
234
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
228
235
|
fill: (_legendData$filter$ = legendData.filter(item => item.iconType === 'Square')[0]) === null || _legendData$filter$ === void 0 ? void 0 : _legendData$filter$.iconColor,
|
|
229
236
|
radius: [4, 4, 0, 0]
|
|
230
237
|
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
@@ -233,6 +240,7 @@ const SingleBarLineCharts = props => {
|
|
|
233
240
|
content: CustomizedLabelBarchart
|
|
234
241
|
})), showSecondBar && /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
|
|
235
242
|
dataKey: "secondBarValue",
|
|
243
|
+
barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
|
|
236
244
|
fill: (_legendData$filter$2 = legendData.filter(item => item.iconType === 'Square')[1]) === null || _legendData$filter$2 === void 0 ? void 0 : _legendData$filter$2.iconColor,
|
|
237
245
|
radius: [4, 4, 0, 0]
|
|
238
246
|
}, /*#__PURE__*/_react.default.createElement(_recharts.LabelList, {
|
|
@@ -257,11 +265,13 @@ SingleBarLineCharts.defaultProps = {
|
|
|
257
265
|
className: '',
|
|
258
266
|
width: '100%',
|
|
259
267
|
height: '100%',
|
|
268
|
+
barSize: 60,
|
|
260
269
|
barChartHeight: 250,
|
|
261
270
|
lineChartHeight: 50,
|
|
262
271
|
isLineChartPercent: false,
|
|
263
272
|
isLineChartBolded: false,
|
|
264
273
|
isTopBarPercent: true,
|
|
274
|
+
maxRange: 1,
|
|
265
275
|
showPeriod: true,
|
|
266
276
|
currencySign: '€',
|
|
267
277
|
showSecondBar: true,
|