@fluentui/react-charts 9.3.3 → 9.3.5

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 (154) hide show
  1. package/CHANGELOG.md +45 -7
  2. package/dist/index.d.ts +6 -2
  3. package/lib/components/AreaChart/AreaChart.js +188 -36
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/ChartTable/ChartTable.js +17 -13
  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 +30 -27
  12. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  13. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  14. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +3 -2
  15. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  16. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +2 -1
  17. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  18. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +3 -2
  19. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  20. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +2 -1
  21. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  22. package/lib/components/DeclarativeChart/DeclarativeChart.js +3 -6
  23. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  24. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +8 -4
  25. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  26. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +148 -80
  27. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  28. package/lib/components/DonutChart/DonutChart.js +12 -7
  29. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  30. package/lib/components/DonutChart/useDonutChartStyles.styles.js +3 -2
  31. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  32. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +2 -1
  33. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  34. package/lib/components/FunnelChart/FunnelChart.js +5 -5
  35. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  36. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +3 -2
  37. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  38. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +2 -1
  39. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  40. package/lib/components/GaugeChart/GaugeChart.js +3 -1
  41. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  42. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +3 -2
  43. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  44. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -1
  45. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  46. package/lib/components/HeatMapChart/HeatMapChart.js +5 -5
  47. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  48. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +3 -1
  49. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  50. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +3 -2
  51. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  52. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  53. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  54. package/lib/components/Legends/Legends.js +3 -1
  55. package/lib/components/Legends/Legends.js.map +1 -1
  56. package/lib/components/Legends/Legends.types.js.map +1 -1
  57. package/lib/components/LineChart/LineChart.js +5 -4
  58. package/lib/components/LineChart/LineChart.js.map +1 -1
  59. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  60. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  61. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  62. package/lib/components/SankeyChart/SankeyChart.js +1 -1
  63. package/lib/components/SankeyChart/SankeyChart.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/VerticalBarChart/VerticalBarChart.js +3 -1
  69. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  70. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +12 -4
  71. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  72. package/lib/types/DataPoint.js.map +1 -1
  73. package/lib/utilities/FocusableTooltipText.js +1 -1
  74. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  75. package/lib/utilities/SVGTooltipText.js +8 -8
  76. package/lib/utilities/SVGTooltipText.js.map +1 -1
  77. package/lib/utilities/utilities.js +63 -18
  78. package/lib/utilities/utilities.js.map +1 -1
  79. package/lib-commonjs/components/AreaChart/AreaChart.js +188 -36
  80. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  81. package/lib-commonjs/components/ChartTable/ChartTable.js +16 -13
  82. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  83. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +3 -3
  84. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  85. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +2 -2
  86. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  87. package/lib-commonjs/components/CommonComponents/CartesianChart.js +30 -27
  88. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  89. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  90. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +7 -1
  91. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  92. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +2 -1
  93. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  94. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +7 -1
  95. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  96. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +2 -1
  97. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  98. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +3 -6
  99. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  100. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  101. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +114 -63
  102. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  103. package/lib-commonjs/components/DonutChart/DonutChart.js +12 -7
  104. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  105. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +7 -1
  106. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  107. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +2 -1
  108. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  109. package/lib-commonjs/components/FunnelChart/FunnelChart.js +5 -5
  110. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  111. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +7 -1
  112. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  113. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +2 -1
  114. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  115. package/lib-commonjs/components/GaugeChart/GaugeChart.js +3 -1
  116. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  117. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +7 -1
  118. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  119. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +2 -1
  120. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  121. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +5 -5
  122. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  123. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +3 -1
  124. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  125. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +7 -1
  126. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  127. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +2 -1
  128. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  129. package/lib-commonjs/components/Legends/Legends.js +3 -1
  130. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  131. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  132. package/lib-commonjs/components/LineChart/LineChart.js +5 -4
  133. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  134. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  135. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  136. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  137. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -1
  138. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  139. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +7 -1
  140. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  141. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -1
  142. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  143. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -1
  144. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  145. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +12 -4
  146. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  147. package/lib-commonjs/types/DataPoint.js.map +1 -1
  148. package/lib-commonjs/utilities/FocusableTooltipText.js +1 -1
  149. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  150. package/lib-commonjs/utilities/SVGTooltipText.js +8 -8
  151. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  152. package/lib-commonjs/utilities/utilities.js +63 -18
  153. package/lib-commonjs/utilities/utilities.js.map +1 -1
  154. package/package.json +13 -13
