@fluentui/react-charts 9.2.1 → 9.2.3

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 (201) hide show
  1. package/CHANGELOG.md +57 -2
  2. package/dist/index.d.ts +168 -15
  3. package/lib/ChartTable.js +1 -0
  4. package/lib/ChartTable.js.map +1 -0
  5. package/lib/components/AreaChart/AreaChart.js +4 -1
  6. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -1
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  9. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +2 -1
  10. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  11. package/lib/components/ChartTable/ChartTable.js +58 -0
  12. package/lib/components/ChartTable/ChartTable.js.map +1 -0
  13. package/lib/components/ChartTable/ChartTable.types.js +1 -0
  14. package/lib/components/ChartTable/ChartTable.types.js.map +1 -0
  15. package/lib/components/ChartTable/index.js +3 -0
  16. package/lib/components/ChartTable/index.js.map +1 -0
  17. package/lib/components/ChartTable/useChartTableStyles.styles.js +93 -0
  18. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -0
  19. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +55 -0
  20. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -0
  21. package/lib/components/CommonComponents/CartesianChart.js +170 -100
  22. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  23. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  24. package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
  25. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +13 -0
  26. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  27. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +12 -0
  28. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  29. package/lib/components/DeclarativeChart/DeclarativeChart.js +180 -102
  30. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  31. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +100 -0
  32. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -0
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +890 -211
  34. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  35. package/lib/components/DonutChart/DonutChart.js +2 -2
  36. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  37. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  38. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  39. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  40. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  41. package/lib/components/GanttChart/useGanttChartStyles.styles.js +2 -1
  42. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  43. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
  44. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  45. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +185 -144
  46. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  47. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
  48. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  49. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +2 -1
  50. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  51. package/lib/components/HeatMapChart/HeatMapChart.js +175 -114
  52. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  53. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
  54. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  55. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
  56. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  57. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  58. package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  59. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +26 -6
  60. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  61. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
  62. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  63. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
  64. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  65. package/lib/components/Legends/Legends.js.map +1 -1
  66. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  67. package/lib/components/LineChart/LineChart.js +251 -78
  68. package/lib/components/LineChart/LineChart.js.map +1 -1
  69. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  70. package/lib/components/LineChart/useLineChartStyles.styles.js +10 -3
  71. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  72. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +14 -2
  73. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  74. package/lib/components/ScatterChart/ScatterChart.js +56 -37
  75. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  76. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  77. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +21 -4
  78. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  79. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +16 -3
  80. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  81. package/lib/components/VerticalBarChart/VerticalBarChart.js +38 -14
  82. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  83. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
  84. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  85. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +2 -1
  86. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  87. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +214 -96
  88. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  89. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  90. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
  91. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  92. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +2 -1
  93. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  94. package/lib/index.js +1 -0
  95. package/lib/index.js.map +1 -1
  96. package/lib/types/DataPoint.js.map +1 -1
  97. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  98. package/lib/utilities/utilities.js +41 -42
  99. package/lib/utilities/utilities.js.map +1 -1
  100. package/lib/utilities/vbc-utils.js +24 -0
  101. package/lib/utilities/vbc-utils.js.map +1 -1
  102. package/lib-commonjs/ChartTable.js +6 -0
  103. package/lib-commonjs/ChartTable.js.map +1 -0
  104. package/lib-commonjs/components/AreaChart/AreaChart.js +4 -1
  105. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  106. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +2 -1
  107. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  108. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +2 -1
  109. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  110. package/lib-commonjs/components/ChartTable/ChartTable.js +69 -0
  111. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -0
  112. package/lib-commonjs/components/ChartTable/ChartTable.types.js +6 -0
  113. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -0
  114. package/lib-commonjs/components/ChartTable/index.js +8 -0
  115. package/lib-commonjs/components/ChartTable/index.js.map +1 -0
  116. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +196 -0
  117. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -0
  118. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +69 -0
  119. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -0
  120. package/lib-commonjs/components/CommonComponents/CartesianChart.js +169 -98
  121. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  122. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  123. package/lib-commonjs/components/CommonComponents/ChartPopover.types.js.map +1 -1
  124. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +13 -0
  125. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  126. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +12 -0
  127. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  128. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +176 -100
  129. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  130. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +128 -0
  131. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -0
  132. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +909 -209
  133. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  134. package/lib-commonjs/components/DonutChart/DonutChart.js +1 -1
  135. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  136. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  137. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  138. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  139. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  140. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +2 -1
  141. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  142. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +2 -1
  143. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  144. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +183 -142
  145. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  146. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +2 -1
  147. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  148. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +2 -1
  149. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +174 -113
  151. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  152. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -1
  153. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  154. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +2 -1
  155. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  156. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  157. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
  158. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +25 -5
  159. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  160. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -1
  161. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  162. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +2 -1
  163. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  164. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  165. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  166. package/lib-commonjs/components/LineChart/LineChart.js +250 -78
  167. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  168. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  169. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +12 -3
  170. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  171. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +14 -2
  172. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  173. package/lib-commonjs/components/ScatterChart/ScatterChart.js +56 -37
  174. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  175. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  176. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +30 -3
  177. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  178. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +15 -2
  179. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  180. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +37 -13
  181. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  182. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +2 -1
  183. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  184. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +2 -1
  185. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  186. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +213 -95
  187. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  188. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  189. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +2 -1
  190. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  191. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +2 -1
  192. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  193. package/lib-commonjs/index.js +1 -0
  194. package/lib-commonjs/index.js.map +1 -1
  195. package/lib-commonjs/types/DataPoint.js.map +1 -1
  196. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  197. package/lib-commonjs/utilities/utilities.js +44 -41
  198. package/lib-commonjs/utilities/utilities.js.map +1 -1
  199. package/lib-commonjs/utilities/vbc-utils.js +27 -0
  200. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  201. package/package.json +10 -10
