@fluentui/react-charting 5.25.1 → 5.25.2

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 +72 -1
  2. package/CHANGELOG.md +19 -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 +157 -45
  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 +3 -3
  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 +4 -4
  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 +15 -7
  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 +174 -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 +159 -46
  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 +2 -2
  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 +3 -3
  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 +14 -6
  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 +173 -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 +159 -46
  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 +2 -2
  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 +3 -3
  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 +14 -6
  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 +173 -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
@@ -6,13 +6,11 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
6
6
  var ChartHoverCard = React.lazy(function () {
7
7
  return new Promise(function (resolve_1, reject_1) { require(['../../utilities/ChartHoverCard/ChartHoverCard'], resolve_1, reject_1); }).then(function (module) { return ({ default: module.ChartHoverCard }); });
8
8
  });
9
- var chartTypesWithStringYAxis = [
10
- index_1.ChartTypes.HorizontalBarChartWithAxis,
11
- index_1.ChartTypes.HeatMapChart,
12
- index_1.ChartTypes.VerticalStackedBarChart,
13
- index_1.ChartTypes.GanttChart,
14
- index_1.ChartTypes.ScatterChart,
15
- ];
9
+ var HORIZONTAL_MARGIN_FOR_YAXIS_TITLE = 24;
10
+ var VERTICAL_MARGIN_FOR_XAXIS_TITLE = 20;
11
+ var AXIS_TITLE_PADDING = 8;
12
+ var DEFAULT_MARGIN_WITH_TICKS = 40;
13
+ var DEFAULT_MARGIN_NO_TICKS = 20;
16
14
  /**
17
15
  * Cartesian chart used for
18
16
  * 1.draw X and Y axis of the chart
@@ -22,7 +20,6 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
22
20
  var CartesianChartBase = /** @class */ (function (_super) {
23
21
  tslib_1.__extends(CartesianChartBase, _super);
24
22
  function CartesianChartBase(props) {
25
- 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;
26
23
  var _this = _super.call(this, props) || this;
27
24
  _this.minLegendContainerHeight = 32;
28
25
  _this._isRtl = (0, Utilities_1.getRTL)();
@@ -34,6 +31,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
34
31
  * Defalut value is 0. And this values calculted when 'wrapXAxisLables' or 'showXAxisLablesTooltip' is true.
35
32
  */
36
33
  _this._removalValueForTextTuncate = 0;
34
+ _this._yAxisTickText = [];
37
35
  _this.isIntegralDataset = true;
38
36
  _this.calculateMaxYAxisLabelLength = function (className) {
39
37
  var formatTickLabel = function (str) {
@@ -42,7 +40,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
42
40
  }
43
41
  return str;
44
42
  };
45
- return (0, index_1.calculateLongestLabelWidth)(_this.props.stringDatasetForYAxisDomain.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
43
+ return (0, index_1.calculateLongestLabelWidth)(_this._yAxisTickText.map(function (label) { return formatTickLabel(label); }), ".".concat(className, " text"));
46
44
  };
47
45
  // TO DO: Write a common functional component for Multi value callout and divide sub count method
48
46
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -178,6 +176,55 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
178
176
  _this._removalValueForTextTuncate = rotatedHeight + _this.margins.bottom;
179
177
  }
180
178
  };
179
+ _this._calcMargins = function () {
180
+ var margins = _this._getDefaultMargins();
181
+ margins = _this._applyTitleMargins(margins);
182
+ margins = _this._applyAnnotationMargins(margins);
183
+ if (_this._isRtl) {
184
+ margins = _this._swapRtlMargins(margins);
185
+ }
186
+ return tslib_1.__assign(tslib_1.__assign({}, margins), _this.props.margins);
187
+ };
188
+ _this._getDefaultMargins = function () {
189
+ return {
190
+ top: DEFAULT_MARGIN_NO_TICKS,
191
+ // Smaller than the default because it is based on the line height rather than
192
+ // the length of the tick labels.
193
+ bottom: DEFAULT_MARGIN_WITH_TICKS - 5,
194
+ // For the actual margin, add the tick size, tick padding, and some extra space to
195
+ // the width of the longest yaxis tick label (startFromX).
196
+ left: Math.max(DEFAULT_MARGIN_WITH_TICKS, _this.state.startFromX + 20),
197
+ right: _this.props.secondaryYScaleOptions ? DEFAULT_MARGIN_WITH_TICKS : DEFAULT_MARGIN_NO_TICKS,
198
+ };
199
+ };
200
+ _this._applyTitleMargins = function (margins) {
201
+ var updated = tslib_1.__assign({}, margins);
202
+ if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
203
+ updated.bottom += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
204
+ }
205
+ if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
206
+ updated.left += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
207
+ }
208
+ if (_this.props.secondaryYAxistitle !== undefined && _this.props.secondaryYAxistitle !== '') {
209
+ updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
210
+ }
211
+ return updated;
212
+ };
213
+ _this._applyAnnotationMargins = function (margins) {
214
+ var updated = tslib_1.__assign({}, margins);
215
+ if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
216
+ updated.top += VERTICAL_MARGIN_FOR_XAXIS_TITLE;
217
+ }
218
+ if (_this.props.yAxisAnnotation !== undefined &&
219
+ _this.props.yAxisAnnotation !== '' &&
220
+ (_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
221
+ updated.right += HORIZONTAL_MARGIN_FOR_YAXIS_TITLE;
222
+ }
223
+ return updated;
224
+ };
225
+ _this._swapRtlMargins = function (margins) {
226
+ return tslib_1.__assign(tslib_1.__assign({}, margins), { left: margins.right, right: margins.left });
227
+ };
181
228
  _this.state = {
182
229
  containerHeight: 0,
183
230
  containerWidth: 0,
@@ -186,67 +233,13 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
186
233
  startFromX: 0,
187
234
  };