package/CHANGELOG.md CHANGED
@@ -1,12 +1,50 @@
1
1
  # Change Log - @fluentui/react-charts
2
2
 
3
- This log was last generated on Tue, 21 Oct 2025 14:13:08 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 06 Nov 2025 14:56:54 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.5)
8
+
9
+ Thu, 06 Nov 2025 14:56:54 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.4..@fluentui/react-charts_v9.3.5)
11
+
12
+ ### Patches
13
+
14
+ - chore: migrate source to react 19 ([PR #35434](https://github.com/microsoft/fluentui/pull/35434) by martinhochel@microsoft.com)
15
+ - fix plotly color issue ([PR #35451](https://github.com/microsoft/fluentui/pull/35451) by anushgupta@microsoft.com)
16
+ - fix reference lines bug ([PR #35406](https://github.com/microsoft/fluentui/pull/35406) by anushgupta@microsoft.com)
17
+ - Bump @fluentui/react-button to v9.6.11 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
18
+ - Bump @fluentui/react-jsx-runtime to v9.3.2 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
19
+ - Bump @fluentui/react-overflow to v9.6.4 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
20
+ - Bump @fluentui/react-popover to v9.12.11 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.26.9 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
22
+ - Bump @fluentui/react-tooltip to v9.8.10 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
23
+ - Bump @fluentui/react-utilities to v9.25.3 ([PR #35466](https://github.com/microsoft/fluentui/pull/35466) by beachball)
24
+
25
+ ## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.4)
26
+
27
+ Fri, 31 Oct 2025 16:22:02 GMT
28
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.3..@fluentui/react-charts_v9.3.4)
29
+
30
+ ### Patches
31
+
32
+ - fix chart crash issue ([PR #35399](https://github.com/microsoft/fluentui/pull/35399) by anushgupta@microsoft.com)
33
+ - update react version to react 19 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by anushgupta@microsoft.com)
34
+ - fix dark mode styles of chart table ([PR #35377](https://github.com/microsoft/fluentui/pull/35377) by anushgupta@microsoft.com)
35
+ - fix chart exceptions ([PR #35393](https://github.com/microsoft/fluentui/pull/35393) by anushgupta@microsoft.com)
36
+ - feat: map deprecated plotly create_gantt() scatter traces to gantt chart ([PR #35334](https://github.com/microsoft/fluentui/pull/35334) by kumarkshitij@microsoft.com)
37
+ - Bump @fluentui/react-button to v9.6.10 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
38
+ - Bump @fluentui/react-jsx-runtime to v9.3.1 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
39
+ - Bump @fluentui/react-overflow to v9.6.3 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
40
+ - Bump @fluentui/react-popover to v9.12.10 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
41
+ - Bump @fluentui/react-tabster to v9.26.8 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
42
+ - Bump @fluentui/react-tooltip to v9.8.9 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
43
+ - Bump @fluentui/react-utilities to v9.25.2 ([PR #35402](https://github.com/microsoft/fluentui/pull/35402) by beachball)
44
+
7
45
  ## [9.3.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.3)
8
46
 
9
- Tue, 21 Oct 2025 14:13:08 GMT
47
+ Tue, 21 Oct 2025 14:16:55 GMT
10
48
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-charts_v9.3.2..@fluentui/react-charts_v9.3.3)
11
49
 
12
50
  ### Patches
@@ -23,11 +61,11 @@ Tue, 21 Oct 2025 14:13:08 GMT
23
61
  - fix(react-charts): Show markers only when mode has markers for large data ([PR #35311](https://github.com/microsoft/fluentui/pull/35311) by 120183316+srmukher@users.noreply.github.com)
24
62
  - fix popover positioning issue ([PR #35289](https://github.com/microsoft/fluentui/pull/35289) by anushgupta@microsoft.com)
25
63
  - fix chart exception issue ([PR #35342](https://github.com/microsoft/fluentui/pull/35342) by anushgupta@microsoft.com)
26
- - Bump @fluentui/react-button to v9.6.9 ([PR #35307](https://github.com/microsoft/fluentui/pull/35307) by beachball)
27
- - Bump @fluentui/react-jsx-runtime to v9.3.0 ([PR #35307](https://github.com/microsoft/fluentui/pull/35307) by beachball)
28
- - Bump @fluentui/react-overflow to v9.6.2 ([PR #35307](https://github.com/microsoft/fluentui/pull/35307) by beachball)
29
- - Bump @fluentui/react-popover to v9.12.9 ([PR #35307](https://github.com/microsoft/fluentui/pull/35307) by beachball)
30
- - Bump @fluentui/react-tooltip to v9.8.8 ([PR #35307](https://github.com/microsoft/fluentui/pull/35307) by beachball)
64
+ - Bump @fluentui/react-button to v9.6.9 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
65
+ - Bump @fluentui/react-jsx-runtime to v9.3.0 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
66
+ - Bump @fluentui/react-overflow to v9.6.2 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
67
+ - Bump @fluentui/react-popover to v9.12.9 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
68
+ - Bump @fluentui/react-tooltip to v9.8.8 ([PR #35343](https://github.com/microsoft/fluentui/pull/35343) by beachball)
31
69
 
32
70
  ## [9.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-charts_v9.3.2)
33
71
 
package/dist/index.d.ts CHANGED
@@ -162,6 +162,10 @@ export declare type AxisProps = {
162
162
  * - Exception: when `tickStep` uses `"L<f>"`, you can specify the raw value directly.
163
163
  */
164
164
  tick0?: number | Date;
165
+ /**
166
+ * Sets the text displayed at each tick position specified by `tickValues`. Used with `tickValues`.
167
+ */
168
+ tickText?: string[];
165
169
  };
166
170
 
167
171
  /**
@@ -493,7 +497,7 @@ export declare interface CartesianChartProps {
493
497
  * Optional callback to access the Chart interface. Use this instead of ref for accessing
494
498
  * the public methods and properties of the component.
495
499
  */
496
- componentRef?: React_2.RefObject<Chart>;
500
+ componentRef?: React_2.RefObject<Chart | null>;
497
501
  /**
498
502
  * Prop to set the x axis annotation. Used to display additional information on the x-axis.
499
503
  * This is shown on the top of the chart.
@@ -2733,7 +2737,7 @@ export declare interface LegendsProps {
2733
2737
  /**
2734
2738
  * Callback to access the public methods and properties of the component.
2735
2739
  */
2736
- legendRef?: React_2.RefObject<LegendContainer>;
2740
+ legendRef?: React_2.RefObject<LegendContainer | null>;
2737
2741
  }
2738
2742
 
2739
2743
  /**
@@ -33,6 +33,8 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
33
33
  const _firstRenderOptimization = true;
34
34
  const _emptyChartId = useId('_AreaChart_empty');
35
35
  let _containsSecondaryYAxis = false;
36
+ let _hasMissingXValues = _containsMissingXValues();
37
+ let _hasDuplicateXValues = _xCoordinateContainsMultipleY();
36
38
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
39
  let _calloutPoints;
38
40
  let _createSet;
@@ -268,7 +270,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
268
270
  };
269
271
  }
270
272
  function _createDataSet(points) {
271
- if (props.enablePerfOptimization && _enableComputationOptimization) {
273
+ if (props.enablePerfOptimization && _enableComputationOptimization && !_hasDuplicateXValues) {
272
274
  const allChartPoints = [];
273
275
  const dataSet = [];
274
276
  const colors = [];
@@ -323,35 +325,50 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
323
325
  const colors = [];
324
326
  const opacity = [];
325
327
  const calloutPoints = calloutData(points);
328
+ let data = {};
329
+ const keys = [];
330
+ let index = 0;
326
331
  points && points.length && points.forEach((singleChartPoint)=>{
332
+ // if legend is not populated, then assign a legend
333
+ if (_hasDuplicateXValues && !singleChartPoint.legend) {
334
+ singleChartPoint.legend = `chart${index}`;
335
+ ++index;
336
+ }
337
+ singleChartPoint.data.forEach((point)=>{
338
+ point.legend = singleChartPoint.legend;
339
+ });
327
340
  colors.push(singleChartPoint.color);
328
341
  opacity.push(singleChartPoint.opacity || 1);
329
342
  allChartPoints.push(...singleChartPoint.data);
330
343
  });
331
- let tempArr = allChartPoints;
332
- while(tempArr.length){
333
- const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
334
- const filteredChartPoints = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck);
335
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
336
- const singleDataset = {};
337
- filteredChartPoints.forEach((singleDataPoint, index)=>{
338
- singleDataset.xVal = singleDataPoint.x;
339
- singleDataset[`chart${index}`] = singleDataPoint.y;
340
- });
341
- dataSet.push(singleDataset);
342
- // removing compared objects from array
343
- const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
344
- tempArr = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val);
345
- }
346
- // get keys from dataset, used to create stacked data
347
- const keysLength = dataSet && Object.keys(dataSet[0]).length;
348
- const keys = [];
349
- for(let i = 0; i < keysLength - 1; i++){
350
- const keyVal = `chart${i}`;
351
- keys.push(keyVal);
344
+ if (!_hasDuplicateXValues) {
345
+ let tempArr = allChartPoints;
346
+ while(tempArr.length){
347
+ const valToCheck = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
348
+ const filteredChartPoints = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) === valToCheck);
349
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
350
+ const singleDataset = {};
351
+ filteredChartPoints.forEach((singleDataPoint, id)=>{
352
+ singleDataset.xVal = singleDataPoint.x;
353
+ singleDataset[`chart${id}`] = singleDataPoint.y;
354
+ });
355
+ dataSet.push(singleDataset);
356
+ // removing compared objects from array
357
+ const val = tempArr[0].x instanceof Date ? tempArr[0].x.toLocaleString() : tempArr[0].x;
358
+ tempArr = tempArr.filter((point)=>(point.x instanceof Date ? point.x.toLocaleString() : point.x) !== val);
359
+ }
360
+ // get keys from dataset, used to create stacked data
361
+ const keysLength = dataSet && Object.keys(dataSet[0]).length;
362
+ for(let i = 0; i < keysLength - 1; i++){
363
+ const keyVal = `chart${i}`;
364
+ keys.push(keyVal);
365
+ }
366
+ // Data used to draw graph
367
+ data = _getDataPoints(keys, dataSet);
368
+ } else {
369
+ const datasetForDuplicateValues = _createDatasetForXCoordinateWithMultipleYValues(allChartPoints);
370
+ data = _getDataPoints(datasetForDuplicateValues.keys, datasetForDuplicateValues.filteredDataSet);
352
371
  }
353
- // Data used to draw graph
354
- const data = _getDataPoints(keys, dataSet);
355
372
  return {
356
373
  colors,
357
374
  opacity,
@@ -361,6 +378,56 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
361
378
  };
362
379
  }
363
380
  }
381
+ function _createDatasetForXCoordinateWithMultipleYValues(allChartPoints) {
382
+ const dataSet = [];
383
+ // Group data points by x-axis value
384
+ const groupedData = {};
385
+ allChartPoints.forEach((dataPoint)=>{
386
+ const xValue = dataPoint.x instanceof Date ? dataPoint.x.toLocaleString() : dataPoint.x;
387
+ if (!groupedData[xValue]) {
388
+ groupedData[xValue] = [];
389
+ }
390
+ groupedData[xValue].push(dataPoint);
391
+ });
392
+ // Aggregate data points for each x-axis value
393
+ Object.keys(groupedData).forEach((xValue)=>{
394
+ const dataPoints = groupedData[xValue];
395
+ dataPoints.forEach((dataPoint, id)=>{
396
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
397
+ const singleDataset = {
398
+ xVal: dataPoints[0].x
399
+ };
400
+ const key = dataPoint.legend ? dataPoint.legend : `chart${id}`;
401
+ singleDataset[key] = dataPoint.y;
402
+ dataSet.push(singleDataset);
403
+ });
404
+ });
405
+ // get all unique keys from each array within the dataSet
406
+ const allLegends = [];
407
+ dataSet.forEach((item)=>{
408
+ Object.keys(item).forEach((key)=>{
409
+ if (key !== 'xVal' && !allLegends.includes(key)) {
410
+ allLegends.push(key);
411
+ }
412
+ });
413
+ });
414
+ dataSet.forEach((item)=>{
415
+ allLegends.forEach((legend)=>{
416
+ if (!item[legend]) {
417
+ item[legend] = 0; // Fill with 0 if the legend is missing
418
+ }
419
+ });
420
+ });
421
+ // exclude all items within dataset having all legend values 0
422
+ const filteredDataSet = dataSet.filter((item)=>{
423
+ return allLegends.some((legend)=>item[legend] !== 0);
424
+ });
425
+ const keys = Array.from(new Set(filteredDataSet.flatMap((item)=>Object.keys(item).filter((key)=>key !== 'xVal'))));
426
+ return {
427
+ keys,
428
+ filteredDataSet
429
+ };
430
+ }
364
431
  function _getCustomizedCallout() {
365
432
  return props.onRenderCalloutPerStack ? props.onRenderCalloutPerStack(stackCalloutProps) : props.onRenderCalloutPerDataPoint ? props.onRenderCalloutPerDataPoint(dataPointCalloutProps) : null;
366
433
  }
@@ -462,9 +529,9 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
462
529
  let lineColor;
463
530
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
464
531
  _data.forEach((singleStackedData, index)=>{
465
- var _points_index_lineOptions, _points_index_lineOptions1, _points_index_lineOptions2, _points_index_lineOptions3, _points_index_lineOptions4;
466
- const yScale = points[index].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
467
- const curveFactory = getCurveFactory((_points_index_lineOptions = points[index].lineOptions) === null || _points_index_lineOptions === void 0 ? void 0 : _points_index_lineOptions.curve, d3CurveBasis);
532
+ var _points_index, _points_index_lineOptions, _points_index1, _points_index_lineOptions1, _points_index2, _points_index_lineOptions2, _points_index3, _points_index_lineOptions3, _points_index4, _points_index_lineOptions4, _points_index5;
533
+ const yScale = ((_points_index = points[index]) === null || _points_index === void 0 ? void 0 : _points_index.useSecondaryYScale) && yScaleSecondary ? yScaleSecondary : yScalePrimary;
534
+ const curveFactory = getCurveFactory((_points_index1 = points[index]) === null || _points_index1 === void 0 ? void 0 : (_points_index_lineOptions = _points_index1.lineOptions) === null || _points_index_lineOptions === void 0 ? void 0 : _points_index_lineOptions.curve, d3CurveBasis);
468
535
  const area = d3Area()// eslint-disable-next-line @typescript-eslint/no-explicit-any
469
536
  .x((d)=>xScale(d.xVal))// eslint-disable-next-line @typescript-eslint/no-explicit-any
470
537
  .y0((d)=>yScale(d.values[0]))// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -492,15 +559,15 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
492
559
  id: `${index}-line-${_uniqueIdForGraph}`,
493
560
  d: line(singleStackedData),
494
561
  fill: 'transparent',
495
- strokeWidth: (_points_index_lineOptions_strokeWidth = (_points_index_lineOptions1 = points[index].lineOptions) === null || _points_index_lineOptions1 === void 0 ? void 0 : _points_index_lineOptions1.strokeWidth) !== null && _points_index_lineOptions_strokeWidth !== void 0 ? _points_index_lineOptions_strokeWidth : 3,
562
+ strokeWidth: (_points_index_lineOptions_strokeWidth = (_points_index2 = points[index]) === null || _points_index2 === void 0 ? void 0 : (_points_index_lineOptions1 = _points_index2.lineOptions) === null || _points_index_lineOptions1 === void 0 ? void 0 : _points_index_lineOptions1.strokeWidth) !== null && _points_index_lineOptions_strokeWidth !== void 0 ? _points_index_lineOptions_strokeWidth : 3,
496
563
  stroke: _colors[index],
497
564
  opacity: _getLineOpacity(points[index].legend),
498
565
  onMouseMove: (event)=>_onRectMouseMove(event),
499
566
  onMouseOut: _onRectMouseOut,
500
567
  onMouseOver: (event)=>_onRectMouseMove(event),
501
- strokeDasharray: (_points_index_lineOptions2 = points[index].lineOptions) === null || _points_index_lineOptions2 === void 0 ? void 0 : _points_index_lineOptions2.strokeDasharray,
502
- strokeDashoffset: (_points_index_lineOptions3 = points[index].lineOptions) === null || _points_index_lineOptions3 === void 0 ? void 0 : _points_index_lineOptions3.strokeDashoffset,
503
- strokeLinecap: (_points_index_lineOptions4 = points[index].lineOptions) === null || _points_index_lineOptions4 === void 0 ? void 0 : _points_index_lineOptions4.strokeLinecap
568
+ strokeDasharray: (_points_index3 = points[index]) === null || _points_index3 === void 0 ? void 0 : (_points_index_lineOptions2 = _points_index3.lineOptions) === null || _points_index_lineOptions2 === void 0 ? void 0 : _points_index_lineOptions2.strokeDasharray,
569
+ strokeDashoffset: (_points_index4 = points[index]) === null || _points_index4 === void 0 ? void 0 : (_points_index_lineOptions3 = _points_index4.lineOptions) === null || _points_index_lineOptions3 === void 0 ? void 0 : _points_index_lineOptions3.strokeDashoffset,
570
+ strokeLinecap: (_points_index5 = points[index]) === null || _points_index5 === void 0 ? void 0 : (_points_index_lineOptions4 = _points_index5.lineOptions) === null || _points_index_lineOptions4 === void 0 ? void 0 : _points_index_lineOptions4.strokeLinecap
504
571
  }), singleStackedData.length === 1 ? /*#__PURE__*/ React.createElement("circle", {
505
572
  id: `${index}-graph-${_uniqueIdForGraph}`,
506
573
  cx: xScale(singleStackedData[0].xVal),
@@ -534,10 +601,11 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
534
601
  const circleRadius = pointOptions && pointOptions.r ? Number(pointOptions.r) : 8;
535
602
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
536
603
  _data.forEach((singleStackedData, index)=>{
604
+ var _points_index;
537
605
  if (points.length === index) {
538
606
  return;
539
607
  }
540
- const yScale = points[index].useSecondaryYScale && yScaleSecondary ? yScaleSecondary : yScalePrimary;
608
+ const yScale = ((_points_index = points[index]) === null || _points_index === void 0 ? void 0 : _points_index.useSecondaryYScale) && yScaleSecondary ? yScaleSecondary : yScalePrimary;
541
609
  if (!props.optimizeLargeData || singleStackedData.length === 1) {
542
610
  // Render circles for all data points
543
611
  graph.push(/*#__PURE__*/ React.createElement("g", {
@@ -561,13 +629,13 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
561
629
  fill: _updateCircleFillColor(xDataPoint, lineColor, circleId),
562
630
  onMouseOut: _onRectMouseOut,
563
631
  onMouseOver: (event)=>_onRectMouseMove(event),
564
- onClick: ()=>_onDataPointClick(points[index].data[pointIndex].onDataPointClick),
632
+ ..._getOnClickHandler(points, index, pointIndex),
565
633
  onFocus: (event)=>_handleFocus(event, index, pointIndex, circleId),
566
634
  onBlur: _handleBlur,
567
635
  ...getSecureProps(pointOptions),
568
636
  r: _getCircleRadius(xDataPoint, circleRadius, circleId, legend),
569
637
  role: "img",
570
- "aria-label": _getAriaLabel(index, pointIndex)
638
+ "aria-label": !_hasDuplicateXValues && !_hasMissingXValues && _getAriaLabel(index, pointIndex) || undefined
571
639
  });
572
640
  })));
573
641
  } else {
@@ -589,7 +657,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
589
657
  onMouseOut: _onRectMouseOut,
590
658
  onMouseOver: (event)=>_onRectMouseMove(event),
591
659
  onFocus: (event)=>_handleFocus(event, index, pointIndex, circleId),
592
- onClick: ()=>_onDataPointClick(points[index].data[pointIndex].onDataPointClick),
660
+ ..._getOnClickHandler(points, index, pointIndex),
593
661
  ...getSecureProps(pointOptions),
594
662
  r: _getCircleRadius(xDataPoint, circleRadius, circleId, legend)
595
663
  }));
@@ -636,6 +704,14 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
636
704
  }
637
705
  return graph;
638
706
  }
707
+ function _getOnClickHandler(points, index, pointIndex) {
708
+ if (!_hasDuplicateXValues && !_hasMissingXValues) {
709
+ return {
710
+ onClick: ()=>_onDataPointClick(points[index].data[pointIndex].onDataPointClick)
711
+ };
712
+ }
713
+ return {};
714
+ }
639
715
  function _getCircleRadius(xDataPoint, circleRadius, circleId, legend) {
640
716
  // Show the circle if no legends are selected or if the point's legend is in the selected legends
641
717
  if (!_noLegendHighlighted() && !_legendHighlighted(legend)) {
@@ -668,6 +744,36 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
668
744
  ] : [];
669
745
  }
670
746
  function _addDefaultColors(lineChartData) {
747
+ if (_hasMissingXValues) {
748
+ // get union of all x values
749
+ const allXValues = new Set();
750
+ lineChartData && lineChartData.forEach((line)=>{
751
+ line.data.forEach((point)=>{
752
+ const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;
753
+ allXValues.add(xValue);
754
+ });
755
+ });
756
+ lineChartData && lineChartData.forEach((line)=>{
757
+ allXValues.forEach((xValue)=>{
758
+ const point = line.data.find((item)=>{
759
+ return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;
760
+ });
761
+ if (!point) {
762
+ line.data.push({
763
+ x: typeof xValue === 'string' ? new Date(xValue) : xValue,
764
+ y: 0,
765
+ legend: line.legend
766
+ });
767
+ }
768
+ });
769
+ // sort the data points by x value
770
+ line.data.sort((a, b)=>{
771
+ const xA = a.x instanceof Date ? a.x.getTime() : a.x;
772
+ const xB = b.x instanceof Date ? b.x.getTime() : b.x;
773
+ return xA < xB ? -1 : xA > xB ? 1 : 0;
774
+ });
775
+ });
776
+ }
671
777
  return lineChartData ? lineChartData.map((item, index)=>{
672
778
  let color;
673
779
  // isInverted property is applicable to v8 themes only
@@ -740,6 +846,52 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
740
846
  const { chartTitle, lineChartData } = props.data;
741
847
  return (chartTitle ? `${chartTitle}. ` : '') + `Area chart with ${(lineChartData === null || lineChartData === void 0 ? void 0 : lineChartData.length) || 0} data series. `;
742
848
  }
849
+ function _xCoordinateContainsMultipleY() {
850
+ const { lineChartData } = props.data;
851
+ if (!lineChartData) {
852
+ return false;
853
+ }
854
+ for (const item of lineChartData){
855
+ const xValueMap = {};
856
+ for (const point of item.data){
857
+ const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;
858
+ if (!xValueMap[xValue]) {
859
+ xValueMap[xValue] = [];
860
+ }
861
+ xValueMap[xValue].push(point.y);
862
+ if (xValueMap[xValue].length > 1) {
863
+ return true;
864
+ }
865
+ }
866
+ }
867
+ return false;
868
+ }
869
+ function _containsMissingXValues() {
870
+ const { lineChartData } = props.data;
871
+ if (!lineChartData) {
872
+ return false;
873
+ }
874
+ const allXValues = new Set();
875
+ lineChartData.forEach((line)=>{
876
+ line.data.forEach((point)=>{
877
+ const xValue = point.x instanceof Date ? point.x.toLocaleString() : point.x;
878
+ allXValues.add(xValue);
879
+ });
880
+ });
881
+ // for all x values, check if the x value is present in all series
882
+ let hasMissingValues = false;
883
+ lineChartData.forEach((line)=>{
884
+ allXValues.forEach((xValue)=>{
885
+ const point = line.data.find((item)=>{
886
+ return item.x instanceof Date ? item.x.toLocaleString() === xValue : item.x === xValue;
887
+ });
888
+ if (!point) {
889
+ hasMissingValues = true;
890
+ }
891
+ });
892
+ });
893
+ return hasMissingValues;
894
+ }
743
895
  function _shouldFillToZeroY() {
744
896
  return props.mode === 'tozeroy' || _containsSecondaryYAxis;
745
897
  }
@@ -765,7 +917,7 @@ export const AreaChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
765
917
  xAxisCalloutAccessibilityData,
766
918
  ...props.calloutProps,
767
919
  clickPosition,
768
- isPopoverOpen,
920
+ isPopoverOpen: isPopoverOpen && !_hasDuplicateXValues && !_hasMissingXValues,
769
921
  isCartesian: true,
770
922
  customCallout: {
771
923
  customizedCallout: _getCustomizedCallout() !== null ? _getCustomizedCallout() : undefined,