@fluentui/react-charting 5.25.1 → 5.25.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 (285) hide show
  1. package/CHANGELOG.json +123 -1
  2. package/CHANGELOG.md +34 -2
  3. package/dist/react-charting.d.ts +48 -45
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +24 -11
  7. package/lib/AnnotationOnlyChart.d.ts +1 -0
  8. package/lib/AnnotationOnlyChart.js +2 -0
  9. package/lib/AnnotationOnlyChart.js.map +1 -0
  10. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  11. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +158 -0
  12. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  13. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  14. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +2 -0
  15. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  16. package/lib/components/AnnotationOnlyChart/index.d.ts +2 -0
  17. package/lib/components/AnnotationOnlyChart/index.js +3 -0
  18. package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
  19. package/lib/components/AreaChart/AreaChart.base.js +2 -2
  20. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  21. package/lib/components/ChartTable/ChartTable.base.js +5 -3
  22. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  23. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  24. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  25. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  26. package/lib/components/CommonComponents/Annotations/index.d.ts +2 -0
  27. package/lib/components/CommonComponents/Annotations/index.js +3 -0
  28. package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
  29. package/lib/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  30. package/lib/components/CommonComponents/CartesianChart.base.js +131 -157
  31. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  32. package/lib/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  33. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  34. package/lib/components/DeclarativeChart/DeclarativeChart.js +85 -51
  35. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  36. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  37. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  38. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  39. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +176 -63
  40. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  41. package/lib/components/DonutChart/DonutChart.base.js +5 -3
  42. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  43. package/lib/components/FunnelChart/FunnelChart.base.js +15 -18
  44. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  45. package/lib/components/GanttChart/GanttChart.base.js +6 -6
  46. package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
  47. package/lib/components/GanttChart/GanttChart.types.d.ts +0 -11
  48. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  49. package/lib/components/GaugeChart/GaugeChart.base.js +5 -3
  50. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  51. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +11 -6
  52. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  53. package/lib/components/HeatMapChart/HeatMapChart.base.js +3 -3
  54. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  55. package/lib/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  56. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  57. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  58. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +4 -4
  59. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  60. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  61. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  62. package/lib/components/Legends/Legends.base.d.ts +1 -1
  63. package/lib/components/Legends/Legends.base.js +6 -2
  64. package/lib/components/Legends/Legends.base.js.map +1 -1
  65. package/lib/components/Legends/Legends.types.d.ts +1 -1
  66. package/lib/components/Legends/Legends.types.js.map +1 -1
  67. package/lib/components/LineChart/LineChart.base.js +3 -3
  68. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  69. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  70. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  71. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  72. package/lib/components/SankeyChart/SankeyChart.base.js +5 -3
  73. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  74. package/lib/components/ScatterChart/ScatterChart.base.js +41 -31
  75. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  76. package/lib/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  77. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  78. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  79. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  80. package/lib/components/VerticalBarChart/VerticalBarChart.base.js +6 -4
  81. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  82. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +22 -10
  83. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  84. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  85. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  86. package/lib/index.d.ts +2 -0
  87. package/lib/index.js +1 -0
  88. package/lib/index.js.map +1 -1
  89. package/lib/types/IChartAnnotation.d.ts +2 -0
  90. package/lib/types/IChartAnnotation.js.map +1 -1
  91. package/lib/utilities/image-export-utils.d.ts +7 -2
  92. package/lib/utilities/image-export-utils.js +176 -86
  93. package/lib/utilities/image-export-utils.js.map +1 -1
  94. package/lib/utilities/utilities.d.ts +5 -4
  95. package/lib/utilities/utilities.js +18 -17
  96. package/lib/utilities/utilities.js.map +1 -1
  97. package/lib-amd/AnnotationOnlyChart.d.ts +1 -0
  98. package/lib-amd/AnnotationOnlyChart.js +6 -0
  99. package/lib-amd/AnnotationOnlyChart.js.map +1 -0
  100. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  101. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js +159 -0
  102. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  103. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  104. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +5 -0
  105. package/lib-amd/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  106. package/lib-amd/components/AnnotationOnlyChart/index.d.ts +2 -0
  107. package/lib-amd/components/AnnotationOnlyChart/index.js +7 -0
  108. package/lib-amd/components/AnnotationOnlyChart/index.js.map +1 -0
  109. package/lib-amd/components/AreaChart/AreaChart.base.js +1 -1
  110. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  111. package/lib-amd/components/ChartTable/ChartTable.base.js +4 -2
  112. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  113. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  114. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  115. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  116. package/lib-amd/components/CommonComponents/Annotations/index.d.ts +2 -0
  117. package/lib-amd/components/CommonComponents/Annotations/index.js +7 -0
  118. package/lib-amd/components/CommonComponents/Annotations/index.js.map +1 -0
  119. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  120. package/lib-amd/components/CommonComponents/CartesianChart.base.js +131 -157
  121. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  122. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  123. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  124. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js +80 -50
  125. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  126. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  127. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  128. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  129. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +178 -64
  130. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  131. package/lib-amd/components/DonutChart/DonutChart.base.js +4 -2
  132. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  133. package/lib-amd/components/FunnelChart/FunnelChart.base.js +13 -16
  134. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  135. package/lib-amd/components/GanttChart/GanttChart.base.js +5 -5
  136. package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
  137. package/lib-amd/components/GanttChart/GanttChart.types.d.ts +0 -11
  138. package/lib-amd/components/GanttChart/GanttChart.types.js.map +1 -1
  139. package/lib-amd/components/GaugeChart/GaugeChart.base.js +4 -2
  140. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  141. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +10 -6
  142. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  143. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js +2 -2
  144. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  145. package/lib-amd/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  146. package/lib-amd/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  147. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  148. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
  149. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  150. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  151. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  152. package/lib-amd/components/Legends/Legends.base.d.ts +1 -1
  153. package/lib-amd/components/Legends/Legends.base.js +6 -2
  154. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  155. package/lib-amd/components/Legends/Legends.types.d.ts +1 -1
  156. package/lib-amd/components/Legends/Legends.types.js.map +1 -1
  157. package/lib-amd/components/LineChart/LineChart.base.js +2 -2
  158. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  159. package/lib-amd/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  160. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  161. package/lib-amd/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  162. package/lib-amd/components/SankeyChart/SankeyChart.base.js +4 -2
  163. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  164. package/lib-amd/components/ScatterChart/ScatterChart.base.js +39 -29
  165. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  166. package/lib-amd/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  167. package/lib-amd/components/ScatterChart/ScatterChart.types.js.map +1 -1
  168. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  169. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  170. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
  171. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  172. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +20 -8
  173. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  174. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  175. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  176. package/lib-amd/index.d.ts +2 -0
  177. package/lib-amd/index.js +3 -2
  178. package/lib-amd/index.js.map +1 -1
  179. package/lib-amd/types/IChartAnnotation.d.ts +2 -0
  180. package/lib-amd/types/IChartAnnotation.js.map +1 -1
  181. package/lib-amd/utilities/image-export-utils.d.ts +7 -2
  182. package/lib-amd/utilities/image-export-utils.js +175 -85
  183. package/lib-amd/utilities/image-export-utils.js.map +1 -1
  184. package/lib-amd/utilities/utilities.d.ts +5 -4
  185. package/lib-amd/utilities/utilities.js +18 -17
  186. package/lib-amd/utilities/utilities.js.map +1 -1
  187. package/lib-commonjs/AnnotationOnlyChart.d.ts +1 -0
  188. package/lib-commonjs/AnnotationOnlyChart.js +5 -0
  189. package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
  190. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.d.ts +3 -0
  191. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +162 -0
  192. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  193. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.d.ts +33 -0
  194. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +3 -0
  195. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  196. package/lib-commonjs/components/AnnotationOnlyChart/index.d.ts +2 -0
  197. package/lib-commonjs/components/AnnotationOnlyChart/index.js +6 -0
  198. package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
  199. package/lib-commonjs/components/AreaChart/AreaChart.base.js +1 -1
  200. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  201. package/lib-commonjs/components/ChartTable/ChartTable.base.js +4 -2
  202. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  203. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +1 -1
  204. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +18 -14
  205. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  206. package/lib-commonjs/components/CommonComponents/Annotations/index.d.ts +2 -0
  207. package/lib-commonjs/components/CommonComponents/Annotations/index.js +6 -0
  208. package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
  209. package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +6 -1
  210. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +131 -157
  211. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  212. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +11 -2
  213. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  214. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +83 -49
  215. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  216. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +12 -4
  217. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  218. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.d.ts +2 -0
  219. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +178 -64
  220. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  221. package/lib-commonjs/components/DonutChart/DonutChart.base.js +4 -2
  222. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  223. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js +13 -16
  224. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  225. package/lib-commonjs/components/GanttChart/GanttChart.base.js +5 -5
  226. package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
  227. package/lib-commonjs/components/GanttChart/GanttChart.types.d.ts +0 -11
  228. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  229. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js +4 -2
  230. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  231. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js +10 -5
  232. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  233. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js +2 -2
  234. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  235. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.d.ts +0 -9
  236. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  237. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  238. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js +3 -3
  239. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  240. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.d.ts +0 -9
  241. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  242. package/lib-commonjs/components/Legends/Legends.base.d.ts +1 -1
  243. package/lib-commonjs/components/Legends/Legends.base.js +6 -2
  244. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  245. package/lib-commonjs/components/Legends/Legends.types.d.ts +1 -1
  246. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  247. package/lib-commonjs/components/LineChart/LineChart.base.js +2 -2
  248. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  249. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  250. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
  251. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  252. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js +4 -2
  253. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  254. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js +39 -29
  255. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  256. package/lib-commonjs/components/ScatterChart/ScatterChart.types.d.ts +0 -4
  257. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  258. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  259. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  260. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js +5 -3
  261. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  262. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js +20 -8
  263. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  264. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.d.ts +0 -9
  265. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  266. package/lib-commonjs/index.d.ts +2 -0
  267. package/lib-commonjs/index.js +3 -1
  268. package/lib-commonjs/index.js.map +1 -1
  269. package/lib-commonjs/types/IChartAnnotation.d.ts +2 -0
  270. package/lib-commonjs/types/IChartAnnotation.js.map +1 -1
  271. package/lib-commonjs/utilities/image-export-utils.d.ts +7 -2
  272. package/lib-commonjs/utilities/image-export-utils.js +175 -85
  273. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  274. package/lib-commonjs/utilities/utilities.d.ts +5 -4
  275. package/lib-commonjs/utilities/utilities.js +18 -17
  276. package/lib-commonjs/utilities/utilities.js.map +1 -1
  277. package/package.json +5 -5
  278. package/src/components/AnnotationOnlyChart/AnnotationOnlyChart.types.ts +34 -0
  279. package/src/components/CommonComponents/CartesianChart.types.ts +12 -1
  280. package/src/components/GanttChart/GanttChart.types.ts +0 -13
  281. package/src/components/HeatMapChart/HeatMapChart.types.ts +0 -11
  282. package/src/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.ts +0 -11
  283. package/src/components/Legends/Legends.types.ts +1 -1
  284. package/src/components/ScatterChart/ScatterChart.types.ts +0 -5
  285. package/src/components/VerticalStackedBarChart/VerticalStackedBarChart.types.ts +0 -11