188
235
  _this.idForGraph = (0, Utilities_1.getId)('chart_');
189
- _this.titleMargin = 8;
190
236
  _this.idForDefaultTabbableElement = (0, Utilities_1.getId)('defaultTabbableElement_');
191
237
  _this._tooltipId = (0, Utilities_1.getId)('tooltip_');
192
- /**
193
- * In RTL mode, Only graph will be rendered left/right. We need to provide left and right margins manually.
194
- * So that, in RTL, left margins becomes right margins and viceversa.
195
- * As graph needs to be drawn perfecty, these values consider as default values.
196
- * Same margins using for all other cartesian charts. Can be accessible through 'getMargins' call back method.
197
- */
198
- _this.margins = {
199
- top: (_b = (_a = _this.props.margins) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : 20,
200
- bottom: (_d = (_c = _this.props.margins) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 35,
201
- right: _this._isRtl
202
- ? (_f = (_e = _this.props.margins) === null || _e === void 0 ? void 0 : _e.left) !== null && _f !== void 0 ? _f : 40
203
- : ((_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)
204
- ? 40
205
- : 20,
206
- left: _this._isRtl
207
- ? ((_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)
208
- ? 40
209
- : 20
210
- : (_p = (_o = _this.props.margins) === null || _o === void 0 ? void 0 : _o.left) !== null && _p !== void 0 ? _p : 40,
211
- };
212
- var TITLE_MARGIN_HORIZONTAL = 24;
213
- var TITLE_MARGIN_VERTICAL = 20;
214
- if (_this.props.xAxisTitle !== undefined && _this.props.xAxisTitle !== '') {
215
- _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;
216
- }
217
- if (_this.props.yAxisTitle !== undefined && _this.props.yAxisTitle !== '') {
218
- _this.margins.left = _this._isRtl
219
- ? ((_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)
220
- ? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
221
- : _this.margins.right + TITLE_MARGIN_HORIZONTAL
222
- : (_w = (_v = _this.props.margins) === null || _v === void 0 ? void 0 : _v.left) !== null && _w !== void 0 ? _w : _this.margins.left + TITLE_MARGIN_HORIZONTAL;
223
- _this.margins.right = _this._isRtl
224
- ? (_y = (_x = _this.props.margins) === null || _x === void 0 ? void 0 : _x.left) !== null && _y !== void 0 ? _y : _this.margins.left + TITLE_MARGIN_HORIZONTAL
225
- : ((_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)
226
- ? _this.margins.right + 2 * TITLE_MARGIN_HORIZONTAL
227
- : _this.margins.right + TITLE_MARGIN_HORIZONTAL;
228
- }
229
- if (_this.props.xAxisAnnotation !== undefined && _this.props.xAxisAnnotation !== '') {
230
- _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;
231
- }
232
- if (_this.props.yAxisAnnotation !== undefined &&
233
- _this.props.yAxisAnnotation !== '' &&
234
- (_this.props.secondaryYAxistitle === undefined || _this.props.secondaryYAxistitle === '')) {
235
- if (_this._isRtl) {
236
- _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;
237
- }
238
- else {
239
- _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;
240
- }
241
- }
242
238
  return _this;
243
239
  }
244
240
  CartesianChartBase.prototype.componentDidMount = function () {
245
241
  this._fitParentContainer();
246
- if (chartTypesWithStringYAxis.includes(this.props.chartType) &&
247
- this.props.showYAxisLables &&
248
- this.yAxisElement &&
249
- this.props.yAxisType === index_1.YAxisType.StringAxis) {
242
+ if (this.props.showYAxisLables) {
250
243
  var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
251
244
  if (this.state.startFromX !== maxYAxisLabelLength) {
252
245
  this.setState({
@@ -270,10 +263,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
270
263
  if (prevProps.height !== this.props.height || prevProps.width !== this.props.width) {
271
264
  this._fitParentContainer();
272
265
  }
273
- if (chartTypesWithStringYAxis.includes(this.props.chartType) &&
274
- this.props.showYAxisLables &&
275
- this.yAxisElement &&
276
- this.props.yAxisType === index_1.YAxisType.StringAxis) {
266
+ if (this.props.showYAxisLables) {
277
267
  var maxYAxisLabelLength = this.calculateMaxYAxisLabelLength(this._classNames.yAxis);
278
268
  if (this.state.startFromX !== maxYAxisLabelLength) {
279
269
  this.setState({
@@ -301,18 +291,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
301
291
  if (this.props.parentRef) {
302
292
  this._fitParentContainer();
303
293
  }
304
- var margin = tslib_1.__assign({}, this.margins);
305
- // Note: This check is unnecessary since startFromX is only set for charts with string y-axis.
306
- if (chartTypesWithStringYAxis.includes(this.props.chartType)) {
307
- if (!this._isRtl) {
308
- margin.left += this.state.startFromX;
309
- }
310
- else {
311
- margin.right += this.state.startFromX;
312
- }
313
- }
294
+ this.margins = this._calcMargins();
314
295
  // Callback for margins to the chart
315
- this.props.getmargins && this.props.getmargins(margin);
296
+ this.props.getmargins && this.props.getmargins(this.margins);
316
297
  this._classNames = getClassNames(this.props.styles, {
317
298
  theme: this.props.theme,
318
299
  width: this.state._width,
@@ -331,9 +312,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
331
312
  if ((this.props.enableFirstRenderOptimization && this.chartContainer) ||
332
313
  !this.props.enableFirstRenderOptimization) {
333
314
  this._isFirstRender = false;
334
- 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,
335
- // This is only used for Horizontal Bar Chart with Axis for y as string axis
336
- this.state.startFromX),
315
+ 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),
337
316
  // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
338
317
  // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
339
318
  // However, if transformation props are enabled, the updated _removalValueForTextTuncate
@@ -377,9 +356,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
377
356
  * 2. To draw the graph.
378
357
  * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
379
358
  */
380
- var axisData = { yAxisDomainValues: [] };
359
+ var axisData = { yAxisDomainValues: [], yAxisTickText: [] };
381
360
  if (this.props.yAxisType && this.props.yAxisType === index_1.YAxisType.StringAxis) {
382
- yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, this.props.barwidth, this.props.chartType);
361
+ yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, axisData, this.props.barwidth, this.props.chartType);
383
362
  }
384
363
  else {
385
364
  // TODO: Since the scale domain values are now computed independently for both the primary and
@@ -405,40 +384,39 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
405
384
  }
406
385
  yScalePrimary = this.props.createYAxis(YAxisParams, this._isRtl, axisData, this.isIntegralDataset, false, this.props.supportNegativeData, this.props.roundedTicks, this.props.yScaleType);
407
386
  }
408
- if (chartTypesWithStringYAxis.includes(this.props.chartType) && this.props.yAxisType === index_1.YAxisType.StringAxis) {
409
- // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
410
- // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
411
- // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
412
- if (!this.props.showYAxisLablesTooltip) {
413
- try {
414
- document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
415
- //eslint-disable-next-line no-empty
416
- }
417
- catch (e) { }
387
+ this._yAxisTickText = axisData.yAxisTickText;
388
+ this.props.getAxisData && this.props.getAxisData(axisData);
389
+ // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
390
+ // of unwanted DOM elements, to prevent flacky behaviour in tooltips , that might occur
391
+ // in creating tooltips when tooltips are enabled( as we try to recreate a tspan with this._tooltipId)
392
+ if (!this.props.showYAxisLablesTooltip) {
393
+ try {
394
+ document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
395
+ //eslint-disable-next-line no-empty
418
396
  }
419
- // Used to display tooltip at y axis labels.
420
- if (this.props.showYAxisLablesTooltip) {
421
- // To create y axis tick values by if specified truncating the rest of the text
422
- // and showing elipsis or showing the whole string,
423
- yScalePrimary &&
424
- // Note: This function should be invoked within the showYAxisLablesTooltip check,
425
- // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
426
- (0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
427
- var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
428
- try {
429
- document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
430
- //eslint-disable-next-line no-empty
431
- }
432
- catch (e) { }
433
- var ytooltipProps = {
434
- tooltipCls: this._classNames.tooltip,
435
- id: this._tooltipId,
436
- axis: yAxisElement,
437
- };
438
- yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
397
+ catch (e) { }
398
+ }
399
+ // Used to display tooltip at y axis labels.
400
+ if (this.props.showYAxisLablesTooltip) {
401
+ // To create y axis tick values by if specified truncating the rest of the text
402
+ // and showing elipsis or showing the whole string,
403
+ yScalePrimary &&
404
+ // Note: This function should be invoked within the showYAxisLablesTooltip check,
405
+ // as its sole purpose is to truncate labels that exceed the noOfCharsToTruncate limit.
406
+ (0, index_1.createYAxisLabels)(this.yAxisElement, yScalePrimary, this.props.noOfCharsToTruncate || 4, this.props.showYAxisLablesTooltip || false, this._isRtl);
407
+ var yAxisElement = (0, d3_selection_1.select)(this.yAxisElement).call(yScalePrimary);
408
+ try {
409
+ document.getElementById(this._tooltipId) && document.getElementById(this._tooltipId).remove();
410
+ //eslint-disable-next-line no-empty
439
411
  }
412
+ catch (e) { }
413
+ var ytooltipProps = {
414
+ tooltipCls: this._classNames.tooltip,
415
+ id: this._tooltipId,
416
+ axis: yAxisElement,
417
+ };
418
+ yAxisElement && (0, index_1.tooltipOfAxislabels)(ytooltipProps);
440
419
  }
441
- this.props.getAxisData && this.props.getAxisData(axisData);
442
420
  // Callback function for chart, returns axis
443
421
  this._getData(xScale, yScalePrimary, yScaleSecondary);
444
422
  children = this.props.children(tslib_1.__assign(tslib_1.__assign({}, this.state), { xScale: xScale, yScalePrimary: yScalePrimary, yScaleSecondary: yScaleSecondary }));
@@ -450,11 +428,10 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
450
428
  width: this.state.containerWidth,
451
429
  height: this.state.containerHeight,
452
430
  };
453
- var startFromX = this.state.startFromX || 0;
454
- var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right - startFromX);
431
+ var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right);
455
432
  var plotHeight = Math.max(0, svgDimensions.height - this.margins.top - this.margins.bottom - this._removalValueForTextTuncate);
456
433
  var plotRect = {
457
- x: this._isRtl ? this.margins.left : this.margins.left + startFromX,
434
+ x: this.margins.left,
458
435
  y: this.margins.top,
459
436
  width: plotWidth,
460
437
  height: plotHeight,
@@ -481,12 +458,19 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
481
458
  else {
482
459
  focusDirection = react_focus_1.FocusZoneDirection.horizontal;
483
460
  }
484
- var xAxisTitleMaximumAllowedWidth = svgDimensions.width - this.margins.left - this.margins.right - this.state.startFromX;
485
- var yAxisTitleMaximumAllowedHeight = svgDimensions.height -
461
+ var xAxisTitleMaxWidth = svgDimensions.width - this.margins.left - this.margins.right - AXIS_TITLE_PADDING * 2;
462
+ var yAxisTitleMaxHeight = svgDimensions.height -
486
463
  this.margins.bottom -
487
464
  this.margins.top -
488
465
  this._removalValueForTextTuncate -
489
- this.titleMargin;
466
+ AXIS_TITLE_PADDING * 2;
467
+ var yAxisTitleCenterY = this.margins.top + AXIS_TITLE_PADDING + yAxisTitleMaxHeight / 2;
468
+ var yAxisTitleCenterX = this._isRtl
469
+ ? svgDimensions.width - AXIS_TITLE_PADDING
470
+ : HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING;
471
+ var secondaryYAxisTitleCenterX = this._isRtl
472
+ ? HORIZONTAL_MARGIN_FOR_YAXIS_TITLE - AXIS_TITLE_PADDING
473
+ : svgDimensions.width - AXIS_TITLE_PADDING;
490
474
  var commonSvgToolTipProps = {
491
475
  wrapContent: index_1.wrapContent,
492
476
  theme: this.props.theme,
@@ -512,7 +496,9 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
512
496
  * But this is a hacky solution and not a proper fix and also elementRef is deprecated.
513
497
  * 2. Using the default tabbable element to fix the issue.
514
498
  */
515
- return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) { return (_this.chartContainer = rootElem); }, onMouseLeave: this._onChartLeave },
499
+ return (React.createElement("div", { id: this.idForGraph, className: this._classNames.root, ref: function (rootElem) {
500
+ _this.chartContainer = rootElem;
501
+ }, onMouseLeave: this._onChartLeave },
516
502
  !this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
517
503
  React.createElement(react_focus_1.FocusZone, tslib_1.__assign({ direction: focusDirection, className: this._classNames.chartWrapper, defaultTabbableElement: "#".concat(this.idForDefaultTabbableElement) }, svgFocusZoneProps),
518
504
  this._isFirstRender && React.createElement("div", { id: this.idForDefaultTabbableElement }),
@@ -523,69 +509,57 @@ define(["require", "exports", "tslib", "react", "@fluentui/react/lib/Utilities",
523
509
  // To add wrap of x axis lables feature, need to remove word height from svg height.
524
510
  transform: "translate(0, ".concat(svgDimensions.height - this.margins.bottom - this._removalValueForTextTuncate, ")"), className: this._classNames.xAxis }),
525
511
  this.props.xAxisTitle !== undefined && this.props.xAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisTitle, textProps: {
526
- x: this.margins.left + this.state.startFromX + xAxisTitleMaximumAllowedWidth / 2,
527
- y: svgDimensions.height - this.titleMargin,
512
+ x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
513
+ y: svgDimensions.height - AXIS_TITLE_PADDING,
528
514
  className: this._classNames.axisTitle,
529
515
  textAnchor: 'middle',
530
516
  'aria-hidden': true,
531
- }, maxWidth: xAxisTitleMaximumAllowedWidth }, commonSvgToolTipProps))),
517
+ }, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
532
518
  this.props.xAxisAnnotation !== undefined && this.props.xAxisAnnotation !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.xAxisAnnotation, textProps: {
533
- x: this.margins.left + this.state.startFromX + xAxisTitleMaximumAllowedWidth / 2,
534
- y: this.titleMargin + 3,
519
+ x: this.margins.left + AXIS_TITLE_PADDING + xAxisTitleMaxWidth / 2,
520
+ y: VERTICAL_MARGIN_FOR_XAXIS_TITLE - AXIS_TITLE_PADDING,
535
521
  className: this._classNames.axisAnnotation,
536
522
  textAnchor: 'middle',
537
523
  'aria-hidden': true,
538
- }, maxWidth: xAxisTitleMaximumAllowedWidth }, commonSvgToolTipProps))),
524
+ }, maxWidth: xAxisTitleMaxWidth }, commonSvgToolTipProps))),
539
525
  React.createElement("g", { ref: function (e) {
540
526
  _this.yAxisElement = e;
541
- }, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
542
- ? svgDimensions.width - this.margins.right - this.state.startFromX
543
- : this.margins.left + this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
527
+ }, id: "yAxisGElement".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? svgDimensions.width - this.margins.right : this.margins.left, ", 0)"), className: this._classNames.yAxis }),
544
528
  this.props.secondaryYScaleOptions && (React.createElement("g", null,
545
529
  React.createElement("g", { ref: function (e) {
546
530
  _this.yAxisElementSecondary = e;
547
- }, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl
548
- ? this.margins.left + this.state.startFromX
549
- : svgDimensions.width - this.margins.right - this.state.startFromX, ", 0)"), className: this._classNames.yAxis }),
531
+ }, id: "yAxisGElementSecondary".concat(this.idForGraph), transform: "translate(".concat(this._isRtl ? this.margins.left : svgDimensions.width - this.margins.right, ", 0)"), className: this._classNames.yAxis }),
550
532
  this.props.secondaryYAxistitle !== undefined && this.props.secondaryYAxistitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.secondaryYAxistitle, textProps: {
551
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
552
- y: this._isRtl
553
- ? this.state.startFromX - this.titleMargin
554
- : svgDimensions.width - this.margins.right,
533
+ x: secondaryYAxisTitleCenterX,
534
+ y: yAxisTitleCenterY,
555
535
  textAnchor: 'middle',
556
- transform: "translate(".concat(this._isRtl
557
- ? this.margins.right / 2 - this.titleMargin
558
- : this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
536
+ transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
559
537
  className: this._classNames.axisTitle,
560
538
  'aria-hidden': true,
561
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps))))),
539
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))))),
562
540
  children,