@@ -36,15 +36,20 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
36
36
  let _xScale;
37
37
  let isIntegralDataset = true;
38
38
  let _tooltipId = (0, _reactutilities.useId)('tooltip_');
39
+ /* Used for when WrapXAxisLabels props appeared.
40
+ * To display the total word (space separated words), Need to have more space than usual.
41
+ * This height will get total height need to disaply total word.
42
+ * These value need to be removed from actual svg height/graph height.
43
+ * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
44
+ */ let _removalValueForTextTuncate = 0;
39
45
  const [containerWidth, setContainerWidth] = _react.useState(0);
40
46
  const [containerHeight, setContainerHeight] = _react.useState(0);
41
- const [isRemoveValCalculated, setIsRemoveValCalculated] = _react.useState(true);
42
- const [removalValueForTextTuncate, setRemovalValueForTextTuncate] = _react.useState(0);
43
47
  const [startFromX, setStartFromX] = _react.useState(0);
44
48
  const [prevProps, setPrevProps] = _react.useState(null);
45
- const chartTypesToCheck = [
49
+ const chartTypesWithStringYAxis = [
46
50
  _index.ChartTypes.HorizontalBarChartWithAxis,
47
51
  _index.ChartTypes.HeatMapChart,
52
+ _index.ChartTypes.VerticalStackedBarChart,
48
53
  _index.ChartTypes.GanttChart
49
54
  ];
50
55
  var _props_margins_top, _props_margins_bottom, _props_margins_left, _props_margins_right, _props_margins_right1, _props_margins_left1;
@@ -60,17 +65,34 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
60
65
  right: _useRtl ? (_props_margins_left = (_props_margins2 = props.margins) === null || _props_margins2 === void 0 ? void 0 : _props_margins2.left) !== null && _props_margins_left !== void 0 ? _props_margins_left : 40 : ((_props_margins_right = (_props_margins3 = props.margins) === null || _props_margins3 === void 0 ? void 0 : _props_margins3.right) !== null && _props_margins_right !== void 0 ? _props_margins_right : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20,
61
66
  left: _useRtl ? ((_props_margins_right1 = (_props_margins4 = props.margins) === null || _props_margins4 === void 0 ? void 0 : _props_margins4.right) !== null && _props_margins_right1 !== void 0 ? _props_margins_right1 : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20 : (_props_margins_left1 = (_props_margins5 = props.margins) === null || _props_margins5 === void 0 ? void 0 : _props_margins5.left) !== null && _props_margins_left1 !== void 0 ? _props_margins_left1 : 40
62
67
  };
68
+ const TITLE_MARGIN = 20;
63
69
  if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {
64
70
  var _props_margins6;
65
71
  var _props_margins_bottom1;
66
- margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : 55;
72
+ margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN;
67
73
  }
68
74
  if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {
69
75
  var _props_margins7, _props_margins8, _props_margins9, _props_margins10;
70
76
  var _props_margins_right2, _props_margins_left2;
71
- margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? 80 : 40 : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : 60;
77
+ margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN;
72
78
  var _props_margins_left3, _props_margins_right3;
73
- margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : 60 : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? 80 : 40;
79
+ margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN;
80
+ }
81
+ if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {
82
+ var _props_margins11;
83
+ var _props_margins_top1;
84
+ margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN;
85
+ }
86
+ if (props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')) {
87
+ if (_useRtl) {
88
+ var _props_margins12;
89
+ var _props_margins_right4;
90
+ margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN;
91
+ } else {
92
+ var _props_margins13;
93
+ var _props_margins_right5;
94
+ margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN;
95
+ }
74
96
  }
75
97
  const classes = (0, _useCartesianChartStylesstyles.useCartesianChartStyles)(props);
76
98
  const focusAttributes = (0, _reacttabster.useFocusableGroup)();
@@ -83,8 +105,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
83
105
  if (props !== null) {
84
106
  setPrevProps(props);
85
107
  }
86
- if (chartTypesToCheck.includes(props.chartType) && props.showYAxisLables && yAxisElement) {
87
- const maxYAxisLabelLength = calculateMaxYAxisLabelLength(props.chartType, props.points, classes.yAxis);
108
+ if (chartTypesWithStringYAxis.includes(props.chartType) && props.showYAxisLables && yAxisElement && props.yAxisType === _index.YAxisType.StringAxis) {
109
+ const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis);
88
110
  if (startFromX !== maxYAxisLabelLength) {
89
111
  setStartFromX(maxYAxisLabelLength);
90
112
  }
@@ -106,8 +128,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
106
128
  _fitParentContainer();
107
129
  }
108
130
  }
109
- if (chartTypesToCheck.includes(props.chartType) && props.showYAxisLables && yAxisElement) {
110
- const maxYAxisLabelLength = calculateMaxYAxisLabelLength(props.chartType, props.points, classes.yAxis);
131
+ if (chartTypesWithStringYAxis.includes(props.chartType) && props.showYAxisLables && yAxisElement && props.yAxisType === _index.YAxisType.StringAxis) {
132
+ const maxYAxisLabelLength = calculateMaxYAxisLabelLength(classes.yAxis);
111
133
  if (startFromX !== maxYAxisLabelLength) {
112
134
  setStartFromX(maxYAxisLabelLength);
113
135
  }
@@ -122,19 +144,6 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
122
144
  props,
123
145
  prevProps
124
146
  ]);
125
- _react.useEffect(()=>{
126
- if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType === _index.XAxisTypes.StringAxis) {
127
- const rotateLabelProps = {
128
- node: xAxisElement.current,
129
- xAxis: _xScale
130
- };
131
- const rotatedHeight = (0, _index.rotateXAxisLabels)(rotateLabelProps);
132
- if (isRemoveValCalculated && removalValueForTextTuncate !== rotatedHeight + margins.bottom && rotatedHeight > 0) {
133
- setRemovalValueForTextTuncate(rotatedHeight + margins.bottom);
134
- setIsRemoveValCalculated(false);
135
- }
136
- }
137
- });
138
147
  _react.useImperativeHandle(props.componentRef, ()=>{
139
148
  var _chartContainer_current;
140
149
  return {
@@ -151,19 +160,14 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
151
160
  function _generateCallout(calloutProps) {
152
161
  return /*#__PURE__*/ _react.createElement(_ChartPopover.ChartPopover, calloutProps);
153
162
  }
154
- function calculateMaxYAxisLabelLength(chartType, points, className) {
163
+ function calculateMaxYAxisLabelLength(className) {
155
164
  const formatTickLabel = (str)=>{
156
165
  if (props.showYAxisLablesTooltip) {
157
166
  return (0, _index.truncateString)(str, props.noOfCharsToTruncate || 4);
158
167
  }
159
168
  return str;
160
169
  };
161
- if (chartType === _index.ChartTypes.HeatMapChart) {
162
- var _points__data, _points_;
163
- return (0, _index.calculateLongestLabelWidth)((_points_ = points[0]) === null || _points_ === void 0 ? void 0 : (_points__data = _points_.data) === null || _points__data === void 0 ? void 0 : _points__data.map((point)=>formatTickLabel(`${point.y}`)), `.${className} text`);
164
- } else {
165
- return (0, _index.calculateLongestLabelWidth)(points === null || points === void 0 ? void 0 : points.map((point)=>formatTickLabel(`${point.y}`)), `.${className} text`);
166
- }
170
+ return (0, _index.calculateLongestLabelWidth)(props.stringDatasetForYAxisDomain.map((label)=>formatTickLabel(label)), `.${className} text`);
167
171
  }
168
172
  const { calloutProps, points, chartType, svgProps, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter } = props;
169
173
  if (props.parentRef) {
@@ -172,7 +176,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
172
176
  const margin = {
173
177
  ...margins
174
178
  };
175
- if (chartTypesToCheck.includes(props.chartType)) {
179
+ // Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
180
+ if (chartTypesWithStringYAxis.includes(props.chartType)) {
176
181
  if (!_useRtl) {
177
182
  margin.left += startFromX;
178
183
  } else {
@@ -188,7 +193,13 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
188
193
  var _props_showRoundOffXTickValues;
189
194
  const XAxisParams = {
190
195
  domainNRangeValues: props.getDomainNRangeValues(points, props.getDomainMargins ? props.getDomainMargins(containerWidth) : margins, containerWidth, chartType, _useRtl, props.xAxisType, props.barwidth, props.tickValues, startFromX),
191
- containerHeight: containerHeight - removalValueForTextTuncate,
196
+ // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
197
+ // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
198
+ // However, if transformation props are enabled, the updated _removalValueForTextTuncate
199
+ // will only be available in the next render, as it's set after the axis is created.
200
+ // Solution: Delay the creation of gridlines until after the transformation has been applied,
201
+ // or precompute the required height for transformed labels (_removalValueForTextTuncate).
202
+ containerHeight: containerHeight - _removalValueForTextTuncate,
192
203
  margins: margins,
193
204
  xAxisElement: xAxisElement.current,
194
205
  showRoundOffXTickValues: (_props_showRoundOffXTickValues = props.showRoundOffXTickValues) !== null && _props_showRoundOffXTickValues !== void 0 ? _props_showRoundOffXTickValues : true,
@@ -199,24 +210,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
199
210
  xAxisInnerPadding: props.xAxisInnerPadding,
200
211
  xAxisOuterPadding: props.xAxisOuterPadding,
201
212
  containerWidth: containerWidth,
202
- hideTickOverlap: props.hideTickOverlap && !props.rotateXAxisLables && !props.showXAxisLablesTooltip && !props.wrapXAxisLables
203
- };
204
- const YAxisParams = {
205
- margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,
206
- containerWidth: containerWidth,
207
- containerHeight: containerHeight - removalValueForTextTuncate,
208
- yAxisElement: yAxisElement.current,
209
- yAxisTickFormat: props.yAxisTickFormat,
210
- yAxisTickCount: props.yAxisTickCount,
211
- yMinValue: props.yMinValue || 0,
212
- yMaxValue: props.yMaxValue || 0,
213
- tickPadding: props.showYAxisLablesTooltip ? 15 : 10,
214
- maxOfYVal: props.maxOfYVal,
215
- yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),
216
- // please note these padding default values must be consistent in here
217
- // and the parent chart(HBWA/Vertical etc..) for more details refer example
218
- // http://using-d3js.com/04_07_ordinal_scales.html
219
- yAxisPadding: props.yAxisPadding || 0
213
+ hideTickOverlap: props.rotateXAxisLables ? false : props.hideTickOverlap,
214
+ calcMaxLabelWidth: _calcMaxLabelWidthWithTransform
220
215
  };
221
216
  /**
222
217
  * These scales used for 2 purposes.
@@ -241,25 +236,24 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
241
236
  }
242
237
  _xScale = xScale;
243
238
  _tickValues = tickValues;
244
- /*
245
- * To enable wrapping of x axis tick values or to display complete x axis tick values,
246
- * we need to calculate how much space it needed to render the text.
247
- * No need to re-calculate every time the chart renders and same time need to get an update. So using set
248
- * Required space will be calculated first time chart rendering and if any width/height of chart updated.
249
- * */ if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {
250
- const wrapLabelProps = {
251
- node: xAxisElement.current,
252
- xAxis: xScale,
253
- showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,
254
- noOfCharsToTruncate: props.noOfCharsToTruncate || 4
255
- };
256
- const temp = xScale && (0, _index.createWrapOfXLabels)(wrapLabelProps);
257
- // this value need to be updated for draw graph updated. So instead of using private value, using set
258
- if (isRemoveValCalculated && removalValueForTextTuncate !== temp) {
259
- setRemovalValueForTextTuncate(temp);
260
- setIsRemoveValCalculated(false);
261
- }
262
- }
239
+ _transformXAxisLabels();
240
+ const YAxisParams = {
241
+ margins: props.getYDomainMargins ? props.getYDomainMargins(containerHeight) : margins,
242
+ containerWidth: containerWidth,
243
+ containerHeight: containerHeight - _removalValueForTextTuncate,
244
+ yAxisElement: yAxisElement.current,
245
+ yAxisTickFormat: props.yAxisTickFormat,
246
+ yAxisTickCount: props.yAxisTickCount,
247
+ yMinValue: props.yMinValue || 0,
248
+ yMaxValue: props.yMaxValue || 0,
249
+ tickPadding: 10,
250
+ maxOfYVal: props.maxOfYVal,
251
+ yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType),
252
+ // please note these padding default values must be consistent in here
253
+ // and the parent chart(HBWA/Vertical etc..) for more details refer example
254
+ // http://using-d3js.com/04_07_ordinal_scales.html
255
+ yAxisPadding: props.yAxisPadding || 0
256
+ };
263
257
  /**
264
258
  * These scales used for 2 purposes.
265
259
  * 1. To create x and y axis
@@ -273,7 +267,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
273
267
  yAxisDomainValues: []
274
268
  };
275
269
  if (props.yAxisType && props.yAxisType === _index.YAxisType.StringAxis) {
276
- yScalePrimary = props.createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, props.barwidth);
270
+ yScalePrimary = props.createStringYAxis(YAxisParams, props.stringDatasetForYAxisDomain, _useRtl, props.barwidth, props.chartType);
277
271
  } else {
278
272
  // TODO: Since the scale domain values are now computed independently for both the primary and
279
273
  // secondary y-axes, the yMinValue and yMaxValue props are no longer necessary for accurately
@@ -286,7 +280,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
286
280
  const YAxisParamsSecondary = {
287
281
  margins: margins,
288
282
  containerWidth: containerWidth,
289
- containerHeight: containerHeight - removalValueForTextTuncate,
283
+ containerHeight: containerHeight - _removalValueForTextTuncate,
290
284
  yAxisElement: yAxisElementSecondary.current,
291
285
  yAxisTickFormat: props.yAxisTickFormat,
292
286
  yAxisTickCount: props.yAxisTickCount,
@@ -300,7 +294,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
300
294
  }
301
295
  yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks);
302
296
  }
303
- if (chartTypesToCheck.includes(props.chartType)) {
297
+ if (chartTypesWithStringYAxis.includes(props.chartType) && props.yAxisType === _index.YAxisType.StringAxis) {
304
298
  // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
305
299
  // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
306
300
  // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with _tooltipId)
@@ -333,7 +327,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
333
327
  // Call back to the chart.
334
328
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
335
329
  const _getData = (xScale, yScalePrimary, yScaleSecondary)=>{
336
- props.getGraphData && props.getGraphData(xScale, yScalePrimary, containerHeight - removalValueForTextTuncate, containerWidth, xAxisElement.current, yAxisElement.current, yScaleSecondary);
330
+ props.getGraphData && props.getGraphData(xScale, yScalePrimary, containerHeight - _removalValueForTextTuncate, containerWidth, xAxisElement.current, yAxisElement.current, yScaleSecondary);
337
331
  };
338
332
  props.getAxisData && props.getAxisData(axisData);
339
333
  // Callback function for chart, returns axis
@@ -354,7 +348,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
354
348
  height: containerHeight
355
349
  };
356
350
  const xAxisTitleMaximumAllowedWidth = svgDimensions.width - margins.left - margins.right - startFromX;
357
- const yAxisTitleMaximumAllowedHeight = svgDimensions.height - margins.bottom - margins.top - removalValueForTextTuncate - titleMargin;
351
+ const yAxisTitleMaximumAllowedHeight = svgDimensions.height - margins.bottom - margins.top - _removalValueForTextTuncate - titleMargin;
358
352
  /**
359
353
  * When screen resizes, along with screen, chart also auto adjusted.
360
354
  * This method used to adjust height and width of the charts.
@@ -385,39 +379,88 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
385
379
  props.onChartMouseLeave && props.onChartMouseLeave();
386
380
  }
387
381
  function _calculateChartMinWidth() {
388
- let labelWidth = 10; // Total padding on the left and right sides of the label
382
+ // Adding 10px for padding on both sides
383
+ const labelWidth = _calcMaxLabelWidthWithTransform(_tickValues) + 10;
384
+ let minChartWidth = margins.left + margins.right + labelWidth * (_tickValues.length - 1);
385
+ if ([
386
+ _index.ChartTypes.GroupedVerticalBarChart,
387
+ _index.ChartTypes.VerticalBarChart,
388
+ _index.ChartTypes.VerticalStackedBarChart
389
+ ].includes(props.chartType)) {
390
+ const minDomainMargin = 8;
391
+ minChartWidth += minDomainMargin * 2;
392
+ }
393
+ return minChartWidth;
394
+ }
395
+ function _calcMaxLabelWidthWithTransform(x) {
389
396
  // Case: rotated labels
390
397
  if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType === _index.XAxisTypes.StringAxis) {
391
- const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(_tickValues, `.${classes.xAxis} text`);
392
- labelWidth += Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));
393
- } else if (props.showXAxisLablesTooltip) {
394
- const tickValues = _tickValues.map((val)=>{
398
+ const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(x, `.${classes.xAxis} text`);
399
+ return Math.ceil(longestLabelWidth * Math.cos(Math.PI / 4));
400
+ }
401
+ // Case: truncated labels
402
+ if (props.showXAxisLablesTooltip) {
403
+ const tickValues = x.map((val)=>{
395
404
  const numChars = props.noOfCharsToTruncate || 4;
396
405
  return val.toString().length > numChars ? `${val.toString().slice(0, numChars)}...` : val;
397
406
  });
398
407
  const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(tickValues, `.${classes.xAxis} text`);
399
- labelWidth += Math.ceil(longestLabelWidth);
400
- } else if (props.wrapXAxisLables) {
408
+ return Math.ceil(longestLabelWidth);
409
+ }
410
+ // Case: wrapped labels
411
+ if (props.wrapXAxisLables) {
412
+ // FIXME: Calculate the max width of lines instead of words. This requires applying
413
+ // the wrapping transformation earlier to obtain the actual rendered lines.
401
414
  const words = [];
402
- _tickValues.forEach((val)=>{
415
+ x.forEach((val)=>{
403
416
  words.push(...val.toString().split(/\s+/));
404
417
  });
418
+ // This approach works well in most cases, since overflow typically occurs only when
419
+ // a single word exceeds the specified width — otherwise, the text will wrap as expected.
405
420
  const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(words, `.${classes.xAxis} text`);
406
- labelWidth += Math.max(Math.ceil(longestLabelWidth), 10);
407
- } else {
408
- const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(_tickValues, `.${classes.xAxis} text`);
409
- labelWidth += Math.ceil(longestLabelWidth);
421
+ return Math.max(Math.ceil(longestLabelWidth), _index.DEFAULT_WRAP_WIDTH);
410
422
  }
411
- let minChartWidth = margins.left + margins.right + labelWidth * (_tickValues.length - 1);
412
- if ([
413
- _index.ChartTypes.GroupedVerticalBarChart,
414
- _index.ChartTypes.VerticalBarChart,
415
- _index.ChartTypes.VerticalStackedBarChart
416
- ].includes(props.chartType)) {
417
- const minDomainMargin = 8;
418
- minChartWidth += minDomainMargin * 2;
423
+ // Default case
424
+ const longestLabelWidth = (0, _index.calculateLongestLabelWidth)(x, `.${classes.xAxis} text`);
425
+ return Math.ceil(longestLabelWidth);
426
+ }
427
+ function _transformXAxisLabels() {
428
+ _removalValueForTextTuncate = 0;
429
+ /*
430
+ * To enable wrapping of x axis tick values or to display complete x axis tick values,
431
+ * we need to calculate how much space it needed to render the text.
432
+ * No need to re-calculate every time the chart renders and same time need to get an update. So using setState.
433
+ * Required space will be calculated first time chart rendering and if any width/height of chart updated.
434
+ * */ if (props.wrapXAxisLables || props.showXAxisLablesTooltip) {
435
+ let maxXAxisLabelWidth;
436
+ if (props.xAxisType === _index.XAxisTypes.StringAxis) {
437
+ var _props_datasetForXAxisDomain;
438
+ if ((((_props_datasetForXAxisDomain = props.datasetForXAxisDomain) === null || _props_datasetForXAxisDomain === void 0 ? void 0 : _props_datasetForXAxisDomain.length) || 0) > 1) {
439
+ maxXAxisLabelWidth = _xScale.step();
440
+ } else {
441
+ maxXAxisLabelWidth = containerWidth;
442
+ }
443
+ }
444
+ const wrapLabelProps = {
445
+ node: xAxisElement.current,
446
+ xAxis: _xScale,
447
+ showXAxisLablesTooltip: props.showXAxisLablesTooltip || false,
448
+ noOfCharsToTruncate: props.noOfCharsToTruncate || 4,
449
+ width: maxXAxisLabelWidth
450
+ };
451
+ var _createWrapOfXLabels;
452
+ _removalValueForTextTuncate = (_createWrapOfXLabels = (0, _index.createWrapOfXLabels)(wrapLabelProps)) !== null && _createWrapOfXLabels !== void 0 ? _createWrapOfXLabels : 0;
453
+ }
454
+ if (!props.wrapXAxisLables && props.rotateXAxisLables && props.xAxisType === _index.XAxisTypes.StringAxis) {
455
+ const rotateLabelProps = {
456
+ node: xAxisElement.current,
457
+ xAxis: _xScale
458
+ };
459
+ var _rotateXAxisLabels;
460
+ const rotatedHeight = (_rotateXAxisLabels = (0, _index.rotateXAxisLabels)(rotateLabelProps)) !== null && _rotateXAxisLabels !== void 0 ? _rotateXAxisLabels : 0;
461
+ // margins.bottom is used as padding here
462
+ _removalValueForTextTuncate = rotatedHeight + margins.bottom;
419
463
  }
420
- return minChartWidth;
421
464
  }
422
465
  /**
423
466
  * We have use the {@link defaultTabbableElement } to fix
@@ -462,7 +505,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
462
505
  },
463
506
  id: `xAxisGElement${idForGraph}`,
464
507
  // To add wrap of x axis lables feature, need to remove word height from svg height.
465
- transform: `translate(0, ${svgDimensions.height - margins.bottom - removalValueForTextTuncate})`,
508
+ transform: `translate(0, ${svgDimensions.height - margins.bottom - _removalValueForTextTuncate})`,
466
509
  className: classes.xAxis
467
510
  }), props.xAxisTitle !== undefined && props.xAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
468
511
  content: props.xAxisTitle,
@@ -476,6 +519,19 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
476
519
  wrapContent: _index.wrapContent,
477
520
  showBackground: true,
478
521
  className: classes.svgTooltip
522
+ }), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
523
+ content: props.xAxisAnnotation,
524
+ textProps: {
525
+ x: margins.left + startFromX + xAxisTitleMaximumAllowedWidth / 2,
526
+ y: titleMargin + 3,
527
+ className: classes.axisAnnotation,
528
+ textAnchor: 'middle',
529
+ 'aria-hidden': true
530
+ },
531
+ maxWidth: xAxisTitleMaximumAllowedWidth,
532
+ wrapContent: _index.wrapContent,
533
+ showBackground: true,
534
+ className: classes.svgTooltip
479
535
  }), /*#__PURE__*/ _react.createElement("g", {
480
536
  ref: (e)=>{
481
537
  yAxisElement.current = e;
@@ -493,7 +549,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
493
549
  }), props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
494
550
  content: props.secondaryYAxistitle,
495
551
  textProps: {
496
- x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + removalValueForTextTuncate,
552
+ x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
497
553
  y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right,
498
554
  textAnchor: 'middle',
499
555
  transform: `translate(${_useRtl ? margins.right / 2 - titleMargin : margins.right / 2 + titleMargin},
@@ -507,7 +563,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
507
563
  })), children, props.yAxisTitle !== undefined && props.yAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
508
564
  content: props.yAxisTitle,
509
565
  textProps: {
510
- x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + removalValueForTextTuncate,
566
+ x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
511
567
  y: _useRtl ? svgDimensions.width - margins.right / 2 + titleMargin : margins.left / 2 - titleMargin,
512
568
  textAnchor: 'middle',
513
569
  transform: `translate(0,
@@ -518,6 +574,21 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
518
574
  wrapContent: _index.wrapContent,
519
575
  showBackground: true,
520
576
  className: classes.svgTooltip
577
+ }), props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
578
+ content: props.yAxisAnnotation,
579
+ textProps: {
580
+ x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
581
+ y: _useRtl ? startFromX - titleMargin : svgDimensions.width - margins.right,
582
+ textAnchor: 'middle',
583
+ transform: `translate(${_useRtl ? margins.right / 2 - titleMargin : margins.right / 2 + titleMargin},
584
+ ${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
585
+ className: classes.axisAnnotation,
586
+ 'aria-hidden': true
587
+ },
588
+ maxWidth: yAxisTitleMaximumAllowedHeight,
589
+ wrapContent: _index.wrapContent,
590
+ showBackground: true,
591
+ className: classes.svgTooltip
521
592
  }))), !props.hideLegend && /*#__PURE__*/ _react.createElement("div", {
522
593
  ref: (e)=>legendContainer = e,
523
594
  className: classes.legendContainer