sag_components 1.0.902 → 1.0.904

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.
@@ -58,20 +58,31 @@ const SingleBarLineCharts = props => {
58
58
  }
59
59
  return null;
60
60
  };
61
- const CustomTooltipBarChart = props => {
61
+ const CustomTooltipBar2Chart = props => {
62
62
  const {
63
63
  active,
64
64
  payload
65
65
  } = props;
66
66
  if (active && payload && payload.length > 0) {
67
- const totalBarValue = data.reduce((sum, item) => sum + (item.barValue || 0), 0);
68
67
  const totalSecondBarValue = data.reduce((sum, item) => sum + (item.secondBarValue || 0), 0);
69
- const currentBarValue = payload[0].payload.barValue;
70
68
  const currentSecondBarValue = payload[0].payload.secondBarValue;
71
69
 
72
70
  // Determine which bar is currently being hovered
73
- const isSecondBar = payload[0].dataKey === 'secondBarValue';
74
- const percentage = isSecondBar ? currentSecondBarValue / totalSecondBarValue * 100 : currentBarValue / totalBarValue * 100;
71
+
72
+ const percentage = currentSecondBarValue / totalSecondBarValue * 100;
73
+ return /*#__PURE__*/_react.default.createElement(_SingleBarLineCharts.CustomTooltip, null, `${percentage.toFixed(1)}%`);
74
+ }
75
+ return null;
76
+ };
77
+ const CustomTooltipBar1Chart = props => {
78
+ const {
79
+ active,
80
+ payload
81
+ } = props;
82
+ if (active && payload && payload.length > 0) {
83
+ const totalBarValue = data.reduce((sum, item) => sum + (item.barValue || 0), 0);
84
+ const currentBarValue = payload[0].payload.barValue;
85
+ const percentage = currentBarValue / totalBarValue * 100;
75
86
  return /*#__PURE__*/_react.default.createElement(_SingleBarLineCharts.CustomTooltip, null, `${percentage.toFixed(1)}%`);
76
87
  }
77
88
  return null;
@@ -252,11 +263,7 @@ const SingleBarLineCharts = props => {
252
263
  y: 0,
253
264
  stroke: "#D0D0D0"
254
265
  }), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
255
- cursor: {
256
- fill: 'transparent'
257
- },
258
- content: CustomTooltipBarChart,
259
- shared: false
266
+ content: CustomTooltipBar1Chart
260
267
  }), /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
261
268
  dataKey: "barValue",
262
269
  barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
@@ -267,11 +274,7 @@ const SingleBarLineCharts = props => {
267
274
  dataKey: "barValue",
268
275
  content: CustomizedLabelBarchart
269
276
  })), /*#__PURE__*/_react.default.createElement(_recharts.Tooltip, {
270
- cursor: {
271
- fill: 'transparent'
272
- },
273
- content: CustomTooltipBarChart,
274
- shared: false
277
+ content: CustomTooltipBar2Chart
275
278
  }), showSecondBar && /*#__PURE__*/_react.default.createElement(_recharts.Bar, {
276
279
  dataKey: "secondBarValue",
277
280
  barSize: barSize !== null && barSize !== void 0 ? barSize : 60,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sag_components",
3
- "version": "1.0.902",
3
+ "version": "1.0.904",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {