@fluentui/react-charts 9.3.2 → 9.3.4

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.
Files changed (145) hide show
  1. package/CHANGELOG.md +47 -2
  2. package/dist/index.d.ts +151 -1
  3. package/lib/components/AreaChart/AreaChart.js +208 -60
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/ChartTable/ChartTable.js +14 -12
  6. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  7. package/lib/components/ChartTable/useChartTableStyles.styles.js +3 -3
  8. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  9. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +2 -2
  10. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  11. package/lib/components/CommonComponents/CartesianChart.js +5 -6
  12. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  13. package/lib/components/CommonComponents/ChartPopover.js +2 -1
  14. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  15. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  16. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +3 -2
  17. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  18. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +2 -1
  19. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  20. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +3 -2
  21. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  22. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +2 -1
  23. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  24. package/lib/components/DeclarativeChart/DeclarativeChart.js +16 -7
  25. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  26. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +63 -18
  27. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  28. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +471 -207
  29. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  30. package/lib/components/DonutChart/Arc/Arc.js +8 -7
  31. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  32. package/lib/components/DonutChart/DonutChart.js +16 -32
  33. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  34. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  35. package/lib/components/DonutChart/Pie/Pie.js +4 -4
  36. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  37. package/lib/components/DonutChart/useDonutChartStyles.styles.js +3 -2
  38. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  39. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +2 -1
  40. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  41. package/lib/components/FunnelChart/FunnelChart.js +23 -45
  42. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  43. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +3 -2
  44. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  45. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +2 -1
  46. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  47. package/lib/components/GaugeChart/GaugeChart.js +21 -46
  48. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  49. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +3 -2
  50. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  51. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -1
  52. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  53. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +332 -114
  54. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  55. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  56. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +3 -2
  57. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  58. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  59. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  60. package/lib/components/Legends/Legends.js +1 -1
  61. package/lib/components/Legends/Legends.js.map +1 -1
  62. package/lib/components/LineChart/LineChart.js +145 -97
  63. package/lib/components/LineChart/LineChart.js.map +1 -1
  64. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +3 -2
  65. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  66. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -1
  67. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  68. package/lib/components/ScatterChart/ScatterChart.js +7 -11
  69. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  70. package/lib/types/DataPoint.js +1 -3
  71. package/lib/types/DataPoint.js.map +1 -1
  72. package/lib/utilities/utilities.js +77 -26
  73. package/lib/utilities/utilities.js.map +1 -1
  74. package/lib-commonjs/components/AreaChart/AreaChart.js +207 -59
  75. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  76. package/lib-commonjs/components/ChartTable/ChartTable.js +13 -12
  77. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  78. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +3 -3
  79. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  80. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +2 -2
  81. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  82. package/lib-commonjs/components/CommonComponents/CartesianChart.js +5 -6
  83. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  84. package/lib-commonjs/components/CommonComponents/ChartPopover.js +2 -1
  85. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  86. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  87. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +7 -1
  88. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  89. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +2 -1
  90. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  91. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +7 -1
  92. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  93. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +2 -1
  94. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  95. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +16 -7
  96. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  97. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +65 -18
  98. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  99. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +470 -206
  100. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  101. package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -7
  102. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  103. package/lib-commonjs/components/DonutChart/DonutChart.js +16 -32
  104. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  105. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  106. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -4
  107. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  108. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +7 -1
  109. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  110. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +2 -1
  111. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  112. package/lib-commonjs/components/FunnelChart/FunnelChart.js +23 -45
  113. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  114. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +7 -1
  115. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  116. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +2 -1
  117. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  118. package/lib-commonjs/components/GaugeChart/GaugeChart.js +21 -46
  119. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  120. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +7 -1
  121. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  122. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -1
  123. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  124. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +329 -112
  125. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  126. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
  127. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +7 -1
  128. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  129. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  130. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  131. package/lib-commonjs/components/Legends/Legends.js +1 -1
  132. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  133. package/lib-commonjs/components/LineChart/LineChart.js +144 -96
  134. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  135. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +7 -1
  136. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  137. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -1
  138. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  139. package/lib-commonjs/components/ScatterChart/ScatterChart.js +6 -10
  140. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  141. package/lib-commonjs/types/DataPoint.js +1 -3
  142. package/lib-commonjs/types/DataPoint.js.map +1 -1
  143. package/lib-commonjs/utilities/utilities.js +80 -26
  144. package/lib-commonjs/utilities/utilities.js.map +1 -1
  145. package/package.json +13 -13
@@ -19,6 +19,7 @@ const _reactutilities = require("@fluentui/react-utilities");
19
19
  const _index = require("../../utilities/index");
20
20
  const _index1 = require("../../index");
21
21
  const _imageexportutils = require("../../utilities/image-export-utils");
22
+ const _reacttheme = require("@fluentui/react-theme");
22
23
  const MIN_DOMAIN_MARGIN = 8;
23
24
  const X1_INNER_PADDING = 0.1;
24
25
  const VERTICAL_BAR_GAP = 1;
@@ -49,26 +50,27 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
49
50
  let _groupWidth = 0;
50
51
  let _xAxisInnerPadding = 0;
51
52
  let _xAxisOuterPadding = 0;
52
- let _legends = [];
53
+ let _barLegends = [];
54
+ let _lineLegends = [];
53
55
  let _legendColorMap = {};
54
56
  const cartesianChartRef = _react.useRef(null);
55
57
  const Y_ORIGIN = 0;
56
58
  const _legendsRef = _react.useRef(null);
59
+ const _rectRef = _react.useRef(null);
60
+ const _uniqDotId = (0, _reactutilities.useId)('gvbc_dot_');
57
61
  const [color, setColor] = _react.useState('');
58
62
  const [dataForHoverCard, setDataForHoverCard] = _react.useState(0);
59
63
  const [selectedLegends, setSelectedLegends] = _react.useState(((_props_legendProps = props.legendProps) === null || _props_legendProps === void 0 ? void 0 : _props_legendProps.selectedLegends) || []);
60
64
  const [xCalloutValue, setXCalloutValue] = _react.useState('');
61
65
  const [yCalloutValue, setYCalloutValue] = _react.useState('');
62
- const [YValueHover, setYValueHover] = _react.useState([]);
66
+ const [yValueHover, setYValueHover] = _react.useState([]);
63
67
  const [hoverXValue, setHoverXValue] = _react.useState('');
64
68
  const [calloutLegend, setCalloutLegend] = _react.useState('');
65
69
  const [activeLegend, setActiveLegend] = _react.useState('');
66
70
  const [callOutAccessibilityData, setCallOutAccessibilityData] = _react.useState(undefined);
67
- const [clickPosition, setClickPosition] = _react.useState({
68
- x: 0,
69
- y: 0
70
- });
71
+ const [popoverTarget, setPopoverTarget] = _react.useState(null);
71
72
  const [isPopoverOpen, setPopoverOpen] = _react.useState(false);
73
+ const [activeLinePoint, setActiveLinePoint] = _react.useState('');
72
74
  const classes = (0, _useGroupedVerticalBarChartStylesstyles.useGroupedVerticalBarChartStyles_unstable)(props);
73
75
  _react.useEffect(()=>{
74
76
  var _props_legendProps;
@@ -94,14 +96,30 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
94
96
  _barWidth = (0, _index.getBarWidth)(props.barWidth, props.maxBarWidth);
95
97
  // x0_inner_padding = space_between_groups / (space_between_groups + group_width)
96
98
  // space_between_groups = 2 * bar_width
97
- // group_width = _legends.length * bar_width + (_legends.length - 1) * space_between_bars
98
- _xAxisInnerPadding = (0, _index.getScalePadding)(props.xAxisInnerPadding, undefined, 2 / (2 + (0, _index.calcTotalBandUnits)(_legends.length, X1_INNER_PADDING)));
99
+ // group_width = _barLegends.length * bar_width + (_barLegends.length - 1) * space_between_bars
100
+ _xAxisInnerPadding = (0, _index.getScalePadding)(props.xAxisInnerPadding, undefined, 2 / (2 + (0, _index.calcTotalBandUnits)(_barLegends.length, X1_INNER_PADDING)));
99
101
  _xAxisOuterPadding = (0, _index.getScalePadding)(props.xAxisOuterPadding);
100
102
  };
101
- const _createDataset = (points)=>{
103
+ const _createDataset = (barData, lineData)=>{
102
104
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
105
  const datasetForBars = [];
104
- points.forEach((point, index)=>{
106
+ const linePointsByX = {};
107
+ const visitedX = new Set();
108
+ lineData.forEach((series)=>{
109
+ series.data.forEach((point)=>{
110
+ if (!linePointsByX[point.x]) {
111
+ linePointsByX[point.x] = [];
112
+ }
113
+ linePointsByX[point.x].push({
114
+ ...point,
115
+ legend: series.legend,
116
+ color: series.color,
117
+ data: point.y,
118
+ useSecondaryYScale: series.useSecondaryYScale
119
+ });
120
+ });
121
+ });
122
+ barData.forEach((point, index)=>{
105
123
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
124
  const singleDatasetPointForBars = {};
107
125
  const legendToBarPoint = {};
@@ -124,23 +142,38 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
124
142
  });
125
143
  singleDatasetPointForBars.xAxisPoint = point.name;
126
144
  singleDatasetPointForBars.indexNum = index;
127
- singleDatasetPointForBars.groupSeries = Object.values(legendToBarPoint);
145
+ var _linePointsByX_point_name;
146
+ singleDatasetPointForBars.groupSeries = [
147
+ ...Object.values(legendToBarPoint),
148
+ ...(_linePointsByX_point_name = linePointsByX[point.name]) !== null && _linePointsByX_point_name !== void 0 ? _linePointsByX_point_name : []
149
+ ];
128
150
  singleDatasetPointForBars.stackCallOutAccessibilityData = point.stackCallOutAccessibilityData;
129
151
  datasetForBars.push(singleDatasetPointForBars);
152
+ visitedX.add(point.name);
153
+ });
154
+ Object.keys(linePointsByX).forEach((xPoint)=>{
155
+ if (!visitedX.has(xPoint)) {
156
+ datasetForBars.push({
157
+ xAxisPoint: xPoint,
158
+ groupSeries: linePointsByX[xPoint]
159
+ });
160
+ }
130
161
  });
131
162
  return datasetForBars;
132
163
  };
133
- const _createDataSetOfGVBC = (points)=>{
134
- const legends = new Set();
135
- const xAxisLabels = _getOrderedXAxisLabels(points);
136
- points.forEach((point)=>{
164
+ const _createDataSetOfGVBC = (barData, lineData)=>{
165
+ const barLegends = new Set();
166
+ barData.forEach((point)=>{
137
167
  point.series.forEach((seriesPoint)=>{
138
- legends.add(seriesPoint.legend);
168
+ barLegends.add(seriesPoint.legend);
139
169
  });
140
170
  });
141
- const datasetForBars = _createDataset(points);
171
+ const lineLegends = new Set(lineData.map((series)=>series.legend));
172
+ const xAxisLabels = _getOrderedXAxisLabels(barData, lineData);
173
+ const datasetForBars = _createDataset(barData, lineData);
142
174
  return {
143
- legends: Array.from(legends),
175
+ barLegends: Array.from(barLegends),
176
+ lineLegends: Array.from(lineLegends),
144
177
  xAxisLabels,
145
178
  datasetForBars
146
179
  };
@@ -157,12 +190,13 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
157
190
  }
158
191
  };
159
192
  // eslint-disable-next-line @typescript-eslint/no-deprecated
160
- const _getLegendData = (points)=>{
193
+ const _getLegendData = ()=>{
161
194
  const actions = [];
162
- _legends.forEach((legendTitle)=>{
195
+ const addLegendButton = (legendTitle, isLineLegendInBarChart)=>{
163
196
  const legend = {
164
197
  title: legendTitle,
165
198
  color: _legendColorMap[legendTitle][0],
199
+ isLineLegendInBarChart,
166
200
  hoverAction: ()=>{
167
201
  _handleChartMouseLeave();
168
202
  _onLegendHover(legendTitle);
@@ -172,7 +206,9 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
172
206
  }
173
207
  };
174
208
  actions.push(legend);
175
- });
209
+ };
210
+ _lineLegends.forEach((legendTitle)=>addLegendButton(legendTitle, true));
211
+ _barLegends.forEach((legendTitle)=>addLegendButton(legendTitle));
176
212
  return /*#__PURE__*/ _react.createElement(_index1.Legends, {
177
213
  legends: actions,
178
214
  enabledWrapLines: props.enabledLegendsWrapLines,
@@ -182,44 +218,104 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
182
218
  legendRef: _legendsRef
183
219
  });
184
220
  };
185
- const _addDefaultColors = (data)=>{
221
+ const _processDataV2 = (dataV2)=>{
222
+ const barPointsByX = {};
223
+ const lineData = [];
224
+ dataV2.forEach((series)=>{
225
+ if (series.type === 'bar') {
226
+ series.data.forEach((point)=>{
227
+ if (!barPointsByX[point.x]) {
228
+ barPointsByX[point.x] = {
229
+ name: point.x,
230
+ series: []
231
+ };
232
+ }
233
+ var _series_key, _point_color;
234
+ barPointsByX[point.x].series.push({
235
+ key: (_series_key = series.key) !== null && _series_key !== void 0 ? _series_key : series.legend,
236
+ data: point.y,
237
+ color: (_point_color = point.color) !== null && _point_color !== void 0 ? _point_color : series.color,
238
+ // gradient: series.gradient,
239
+ legend: series.legend,
240
+ xAxisCalloutData: point.xAxisCalloutData,
241
+ yAxisCalloutData: point.yAxisCalloutData,
242
+ onClick: point.onClick,
243
+ useSecondaryYScale: series.useSecondaryYScale
244
+ });
245
+ });
246
+ } else if (series.type === 'line') {
247
+ lineData.push(series);
248
+ }
249
+ });
250
+ return {
251
+ barData: Object.values(barPointsByX),
252
+ lineData
253
+ };
254
+ };
255
+ const _prepareChartData = ()=>{
256
+ let barData = props.data;
257
+ let lineData;
258
+ if (Array.isArray(props.dataV2) && props.dataV2.length > 0) {
259
+ ({ barData, lineData } = _processDataV2(props.dataV2));
260
+ }
186
261
  _legendColorMap = {};
187
262
  let colorIndex = 0;
188
- var _data_map;
189
- return (_data_map = data === null || data === void 0 ? void 0 : data.map((point)=>{
190
- var _point_series;
191
- var _point_series_map;
192
- return {
193
- ...point,
194
- series: (_point_series_map = (_point_series = point.series) === null || _point_series === void 0 ? void 0 : _point_series.map((seriesPoint)=>{
195
- // TODO: Add support for gradient colors
196
- let startColor = seriesPoint.color ? seriesPoint.color : (0, _index.getNextColor)(colorIndex, 0);
197
- let endColor = startColor;
198
- if (!_legendColorMap[seriesPoint.legend]) {
199
- _legendColorMap[seriesPoint.legend] = [
200
- startColor,
201
- endColor
202
- ];
203
- }
204
- colorIndex += 1;
205
- var _seriesPoint_color;
206
- return {
207
- ...seriesPoint,
208
- color: (_seriesPoint_color = seriesPoint.color) !== null && _seriesPoint_color !== void 0 ? _seriesPoint_color : _legendColorMap[seriesPoint.legend][0]
209
- };
210
- })) !== null && _point_series_map !== void 0 ? _point_series_map : []
211
- };
212
- })) !== null && _data_map !== void 0 ? _data_map : [];
263
+ var _barData_map, _lineData_map;
264
+ return {
265
+ barData: (_barData_map = barData === null || barData === void 0 ? void 0 : barData.map((point)=>{
266
+ var _point_series;
267
+ var _point_series_map;
268
+ return {
269
+ ...point,
270
+ series: (_point_series_map = (_point_series = point.series) === null || _point_series === void 0 ? void 0 : _point_series.map((seriesPoint)=>{
271
+ // TODO: Add support for gradient colors
272
+ let startColor = seriesPoint.color ? seriesPoint.color : (0, _index.getNextColor)(colorIndex, 0);
273
+ let endColor = startColor;
274
+ if (!_legendColorMap[seriesPoint.legend]) {
275
+ _legendColorMap[seriesPoint.legend] = [
276
+ startColor,
277
+ endColor
278
+ ];
279
+ }
280
+ colorIndex += 1;
281
+ var _seriesPoint_color;
282
+ return {
283
+ ...seriesPoint,
284
+ color: (_seriesPoint_color = seriesPoint.color) !== null && _seriesPoint_color !== void 0 ? _seriesPoint_color : _legendColorMap[seriesPoint.legend][0]
285
+ };
286
+ })) !== null && _point_series_map !== void 0 ? _point_series_map : []
287
+ };
288
+ })) !== null && _barData_map !== void 0 ? _barData_map : [],
289
+ lineData: (_lineData_map = lineData === null || lineData === void 0 ? void 0 : lineData.map((series)=>{
290
+ let lineColor;
291
+ if (typeof series.color === 'undefined') {
292
+ lineColor = (0, _index.getNextColor)(colorIndex, 0);
293
+ } else {
294
+ lineColor = (0, _index1.getColorFromToken)(series.color);
295
+ }
296
+ if (!_legendColorMap[series.legend]) {
297
+ _legendColorMap[series.legend] = [
298
+ lineColor,
299
+ lineColor
300
+ ];
301
+ }
302
+ colorIndex += 1;
303
+ return {
304
+ ...series,
305
+ color: _legendColorMap[series.legend][0]
306
+ };
307
+ })) !== null && _lineData_map !== void 0 ? _lineData_map : []
308
+ };
213
309
  };
214
- const _getOrderedXAxisLabels = (points)=>{
310
+ const _getOrderedXAxisLabels = (barData, lineData)=>{
215
311
  if (_xAxisType !== _index.XAxisTypes.StringAxis) {
216
312
  return [];
217
313
  }
218
- return (0, _index.sortAxisCategories)(_mapCategoryToValues(points), props.xAxisCategoryOrder);
314
+ return (0, _index.sortAxisCategories)(_mapCategoryToValues(barData, lineData), props.xAxisCategoryOrder);
219
315
  };
220
- const _mapCategoryToValues = (points)=>{
316
+ const _mapCategoryToValues = (barData, lineData)=>{
221
317
  const categoryToValues = {};
222
- points.forEach((point)=>{
318
+ barData.forEach((point)=>{
223
319
  if (!categoryToValues[point.name]) {
224
320
  categoryToValues[point.name] = [];
225
321
  }
@@ -227,15 +323,24 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
227
323
  categoryToValues[point.name].push(seriesPoint.data);
228
324
  });
229
325
  });
326
+ lineData.forEach((series)=>{
327
+ series.data.forEach((point)=>{
328
+ if (!categoryToValues[point.x]) {
329
+ categoryToValues[point.x] = [];
330
+ }
331
+ categoryToValues[point.x].push(point.y);
332
+ });
333
+ });
230
334
  return categoryToValues;
231
335
  };
232
- const points = _addDefaultColors(props.data);
233
- const _xAxisType = (0, _index.getTypeOfAxis)(points[0].name, true);
234
- const { legends, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(points);
235
- _legends = legends;
336
+ const { barData, lineData } = _prepareChartData();
337
+ const _xAxisType = (0, _index.getTypeOfAxis)(barData[0].name, true);
338
+ const { barLegends, lineLegends, xAxisLabels, datasetForBars } = _createDataSetOfGVBC(barData, lineData);
339
+ _barLegends = barLegends;
340
+ _lineLegends = lineLegends;
236
341
  _xAxisLabels = xAxisLabels;
237
342
  _datasetForBars = datasetForBars;
238
- const legendBars = _getLegendData(points);
343
+ const legendBars = _getLegendData();
239
344
  _adjustProps();
240
345
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Add commentMore actions
241
346
  function _getMinMaxOfYAxis(datasetForBars, yAxisType, useSecondaryYScale) {
@@ -273,16 +378,19 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
273
378
  const yMax = _getMinMaxOfYAxis(_datasetForBars).endValue;
274
379
  _yMax = Math.max(yMax, props.yMaxValue || 0);
275
380
  const calloutProps = {
276
- clickPosition,
381
+ positioning: {
382
+ target: popoverTarget
383
+ },
277
384
  isPopoverOpen,
278
385
  color,
279
386
  legend: calloutLegend,
280
387
  XValue: xCalloutValue,
281
388
  YValue: yCalloutValue ? yCalloutValue : dataForHoverCard,
282
- YValueHover,
389
+ YValueHover: yValueHover,
283
390
  hoverXValue,
284
391
  culture: props.culture,
285
392
  isCartesian: true,
393
+ isCalloutForStack: props.isCalloutForStack,
286
394
  ...props.calloutProps,
287
395
  ...(0, _index.getAccessibleDataObject)(callOutAccessibilityData, 'text', false)
288
396
  };
@@ -294,8 +402,8 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
294
402
  const xScale0 = _createX0Scale(containerWidth);
295
403
  // Setting the bar width here is safe because there are no dependencies earlier in the code
296
404
  // that rely on the width of bars in vertical bar charts with string x-axis.
297
- _barWidth = (0, _index.getBarWidth)(props.barWidth, props.maxBarWidth, (0, _index.calcBandwidth)(xScale0.bandwidth(), _legends.length, X1_INNER_PADDING));
298
- _groupWidth = (0, _index.calcRequiredWidth)(_barWidth, _legends.length, X1_INNER_PADDING);
405
+ _barWidth = (0, _index.getBarWidth)(props.barWidth, props.maxBarWidth, (0, _index.calcBandwidth)(xScale0.bandwidth(), _barLegends.length, X1_INNER_PADDING));
406
+ _groupWidth = (0, _index.calcRequiredWidth)(_barWidth, _barLegends.length, X1_INNER_PADDING);
299
407
  const xScale1 = _createX1Scale();
300
408
  const allGroupsBars = [];
301
409
  _datasetForBars.forEach((singleSet)=>{
@@ -306,34 +414,11 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
306
414
  const _getMargins = (margins)=>{
307
415
  _margins = margins;
308
416
  };
309
- function updatePosition(newX, newY) {
310
- const threshold = 1; // Set a threshold for movement
311
- const { x, y } = clickPosition;
312
- // Calculate the distance moved
313
- const distance = Math.sqrt(Math.pow(newX - x, 2) + Math.pow(newY - y, 2));
314
- // Update the position only if the distance moved is greater than the threshold
315
- if (distance > threshold) {
316
- setClickPosition({
317
- x: newX,
318
- y: newY
319
- });
320
- setPopoverOpen(true);
321
- }
322
- }
323
417
  const onBarHover = (pointData, groupData, mouseEvent)=>{
324
418
  mouseEvent.persist();
325
419
  if (_calloutAnchorPoint !== pointData) {
326
420
  _calloutAnchorPoint = pointData;
327
- updatePosition(mouseEvent.clientX, mouseEvent.clientY);
328
- setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
329
- setCalloutLegend(pointData.legend);
330
- setDataForHoverCard(pointData.data);
331
- setColor(pointData.color);
332
- setXCalloutValue(pointData.xAxisCalloutData);
333
- setYCalloutValue(pointData.yAxisCalloutData);
334
- setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
335
- setYValueHover(groupData.groupSeries);
336
- setHoverXValue(pointData.xAxisCalloutData);
421
+ _showCallout(mouseEvent.currentTarget, pointData, groupData);
337
422
  }
338
423
  };
339
424
  const _onBarLeave = ()=>{
@@ -342,22 +427,8 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
342
427
  _calloutAnchorPoint = null;
343
428
  setPopoverOpen(false);
344
429
  };
345
- const onBarFocus = (event, pointData, groupData)=>{
346
- let x = 0;
347
- let y = 0;
348
- const targetRect = event.target.getBoundingClientRect();
349
- x = targetRect.left + targetRect.width / 2;
350
- y = targetRect.top + targetRect.height / 2;
351
- updatePosition(x, y);
352
- setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
353
- setCalloutLegend(pointData.legend);
354
- setDataForHoverCard(pointData.data);
355
- setColor(pointData.color);
356
- setXCalloutValue(pointData.xAxisCalloutData);
357
- setYCalloutValue(pointData.yAxisCalloutData);
358
- setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
359
- setYValueHover(groupData.groupSeries);
360
- setHoverXValue(pointData.xAxisCalloutData);
430
+ const onBarFocus = (focusEvent, pointData, groupData)=>{
431
+ _showCallout(focusEvent.currentTarget, pointData, groupData);
361
432
  };
362
433
  const _buildGraph = (singleSet, xScale0, xScale1, yScalePrimary, yScaleSecondary, containerHeight, xElement)=>{
363
434
  // eslint-disable-next-line @typescript-eslint/no-deprecated
@@ -365,7 +436,7 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
365
436
  // eslint-disable-next-line @typescript-eslint/no-deprecated
366
437
  const barLabelsForGroup = [];
367
438
  // Get the actual legends present at this x-axis point
368
- const presentLegends = Object.keys(singleSet).filter((key)=>key in _legendColorMap);
439
+ const presentLegends = _barLegends.filter((key)=>key in singleSet);
369
440
  const effectiveGroupWidth = (0, _index.calcRequiredWidth)(_barWidth, presentLegends.length, X1_INNER_PADDING);
370
441
  // For stacked bars, center the single bar group in the available space
371
442
  // Instead of using the global legend position, use the local position within present legends
@@ -376,7 +447,7 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
376
447
  0,
377
448
  effectiveGroupWidth
378
449
  ]).paddingInner(X1_INNER_PADDING);
379
- _legends.forEach((legendTitle, legendIndex)=>{
450
+ _barLegends.forEach((legendTitle, legendIndex)=>{
380
451
  const barPoints = singleSet[legendTitle];
381
452
  if (barPoints) {
382
453
  const yBarScale = barPoints[0].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
@@ -475,7 +546,7 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
475
546
  };
476
547
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
477
548
  const _createX1Scale = ()=>{
478
- return (0, _d3scale.scaleBand)().domain(_legends) // When there is only one group, xScale0 adds padding around it,
549
+ return (0, _d3scale.scaleBand)().domain(_barLegends) // When there is only one group, xScale0 adds padding around it,
479
550
  // causing the bandwidth to become smaller than the actual group width.
480
551
  // So to render bars in the group correctly, use groupWidth instead of the generated scale bandwidth.
481
552
  .range(_useRtl ? [
@@ -536,7 +607,7 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
536
607
  // Update the bar width so that when CartesianChart rerenders,
537
608
  // the following calculations don't use the previous bar width.
538
609
  _barWidth = (0, _index.getBarWidth)(props.barWidth, props.maxBarWidth);
539
- const groupWidth = (0, _index.calcRequiredWidth)(_barWidth, _legends.length, X1_INNER_PADDING);
610
+ const groupWidth = (0, _index.calcRequiredWidth)(_barWidth, _barLegends.length, X1_INNER_PADDING);
540
611
  /** Total width required to render the groups. Directly proportional to group width */ const reqWidth = (0, _index.calcRequiredWidth)(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);
541
612
  if (totalWidth >= reqWidth) {
542
613
  // Center align the chart by setting equal left and right margins for domain
@@ -545,9 +616,9 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
545
616
  } else if (props.mode === 'plotly' && xAxisLabels.length > 1) {
546
617
  // Calculate the remaining width after rendering groups at their maximum allowable width
547
618
  const groupBandwidth = (0, _index.calcBandwidth)(totalWidth, _xAxisLabels.length, _xAxisInnerPadding);
548
- const barBandwidth = (0, _index.calcBandwidth)(groupBandwidth, _legends.length, X1_INNER_PADDING);
619
+ const barBandwidth = (0, _index.calcBandwidth)(groupBandwidth, _barLegends.length, X1_INNER_PADDING);
549
620
  const barWidth = (0, _index.getBarWidth)(props.barWidth, props.maxBarWidth, barBandwidth);
550
- const groupWidth = (0, _index.calcRequiredWidth)(barWidth, _legends.length, X1_INNER_PADDING);
621
+ const groupWidth = (0, _index.calcRequiredWidth)(barWidth, _barLegends.length, X1_INNER_PADDING);
551
622
  let reqWidth = (0, _index.calcRequiredWidth)(groupWidth, _xAxisLabels.length, _xAxisInnerPadding);
552
623
  const margin1 = (totalWidth - reqWidth) / 2;
553
624
  let margin2 = Number.POSITIVE_INFINITY;
@@ -566,13 +637,151 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
566
637
  right: _margins.right + _domainMargin
567
638
  };
568
639
  };
569
- const _isChartEmpty = ()=>{
570
- return !(props.data && props.data.length > 0 && props.data.filter((item)=>item.series.length).length > 0);
640
+ const _isChartEmpty = (_barData, _lineData)=>{
641
+ return !(_barData && _barData.length > 0 && _barData.filter((item)=>item.series.length).length > 0 || _lineData && _lineData.length > 0 && _lineData.some((series)=>series.data.length > 0));
571
642
  };
572
643
  const _getChartTitle = ()=>{
573
- return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Vertical bar chart with ${_xAxisLabels.length} groups of ${_legends.length} bars each. `;
644
+ return (props.chartTitle ? `${props.chartTitle}. ` : '') + `Vertical bar chart with ${_barLegends.length} grouped bar series` + (_lineLegends.length > 0 ? ` and ${_lineLegends.length} line series. ` : '. ');
645
+ };
646
+ const _createLines = (_lineData, xScale, yScalePrimary, yScaleSecondary)=>{
647
+ const lineBorders = [];
648
+ const lines = [];
649
+ const dots = [];
650
+ const scaleLineX = (x)=>xScale(x) + xScale.bandwidth() / 2;
651
+ _lineData.forEach((series, seriesIdx)=>{
652
+ var _series_lineOptions;
653
+ const lineBorderGroup = [];
654
+ const lineGroup = [];
655
+ const dotGroup = [];
656
+ const lineBorderWidth = ((_series_lineOptions = series.lineOptions) === null || _series_lineOptions === void 0 ? void 0 : _series_lineOptions.lineBorderWidth) ? Number.parseFloat(series.lineOptions.lineBorderWidth.toString()) : 0;
657
+ const yScale = series.useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
658
+ const shouldHighlight = _legendHighlighted(series.legend) || _noLegendHighlighted();
659
+ series.data.forEach((point, pointIdx)=>{
660
+ const x2 = scaleLineX(point.x);
661
+ const y2 = yScale(point.y);
662
+ if (pointIdx > 0) {
663
+ var _series_lineOptions, _series_lineOptions1, _series_lineOptions2;
664
+ const x1 = scaleLineX(series.data[pointIdx - 1].x);
665
+ const y1 = yScale(series.data[pointIdx - 1].y);
666
+ if (lineBorderWidth > 0) {
667
+ var _series_lineOptions3;
668
+ var _series_lineOptions_lineBorderColor;
669
+ lineBorderGroup.push(/*#__PURE__*/ _react.createElement("line", {
670
+ key: `lineBorder-${seriesIdx}-${pointIdx}`,
671
+ x1: x1,
672
+ y1: y1,
673
+ x2: x2,
674
+ y2: y2,
675
+ fill: "transparent",
676
+ stroke: (_series_lineOptions_lineBorderColor = (_series_lineOptions3 = series.lineOptions) === null || _series_lineOptions3 === void 0 ? void 0 : _series_lineOptions3.lineBorderColor) !== null && _series_lineOptions_lineBorderColor !== void 0 ? _series_lineOptions_lineBorderColor : _reacttheme.tokens.colorNeutralBackground1,
677
+ strokeWidth: 3 + lineBorderWidth * 2,
678
+ strokeLinecap: "round",
679
+ opacity: shouldHighlight ? 1 : 0.1
680
+ }));
681
+ }
682
+ var _series_lineOptions_strokeWidth, _series_lineOptions_strokeLinecap;
683
+ lineGroup.push(/*#__PURE__*/ _react.createElement("line", {
684
+ key: `line-${seriesIdx}-${pointIdx}`,
685
+ x1: x1,
686
+ y1: y1,
687
+ x2: x2,
688
+ y2: y2,
689
+ stroke: series.color,
690
+ strokeWidth: (_series_lineOptions_strokeWidth = (_series_lineOptions = series.lineOptions) === null || _series_lineOptions === void 0 ? void 0 : _series_lineOptions.strokeWidth) !== null && _series_lineOptions_strokeWidth !== void 0 ? _series_lineOptions_strokeWidth : 3,
691
+ strokeLinecap: (_series_lineOptions_strokeLinecap = (_series_lineOptions1 = series.lineOptions) === null || _series_lineOptions1 === void 0 ? void 0 : _series_lineOptions1.strokeLinecap) !== null && _series_lineOptions_strokeLinecap !== void 0 ? _series_lineOptions_strokeLinecap : 'round',
692
+ strokeDasharray: (_series_lineOptions2 = series.lineOptions) === null || _series_lineOptions2 === void 0 ? void 0 : _series_lineOptions2.strokeDasharray,
693
+ opacity: shouldHighlight ? 1 : 0.1,
694
+ onMouseOver: (e)=>_onLineHover(e, series, seriesIdx, pointIdx, scaleLineX),
695
+ onMouseLeave: _onBarLeave
696
+ }));
697
+ }
698
+ const dotId = _getDotId(seriesIdx, pointIdx);
699
+ const isLinePointActive = activeLinePoint === point.x || activeLinePoint === dotId;
700
+ dotGroup.push(/*#__PURE__*/ _react.createElement("circle", {
701
+ key: dotId,
702
+ id: dotId,
703
+ cx: x2,
704
+ cy: y2,
705
+ r: shouldHighlight && isLinePointActive ? 8 : 0.3,
706
+ fill: _reacttheme.tokens.colorNeutralBackground1,
707
+ stroke: series.color,
708
+ strokeWidth: 3,
709
+ opacity: shouldHighlight ? 1 : 0.1,
710
+ onMouseOver: (e)=>_onLineHover(e, series, seriesIdx, pointIdx, scaleLineX),
711
+ onMouseLeave: _onBarLeave,
712
+ "data-is-focusable": shouldHighlight,
713
+ onFocus: (e)=>_onLineFocus(e, series, seriesIdx, pointIdx),
714
+ onBlur: _onBarLeave,
715
+ role: "img",
716
+ "aria-label": getAriaLabel({
717
+ xAxisCalloutData: point.xAxisCalloutData,
718
+ legend: series.legend,
719
+ yAxisCalloutData: point.yAxisCalloutData,
720
+ data: point.y,
721
+ callOutAccessibilityData: point.callOutAccessibilityData
722
+ }, point.x)
723
+ }));
724
+ });
725
+ lineBorders.push(/*#__PURE__*/ _react.createElement("g", {
726
+ key: `lineBorderGroup-${seriesIdx}`
727
+ }, lineBorderGroup));
728
+ lines.push(/*#__PURE__*/ _react.createElement("g", {
729
+ key: `lineGroup-${seriesIdx}`
730
+ }, lineGroup));
731
+ dots.push(/*#__PURE__*/ _react.createElement("g", {
732
+ key: `dotGroup-${seriesIdx}`
733
+ }, dotGroup));
734
+ });
735
+ return dots.length > 0 ? /*#__PURE__*/ _react.createElement("g", null, lineBorders.length > 0 ? /*#__PURE__*/ _react.createElement("g", null, lineBorders) : null, lines.length > 0 ? /*#__PURE__*/ _react.createElement("g", null, lines) : null, /*#__PURE__*/ _react.createElement("g", null, dots)) : null;
574
736
  };
575
- return !_isChartEmpty() ? /*#__PURE__*/ _react.createElement(_index1.CartesianChart, {
737
+ const _onLineHover = (event, series, seriesIdx, pointIdx, scaleLineX)=>{
738
+ const pointerX = (0, _d3selection.pointer)(event, _rectRef.current)[0];
739
+ let closestPointIdx = pointIdx;
740
+ if (pointIdx > 0) {
741
+ const currPointPos = scaleLineX(series.data[pointIdx].x);
742
+ const prevPointPos = scaleLineX(series.data[pointIdx - 1].x);
743
+ if (Math.abs(prevPointPos - pointerX) < Math.abs(currPointPos - pointerX)) {
744
+ closestPointIdx = pointIdx - 1;
745
+ }
746
+ }
747
+ event.persist();
748
+ _showCalloutForLines(event.currentTarget, series, seriesIdx, closestPointIdx);
749
+ };
750
+ const _onLineFocus = (event, series, seriesIdx, pointIdx)=>{
751
+ _showCalloutForLines(event.currentTarget, series, seriesIdx, pointIdx);
752
+ };
753
+ const _showCalloutForLines = (target, series, seriesIdx, pointIdx)=>{
754
+ const point = series.data[pointIdx];
755
+ const pointData = {
756
+ ...point,
757
+ legend: series.legend,
758
+ color: series.color,
759
+ key: series.legend,
760
+ data: point.y,
761
+ yAxisCalloutData: point.yAxisCalloutData
762
+ };
763
+ const groupData = _datasetForBars.find((singleSet)=>singleSet.xAxisPoint === point.x);
764
+ _showCallout(target, pointData, groupData, _getDotId(seriesIdx, pointIdx));
765
+ };
766
+ const _showCallout = (target, pointData, groupData, _activeLinePoint = '')=>{
767
+ setPopoverTarget(target);
768
+ setPopoverOpen(_noLegendHighlighted() || _legendHighlighted(pointData.legend));
769
+ setCalloutLegend(pointData.legend);
770
+ setDataForHoverCard(pointData.data);
771
+ setColor(pointData.color);
772
+ var _pointData_xAxisCalloutData;
773
+ setXCalloutValue((_pointData_xAxisCalloutData = pointData.xAxisCalloutData) !== null && _pointData_xAxisCalloutData !== void 0 ? _pointData_xAxisCalloutData : groupData.xAxisPoint);
774
+ setYCalloutValue(pointData.yAxisCalloutData);
775
+ setCallOutAccessibilityData(props.isCalloutForStack ? groupData.stackCallOutAccessibilityData : pointData.callOutAccessibilityData);
776
+ setYValueHover(groupData.groupSeries.filter((item)=>_noLegendHighlighted() || _legendHighlighted(item.legend)));
777
+ var _pointData_xAxisCalloutData1;
778
+ setHoverXValue((_pointData_xAxisCalloutData1 = pointData.xAxisCalloutData) !== null && _pointData_xAxisCalloutData1 !== void 0 ? _pointData_xAxisCalloutData1 : groupData.xAxisPoint);
779
+ setActiveLinePoint(props.isCalloutForStack ? groupData.xAxisPoint : _activeLinePoint);
780
+ };
781
+ const _getDotId = (seriesIdx, pointIdx)=>{
782
+ return _uniqDotId + `-${seriesIdx}-${pointIdx}`;
783
+ };
784
+ return !_isChartEmpty(barData, lineData) ? /*#__PURE__*/ _react.createElement(_index1.CartesianChart, {
576
785
  ...props,
577
786
  chartTitle: _getChartTitle(),
578
787
  points: _datasetForBars,
@@ -599,8 +808,16 @@ const GroupedVerticalBarChart = /*#__PURE__*/ _react.forwardRef((_props, forward
599
808
  },
600
809
  barwidth: _barWidth,
601
810
  componentRef: cartesianChartRef,
602
- /* eslint-disable react/jsx-no-bind */ children: ()=>{
603
- return /*#__PURE__*/ _react.createElement("g", null, _groupedVerticalBarGraph);
811
+ /* eslint-disable react/jsx-no-bind */ children: (childProps)=>{
812
+ return /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("rect", {
813
+ ref: _rectRef,
814
+ width: "100%",
815
+ height: "100%",
816
+ fill: "transparent",
817
+ style: {
818
+ pointerEvents: 'none'
819
+ }
820
+ }), /*#__PURE__*/ _react.createElement("g", null, _groupedVerticalBarGraph), _createLines(lineData, childProps.xScale, childProps.yScalePrimary, childProps.yScaleSecondary));
604
821
  }
605
822
  }) : /*#__PURE__*/ _react.createElement("div", {
606
823
  id: _emptyChartId,