@@ -16,13 +16,11 @@ var getClassNames = (0, Utilities_1.classNamesFunction)();
16
16
  var ChartHoverCard = React.lazy(function () {
17
17
  return Promise.resolve().then(function () { return require('../../utilities/ChartHoverCard/ChartHoverCard'); }).then(function (module) { return ({ default: module.ChartHoverCard }); });
18
18
  });
19
- var chartTypesWithStringYAxis = [
20
- index_1.ChartTypes.HorizontalBarChartWithAxis,
21
- index_1.ChartTypes.HeatMapChart,
22
- index_1.ChartTypes.VerticalStackedBarChart,
23
- index_1.ChartTypes.GanttChart,
24
- index_1.ChartTypes.ScatterChart,
25
- ];
19
+ var HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;
20
+ var VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;
21
+ var AXIS_TITLE_PADDING = 8;
22
+ var DEFAULT_MARGIN_WITH_TICKS = 40;
23
+ var DEFAULT_MARGIN_NO_TICKS = 20;
26
24
  /**
27
25
  * Cartesian chart used for
28
26
  * 1.draw X and Y axis of the chart
@@ -32,7 +30,6 @@ var chartTypesWithStringYAxis = [
32
30
  var CartesianChartBase = /** @class */ (function (_super) {
33
31
  tslib_1.__extends(CartesianChartBase, _super);
34
32
  function CartesianChartBase(props) {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
36
33
  var _this = _super.call(this, props) || this;
37
34
  _this.minLegendContainerHeight = 32;
38
35
  _this._isRtl = (0, Utilities_1.getRTL)();
@@ -44,6 +41,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
44
41
  * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
45
42
  */
46
43
  _this._removalValueForTextTuncate = 0;
44
+ _this._yAxisTickText = [];
47
45
  _this.isIntegralDataset = true;
48
46
  _this.calculateMaxYAxisLabelLength = function (className) {
49
47
  var formatTickLabel = function (str) {
@@ -52,7 +50,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
52
50
  }
53
51
  return str;
54
52
  };
55
- return (0, index_1.calculateLongestLabelWidth)(_this.props.stringDatasetForYAxisDomain.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
53
+ return (0, index_1.calculateLongestLabelWidth)(_this._yAxisTickText.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
56
54
  };
57
55
  // TO DO: Write a common functional component for Multi value callout and divide sub count method
58
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -188,6 +186,55 @@ var CartesianChartBase = /** @class */ (function (_super) {
188
186
  _this._removalValueForTextTuncate = rotatedHeight + _this.margins.bottom;
189
187
  }
190
188
  };
189
+ _this._calcMargins = function () {
190
+ var margins = _this._getDefaultMargins();
191
+ margins = _this._applyTitleMargins(margins);
192
+ margins = _this._applyAnnotationMargins(margins);
193
+ if (_this._isRtl) {
194
+ margins = _this._swapRtlMargins(margins);
195
+ }
196
+ return tslib_1.__assign(tslib_1.__assign({}, margins), _this.props.margins);
197
+ };
198
+ _this._getDefaultMargins = function () {
199
+ return {
200
+ top: DEFAULT_MARGIN_NO_TICKS,
201
+ // Smaller than the default because it is based on the line height rather than
202
+ // the length of the tick labels.
203
+ bottom: DEFAULT_MARGIN_WITH_TICKS - 5,
204
+ // For the actual margin, add the tick size, tick padding, and some extra space to
205
+ // the width of the longest yaxis tick label (startFromX).
206
+ left: Math.max(DEFAULT_MARGIN_WITH_TICKS, _this.state.startFromX + 20),
207
+ right: _this.props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,
208
+ };
209
+ };
210
+ _this._applyTitleMargins = function (margins) {
211
+ var updated = tslib_1.__assign({}, margins);
212
+ if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
213
+ updated.bottom += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
214
+ }
215
+ if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
216
+ updated.left += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
217
+ }
218
+ if (_this.props.secondaryYAxistitle !== undefined && _this.props.secondaryYAxistitle !== '') {
219
+ updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
220
+ }
221
+ return updated;
222
+ };
223
+ _this._applyAnnotationMargins = function (margins) {
224
+ var updated = tslib_1.__assign({}, margins);
225
+ if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
226
+ updated.top += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
227
+ }
228
+ if (_this.props.yAxisAnnotation !== undefined &&
229
+ _this.props.yAxisAnnotation !== '' &&
230
+ (_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
231
+ updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
232
+ }
233
+ return updated;
234
+ };
235
+ _this._swapRtlMargins = function (margins) {
236
+ return tslib_1.__assign(tslib_1.__assign({}, margins), { left: margins.right, right: margins.left });
237
+ };
191
238
  _this.state = {
192
239
  containerHeight: 0,
193
240
  containerWidth: 0,
@@ -196,67 +243,13 @@ var CartesianChartBase = /** @class */ (function (_super) {
196
243
  startFromX: 0,
197
244
  };
198
245
  _this.idForGraph = (0, Utilities_1.getId)('chart_');
199
- _this.titleMargin = 8;
200
246
  _this.idForDefaultTabbableElement = (0, Utilities_1.getId)('defaultTabbableElement_');
201
247
  _this._tooltipId = (0, Utilities_1.getId)('tooltip_');
202
- /**
203
- * In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.
204
- * So that, in RTL, left margins becomes right margins and viceversa.
205
- * As graph needs to be drawn perfecty, these values consider as default values.
206
- * Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.
207
- */
208
- _this.margins = {
209
- top: (_b = (_a = _this.props.margins) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 20,
210
- bottom: (_d = (_c = _this.props.margins) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 35,
211
- right: _this._isRtl
212
- ? (_f = (_e = _this.props.margins) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 40
213
- : ((_h = (_g = _this.props.margins) === null || _g === void 0 ? void 0 : _g.right) !== null && _h !== void 0 ? _h : (_j = _this.props) === null || _j === void 0 ? void 0 : _j.secondaryYScaleOptions)
214
- ? 40
215
- : 20,
216
- left: _this._isRtl
217
- ? ((_l = (_k = _this.props.margins) === null || _k === void 0 ? void 0 : _k.right) !== null && _l !== void 0 ? _l : (_m = _this.props) === null || _m === void 0 ? void 0 : _m.secondaryYScaleOptions)
218
- ? 40
219
- : 20
220
- : (_p = (_o = _this.props.margins) === null || _o === void 0 ? void 0 : _o.left) !== null && _p !== void 0 ? _p : 40,
221
- };
222
- var TITLE_MARGIN_HORIZONTAL = 24;
223
- var TITLE_MARGIN_VERTICAL = 20;
224
- if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
225
- _this.margins.bottom = (_r = (_q = _this.props.margins) === null || _q === void 0 ? void 0 : _q.bottom) !== null && _r !== void 0 ? _r : _this.margins.bottom + TITLE_MARGIN_VERTICAL;
226
- }
227
- if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
228
- _this.margins.left = _this._isRtl
229
- ? ((_t = (_s = _this.props.margins) === null || _s === void 0 ? void 0 : _s.right) !== null && _t !== void 0 ? _t : (_u = _this.props) === null || _u === void 0 ? void 0 : _u.secondaryYAxistitle)
230
- ? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
231
- : _this.margins.right + TITLE_MARGIN_HORIZONTAL
232
- : (_w = (_v = _this.props.margins) === null || _v === void 0 ? void 0 : _v.left) !== null && _w !== void 0 ? _w : _this.margins.left + TITLE_MARGIN_HORIZONTAL;
233
- _this.margins.right = _this._isRtl
234
- ? (_y = (_x = _this.props.margins) === null || _x === void 0 ? void 0 : _x.left) !== null && _y !== void 0 ? _y : _this.margins.left + TITLE_MARGIN_HORIZONTAL
235
- : ((_0 = (_z = _this.props.margins) === null || _z === void 0 ? void 0 : _z.right) !== null && _0 !== void 0 ? _0 : (_1 = _this.props) === null || _1 === void 0 ? void 0 : _1.secondaryYAxistitle)
236
- ? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
237
- : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
238
- }
239
- if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
240
- _this.margins.top = (_3 = (_2 = _this.props.margins) === null || _2 === void 0 ? void 0 : _2.top) !== null && _3 !== void 0 ? _3 : _this.margins.top + TITLE_MARGIN_VERTICAL;
241
- }
242
- if (_this.props.yAxisAnnotation !== undefined &&
243
- _this.props.yAxisAnnotation !== '' &&
244
- (_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
245
- if (_this._isRtl) {
246
- _this.margins.left = (_5 = (_4 = _this.props.margins) === null || _4 === void 0 ? void 0 : _4.right) !== null && _5 !== void 0 ? _5 : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
247
- }
248
- else {
249
- _this.margins.right = (_7 = (_6 = _this.props.margins) === null || _6 === void 0 ? void 0 : _6.right) !== null && _7 !== void 0 ? _7 : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
250
- }
251
- }
252
248
  return _this;
253
249
  }
254
250
  CartesianChartBase.prototype.componentDidMount = function () {
255
251
  this._fitParentContainer();
256
- if (chartTypesWithStringYAxis.includes(this.props.chartType) &&
257
- this.props.showYAxisLables &&
258
- this.yAxisElement &&
259
- this.props.yAxisType === index_1.YAxisType.StringAxis) {
252
+ if (this.props.showYAxisLables) {
260
253
  var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
261
254
  if (this.state.startFromX !== maxYAxisLabelLength) {
262
255
  this.setState({
@@ -280,10 +273,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
280
273
  if (prevProps.height !== this.props.height || prevProps.width !== this.props.width) {
281
274
  this._fitParentContainer();
282
275
  }
283
- if (chartTypesWithStringYAxis.includes(this.props.chartType) &&
284
- this.props.showYAxisLables &&
285
- this.yAxisElement &&
286
- this.props.yAxisType === index_1.YAxisType.StringAxis) {
276
+ if (this.props.showYAxisLables) {
287
277
  var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
288
278
  if (this.state.startFromX !== maxYAxisLabelLength) {
289
279
  this.setState({
@@ -311,18 +301,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
311
301
  if (this.props.parentRef) {
312
302
  this._fitParentContainer();
313
303
  }
314
- var margin = tslib_1.__assign({}, this.margins);
315
- // Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
316
- if (chartTypesWithStringYAxis.includes(this.props.chartType)) {
317
- if (!this._isRtl) {
318
- margin.left += this.state.startFromX;
319
- }
320
- else {
321
- margin.right += this.state.startFromX;
322
- }
323
- }
304
+ this.margins = this._calcMargins();
324
305
  // Callback for margins to the chart
325
- this.props.getmargins && this.props.getmargins(margin);
306
+ this.props.getmargins && this.props.getmargins(this.margins);
326
307
  this._classNames = getClassNames(this.props.styles, {
327
308
  theme: this.props.theme,
328
309
  width: this.state._width,
@@ -341,9 +322,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
341
322
  if ((this.props.enableFirstRenderOptimization && this.chartContainer) ||
342
323
  !this.props.enableFirstRenderOptimization) {
343
324
  this._isFirstRender = false;
344
- var XAxisParams = tslib_1.__assign({ domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues,
345
- // This is only used for Horizontal Bar Chart with Axis for y as string axis
346
- this.state.startFromX),
325
+ var XAxisParams = tslib_1.__assign({ domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues),
347
326
  // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
348
327
  // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
349
328
  // However, if transformation props are enabled, the updated _removalValueForTextTuncate
@@ -387,9 +366,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
387
366
  * 2. To draw the graph.
388
367
  * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
389
368
  */
390
- var axisData = { yAxisDomainValues: [] };
369
+ var axisData = { yAxisDomainValues: [], yAxisTickText: [] };
391
370
  if (this.props.yAxisType && this.props.yAxisType === index_1.YAxisType.StringAxis) {
392
- yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, this.props.barwidth, this.props.chartType);
371
+ yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, axisData, this.props.barwidth, this.props.chartType);
393
372
  }
394
373
  else {
395
374
  // TODO: Since the scale domain values are now computed independently for both the primary and
@@ -415,40 +394,39 @@ var CartesianChartBase = /** @class */ (function (_super) {
415
394
  }
416
395
  yScalePrimary = this.props.createYAxis(YAxisParams, this._isRtl, axisData, this.isIntegralDataset, false, this.props.supportNegativeData, this.props.roundedTicks, this.props.yScaleType);
417
396
  }
418
- if (chartTypesWithStringYAxis.includes(this.props.chartType) && this.props.yAxisType === index_1.YAxisType.StringAxis) {
419
- // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
420
- // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
421
- // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
422
- if (!this.props.showYAxisLablesTooltip) {
423
- try {
424
- document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
425
- //eslint-disable-next-line no-empty
426
- }
427
- catch (e) { }
397
+ this._yAxisTickText = axisData.yAxisTickText;
398
+ this.props.getAxisData && this.props.getAxisData(axisData);
399
+ // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
400
+ // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
401
+ // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
402
+ if (!this.props.showYAxisLablesTooltip) {
403
+ try {
404
+ document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
405
+ //eslint-disable-next-line no-empty
428
406
  }
429
- // Used to display tooltip at y axis labels.
430
- if (this.props.showYAxisLablesTooltip) {
431
- // To create y axis tick values by if specified truncating the rest of the text
432
- // and showing elipsis or showing the whole string,
433
- yScalePrimary &&
434
- // Note: This function should be invoked within the showYAxisLablesTooltip check,
435
- // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
436
- (0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
437
- var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
438
- try {
439
- document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
440
- //eslint-disable-next-line no-empty
441
- }
442
- catch (e) { }
443
- var ytooltipProps = {
444
- tooltipCls: this._classNames.tooltip,
445
- id: this._tooltipId,
446
- axis: yAxisElement,
447
- };
448
- yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
407
+ catch (e) { }
408
+ }
409
+ // Used to display tooltip at y axis labels.
410
+ if (this.props.showYAxisLablesTooltip) {
411
+ // To create y axis tick values by if specified truncating the rest of the text
412
+ // and showing elipsis or showing the whole string,
413
+ yScalePrimary &&
414
+ // Note: This function should be invoked within the showYAxisLablesTooltip check,
415
+ // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
416
+ (0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
417
+ var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
418
+ try {
419
+ document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
420
+ //eslint-disable-next-line no-empty
449
421
  }
422
+ catch (e) { }
423
+ var ytooltipProps = {
424
+ tooltipCls: this._classNames.tooltip,
425
+ id: this._tooltipId,
426
+ axis: yAxisElement,
427
+ };
428
+ yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
450
429
  }
451
- this.props.getAxisData && this.props.getAxisData(axisData);
452
430
  // Callback function for chart, returns axis
453
431
  this._getData(xScale, yScalePrimary, yScaleSecondary);
454
432
  children = this.props.children(tslib_1.__assign(tslib_1.__assign({}, this.state), { xScale: xScale, yScalePrimary: yScalePrimary, yScaleSecondary: yScaleSecondary }));
@@ -460,11 +438,10 @@ var CartesianChartBase = /** @class */ (function (_super) {
460
438
  width: this.state.containerWidth,
461
439
  height: this.state.containerHeight,
462
440
  };
463
- var startFromX = this.state.startFromX || 0;
464
- var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right - startFromX);
441
+ var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right);
465
442
  var plotHeight = Math.max(0, svgDimensions.height - this.margins.top - this.margins.bottom - this._removalValueForTextTuncate);
466
443
  var plotRect = {
467
- x: this._isRtl ? this.margins.left : this.margins.left + startFromX,
444
+ x: this.margins.left,
468
445
  y: this.margins.top,
469
446
  width: plotWidth,
470
447
  height: plotHeight,
@@ -491,12 +468,19 @@ var CartesianChartBase = /** @class */ (function (_super) {
491
468
  else {
492
469
  focusDirection = react_focus_1.FocusZoneDirection.horizontal;
493
470
  }
494
- var xAxisTitleMaximumAllowedWidth = svgDimensions.width - this.margins.left - this.margins.right - this.state.startFromX;
495
- var yAxisTitleMaximumAllowedHeight = svgDimensions.height -
471
+ var xAxisTitleMaxWidth = svgDimensions.width - this.margins.left - this.margins.right - AXIS_TITLE_PADDING * 2;
472
+ var yAxisTitleMaxHeight = svgDimensions.height -
496
473
  this.margins.bottom -
497
474
  this.margins.top -
498
475
  this._removalValueForTextTuncate -
499
- this.titleMargin;
476
+ AXIS_TITLE_PADDING * 2;
477
+ var yAxisTitleCenterY = this.margins.top + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;
478
+ var yAxisTitleCenterX = this._isRtl
479
+ ? svgDimensions.width - AXIS_TITLE_PADDING
480
+ : HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;
481
+ var secondaryYAxisTitleCenterX = this._isRtl
482
+ ? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING
483
+ : svgDimensions.width - AXIS_TITLE_PADDING;
500
484
  var commonSvgToolTipProps = {
501
485
  wrapContent: index_1.wrapContent,
502
486
  theme: this.props.theme,
@@ -522,7 +506,9 @@ var CartesianChartBase = /** @class */ (function (_super) {
522
506
  * But this is a hacky solution and not a proper fix and also elementRef is deprecated.
523
507
  * 2. Using the default tabbable element to fix the issue.
524
508
  */
525
- return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) { return (_this.chartContainer = rootElem); }, onMouseLeave: this._onChartLeave },
509
+ return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
510
+ _this.chartContainer = rootElem;
511
+ }, onMouseLeave: this._onChartLeave },
526
512
  !this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
527
513
  React.createElement(react_focus_1.FocusZone, tslib_1.__assign({ direction: focusDirection, className: this._classNames.chartWrapper, defaultTabbableElement: "#".concat(this.idForDefaultTabbableElement) }, svgFocusZoneProps),
528
514
  this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
@@ -533,69 +519,57 @@ var CartesianChartBase = /** @class */ (function (_super) {
533
519
  // To add wrap of x axis lables feature, need to remove word height from svg height.
534
520
  transform: "translate(0, ".concat(svgDimensions.height - this.margins.bottom - this._removalValueForTextTuncate, ")"), className: this._classNames.xAxis }),
535
521
  this.props.xAxisTitle !== undefined && this.props.xAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisTitle, textProps: {
536
- x: this.margins.left + this.state.startFromX + xAxisTitleMaximumAllowedWidth / 2,
537
- y: svgDimensions.height - this.titleMargin,
522
+ x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
523
+ y: svgDimensions.height - AXIS_TITLE_PADDING,
538
524
  className: this._classNames.axisTitle,
539
525
  textAnchor: 'middle',
540
526
  'aria-hidden': true,
541
- }, maxWidth: xAxisTitleMaximumAllowedWidth }, commonSvgToolTipProps))),
527
+ }, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
542
528
  this.props.xAxisAnnotation !== undefined && this.props.xAxisAnnotation !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisAnnotation, textProps: {
543
- x: this.margins.left + this.state.startFromX + xAxisTitleMaximumAllowedWidth / 2,
544
- y: this.titleMargin + 3,
529
+ x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
530
+ y: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,
545
531
  className: this._classNames.axisAnnotation,
546
532
  textAnchor: 'middle',
547
533
  'aria-hidden': true,
548
- }, maxWidth: xAxisTitleMaximumAllowedWidth }, commonSvgToolTipProps))),
534
+ }, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
549
535
  React.createElement("g", { ref: function (e) {
550
536
  _this.yAxisElement = e;
551
- }, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
552
- ? svgDimensions.width - this.margins.right - this.state.startFromX
553
- : this.margins.left + this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
537
+ }, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? svgDimensions.width - this.margins.right : this.margins.left, ", 0)"), className: this._classNames.yAxis }),
554
538
  this.props.secondaryYScaleOptions && (React.createElement("g", null,
555
539
  React.createElement("g", { ref: function (e) {
556
540
  _this.yAxisElementSecondary = e;
557
- }, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
558
- ? this.margins.left + this.state.startFromX
559
- : svgDimensions.width - this.margins.right - this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
541
+ }, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? this.margins.left : svgDimensions.width - this.margins.right, ", 0)"), className: this._classNames.yAxis }),
560
542
  this.props.secondaryYAxistitle !== undefined && this.props.secondaryYAxistitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.secondaryYAxistitle, textProps: {
561
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
562
- y: this._isRtl
563
- ? this.state.startFromX - this.titleMargin
564
- : svgDimensions.width - this.margins.right,
543
+ x: secondaryYAxisTitleCenterX,
544
+ y: yAxisTitleCenterY,
565
545
  textAnchor: 'middle',
566
- transform: "translate(".concat(this._isRtl
567
- ? this.margins.right / 2 - this.titleMargin
568
- : this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
546
+ transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
569
547
  className: this._classNames.axisTitle,
570
548
  'aria-hidden': true,
571
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps))))),
549
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))))),
572
550
  children,
573
551
  this.props.yAxisTitle !== undefined && this.props.yAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisTitle, textProps: {
574
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
575
- y: this._isRtl
576
- ? svgDimensions.width - this.margins.right / 2 + this.titleMargin
577
- : this.margins.left / 2 - this.titleMargin,
552
+ x: yAxisTitleCenterX,
553
+ y: yAxisTitleCenterY,
578
554
  textAnchor: 'middle',
579
- transform: "translate(0,\n ".concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
555
+ transform: "rotate(-90, ".concat(yAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
580
556
  className: this._classNames.axisTitle,
581
557
  'aria-hidden': true,
582
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps))),
558
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))),
583
559
  this.props.yAxisAnnotation !== undefined &&
584
560
  this.props.yAxisAnnotation !== '' &&
585
561
  (this.props.secondaryYAxistitle === undefined || this.props.secondaryYAxistitle === '') && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisAnnotation, textProps: {
586
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
587
- y: this._isRtl
588
- ? this.state.startFromX - this.titleMargin
589
- : svgDimensions.width - this.margins.right,
562
+ x: secondaryYAxisTitleCenterX,
563
+ y: yAxisTitleCenterY,
590
564
  textAnchor: 'middle',
591
- transform: "translate(".concat(this._isRtl
592
- ? this.margins.right / 2 - this.titleMargin
593
- : this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
565
+ transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
594
566
  className: this._classNames.axisAnnotation,
595
567
  'aria-hidden': true,
596
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps)))),
568
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps)))),
597
569
  hasAnnotations && annotationContext && (React.createElement(ChartAnnotationLayer_1.ChartAnnotationLayer, { annotations: annotations, context: annotationContext, theme: this.props.theme, className: this._classNames.annotationLayer }))),
598
- !this.props.hideLegend && (React.createElement("div", { ref: function (e) { return (_this.legendContainer = e); }, className: this._classNames.legendContainer }, this.props.legendBars)),
570
+ !this.props.hideLegend && (React.createElement("div", { ref: function (e) {
571
+ _this.legendContainer = e;
572
+ }, className: this._classNames.legendContainer }, this.props.legendBars)),
599
573
  callout && React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Loading...") }, callout)));
600
574
  };
601
575
  /**