563
541
  this.props.yAxisTitle !== undefined && this.props.yAxisTitle !== '' && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisTitle, textProps: {
564
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
565
- y: this._isRtl
566
- ? svgDimensions.width - this.margins.right / 2 + this.titleMargin
567
- : this.margins.left / 2 - this.titleMargin,
542
+ x: yAxisTitleCenterX,
543
+ y: yAxisTitleCenterY,
568
544
  textAnchor: 'middle',
569
- transform: "translate(0,\n ".concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
545
+ transform: "rotate(-90, ".concat(yAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
570
546
  className: this._classNames.axisTitle,
571
547
  'aria-hidden': true,
572
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps))),
548
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps))),
573
549
  this.props.yAxisAnnotation !== undefined &&
574
550
  this.props.yAxisAnnotation !== '' &&
575
551
  (this.props.secondaryYAxistitle === undefined || this.props.secondaryYAxistitle === '') && (React.createElement(SVGTooltipText_1.SVGTooltipText, tslib_1.__assign({ content: this.props.yAxisAnnotation, textProps: {
576
- x: (yAxisTitleMaximumAllowedHeight - this.margins.bottom) / 2 + this._removalValueForTextTuncate,
577
- y: this._isRtl
578
- ? this.state.startFromX - this.titleMargin
579
- : svgDimensions.width - this.margins.right,
552
+ x: secondaryYAxisTitleCenterX,
553
+ y: yAxisTitleCenterY,
580
554
  textAnchor: 'middle',
581
- transform: "translate(".concat(this._isRtl
582
- ? this.margins.right / 2 - this.titleMargin
583
- : this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
555
+ transform: "rotate(-90, ".concat(secondaryYAxisTitleCenterX, ", ").concat(yAxisTitleCenterY, ")"),
584
556
  className: this._classNames.axisAnnotation,
585
557
  'aria-hidden': true,
586
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps)))),
558
+ }, maxWidth: yAxisTitleMaxHeight }, commonSvgToolTipProps)))),
587
559
  hasAnnotations && annotationContext && (React.createElement(ChartAnnotationLayer_1.ChartAnnotationLayer, { annotations: annotations, context: annotationContext, theme: this.props.theme, className: this._classNames.annotationLayer }))),
588
- !this.props.hideLegend && (React.createElement("div", { ref: function (e) { return (_this.legendContainer = e); }, className: this._classNames.legendContainer }, this.props.legendBars)),
560
+ !this.props.hideLegend && (React.createElement("div", { ref: function (e) {
561
+ _this.legendContainer = e;
562
+ }, className: this._classNames.legendContainer }, this.props.legendBars)),
589
563
  callout && React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Loading...") }, callout)));
590
564
  };
591
565
  /**