@mui/x-charts 6.0.0-alpha.9 → 6.18.1

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 (325) hide show
  1. package/BarChart/BarChart.d.ts +26 -5
  2. package/BarChart/BarChart.js +93 -17
  3. package/BarChart/BarElement.d.ts +1319 -4
  4. package/BarChart/BarElement.js +10 -10
  5. package/BarChart/BarPlot.d.ts +17 -1
  6. package/BarChart/BarPlot.js +152 -66
  7. package/BarChart/formatter.js +2 -3
  8. package/BarChart/legend.js +1 -2
  9. package/CHANGELOG.md +797 -59
  10. package/ChartContainer/index.js +7 -5
  11. package/ChartsAxis/ChartsAxis.d.ts +9 -0
  12. package/ChartsAxis/ChartsAxis.js +33 -7
  13. package/ChartsAxis/axisClasses.d.ts +3 -3
  14. package/ChartsAxis/axisClasses.js +1 -2
  15. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +21 -0
  16. package/ChartsAxisHighlight/ChartsAxisHighlight.js +61 -22
  17. package/ChartsClipPath/ChartsClipPath.d.ts +5 -0
  18. package/ChartsClipPath/ChartsClipPath.js +7 -2
  19. package/ChartsLegend/ChartsLegend.d.ts +45 -24
  20. package/ChartsLegend/ChartsLegend.js +193 -151
  21. package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  22. package/ChartsLegend/chartsLegendClasses.js +3 -4
  23. package/ChartsLegend/utils.d.ts +1 -6
  24. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
  25. package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
  26. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
  27. package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
  28. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
  29. package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
  30. package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
  31. package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
  32. package/ChartsReferenceLine/common.d.ts +41 -0
  33. package/ChartsReferenceLine/common.js +27 -0
  34. package/ChartsReferenceLine/index.d.ts +2 -0
  35. package/ChartsReferenceLine/index.js +27 -0
  36. package/ChartsReferenceLine/package.json +6 -0
  37. package/ChartsSurface.d.ts +12 -1
  38. package/ChartsSurface.js +9 -18
  39. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
  40. package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
  41. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
  42. package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
  43. package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
  44. package/ChartsTooltip/ChartsTooltip.js +62 -18
  45. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
  46. package/ChartsTooltip/ChartsTooltipTable.js +22 -20
  47. package/ChartsTooltip/tooltipClasses.js +1 -2
  48. package/ChartsTooltip/utils.js +2 -2
  49. package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
  50. package/ChartsXAxis/ChartsXAxis.js +170 -45
  51. package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
  52. package/ChartsYAxis/ChartsYAxis.js +95 -38
  53. package/LineChart/AreaElement.d.ts +11 -1
  54. package/LineChart/AreaElement.js +14 -6
  55. package/LineChart/AreaPlot.d.ts +11 -0
  56. package/LineChart/AreaPlot.js +27 -8
  57. package/LineChart/LineChart.d.ts +23 -3
  58. package/LineChart/LineChart.js +89 -17
  59. package/LineChart/LineElement.d.ts +11 -1
  60. package/LineChart/LineElement.js +14 -6
  61. package/LineChart/LineHighlightElement.d.ts +10 -0
  62. package/LineChart/LineHighlightElement.js +13 -4
  63. package/LineChart/LineHighlightPlot.d.ts +10 -0
  64. package/LineChart/LineHighlightPlot.js +15 -4
  65. package/LineChart/LinePlot.d.ts +10 -0
  66. package/LineChart/LinePlot.js +25 -12
  67. package/LineChart/MarkElement.d.ts +10 -0
  68. package/LineChart/MarkElement.js +14 -5
  69. package/LineChart/MarkPlot.d.ts +10 -0
  70. package/LineChart/MarkPlot.js +42 -10
  71. package/LineChart/formatter.js +5 -5
  72. package/LineChart/legend.js +1 -2
  73. package/PieChart/PieArc.d.ts +11 -13
  74. package/PieChart/PieArc.js +28 -60
  75. package/PieChart/PieArcLabel.d.ts +8 -9
  76. package/PieChart/PieArcLabel.js +46 -38
  77. package/PieChart/PieArcLabelPlot.d.ts +28 -0
  78. package/PieChart/PieArcLabelPlot.js +99 -0
  79. package/PieChart/PieArcPlot.d.ts +35 -0
  80. package/PieChart/PieArcPlot.js +92 -0
  81. package/PieChart/PieChart.d.ts +19 -5
  82. package/PieChart/PieChart.js +95 -18
  83. package/PieChart/PiePlot.d.ts +15 -9
  84. package/PieChart/PiePlot.js +77 -55
  85. package/PieChart/dataTransform/transition.d.ts +4 -0
  86. package/PieChart/dataTransform/transition.js +136 -0
  87. package/PieChart/dataTransform/useTransformData.d.ts +15 -0
  88. package/PieChart/dataTransform/useTransformData.js +67 -0
  89. package/PieChart/formatter.js +1 -2
  90. package/PieChart/legend.js +1 -2
  91. package/README.md +8 -14
  92. package/ResponsiveChartContainer/index.d.ts +13 -3
  93. package/ResponsiveChartContainer/index.js +7 -8
  94. package/ScatterChart/Scatter.d.ts +10 -0
  95. package/ScatterChart/Scatter.js +12 -2
  96. package/ScatterChart/ScatterChart.d.ts +16 -3
  97. package/ScatterChart/ScatterChart.js +77 -16
  98. package/ScatterChart/ScatterPlot.d.ts +10 -0
  99. package/ScatterChart/ScatterPlot.js +12 -2
  100. package/ScatterChart/formatter.js +1 -2
  101. package/ScatterChart/legend.js +1 -2
  102. package/SparkLineChart/SparkLineChart.d.ts +12 -3
  103. package/SparkLineChart/SparkLineChart.js +50 -7
  104. package/colorPalettes/colorPalettes.js +6 -12
  105. package/constants.js +5 -8
  106. package/context/CartesianContextProvider.d.ts +26 -1
  107. package/context/CartesianContextProvider.js +42 -16
  108. package/context/DrawingProvider.d.ts +25 -0
  109. package/context/DrawingProvider.js +18 -6
  110. package/context/HighlightProvider.d.ts +17 -0
  111. package/context/HighlightProvider.js +3 -4
  112. package/context/InteractionProvider.d.ts +6 -0
  113. package/context/InteractionProvider.js +3 -4
  114. package/context/SeriesContextProvider.d.ts +5 -0
  115. package/context/SeriesContextProvider.js +3 -4
  116. package/esm/BarChart/BarChart.js +90 -13
  117. package/esm/BarChart/BarElement.js +7 -4
  118. package/esm/BarChart/BarPlot.js +152 -67
  119. package/esm/BarChart/formatter.js +1 -1
  120. package/esm/ChartContainer/index.js +3 -0
  121. package/esm/ChartsAxis/ChartsAxis.js +32 -5
  122. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  123. package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
  124. package/esm/ChartsLegend/ChartsLegend.js +190 -144
  125. package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
  126. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  127. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
  128. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
  129. package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  130. package/esm/ChartsReferenceLine/common.js +20 -0
  131. package/esm/ChartsReferenceLine/index.js +2 -0
  132. package/esm/ChartsSurface.js +4 -12
  133. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  134. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  135. package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
  136. package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
  137. package/esm/ChartsXAxis/ChartsXAxis.js +168 -43
  138. package/esm/ChartsYAxis/ChartsYAxis.js +93 -36
  139. package/esm/LineChart/AreaElement.js +10 -0
  140. package/esm/LineChart/AreaPlot.js +26 -6
  141. package/esm/LineChart/LineChart.js +86 -13
  142. package/esm/LineChart/LineElement.js +10 -0
  143. package/esm/LineChart/LineHighlightElement.js +10 -0
  144. package/esm/LineChart/LineHighlightPlot.js +13 -2
  145. package/esm/LineChart/LinePlot.js +25 -14
  146. package/esm/LineChart/MarkElement.js +11 -1
  147. package/esm/LineChart/MarkPlot.js +40 -8
  148. package/esm/LineChart/formatter.js +7 -3
  149. package/esm/PieChart/PieArc.js +26 -58
  150. package/esm/PieChart/PieArcLabel.js +43 -34
  151. package/esm/PieChart/PieArcLabelPlot.js +92 -0
  152. package/esm/PieChart/PieArcPlot.js +84 -0
  153. package/esm/PieChart/PieChart.js +93 -16
  154. package/esm/PieChart/PiePlot.js +76 -57
  155. package/esm/PieChart/dataTransform/transition.js +130 -0
  156. package/esm/PieChart/dataTransform/useTransformData.js +59 -0
  157. package/esm/ResponsiveChartContainer/index.js +3 -3
  158. package/esm/ScatterChart/Scatter.js +10 -0
  159. package/esm/ScatterChart/ScatterChart.js +74 -12
  160. package/esm/ScatterChart/ScatterPlot.js +10 -0
  161. package/esm/SparkLineChart/SparkLineChart.js +47 -3
  162. package/esm/constants.js +1 -1
  163. package/esm/context/CartesianContextProvider.js +41 -14
  164. package/esm/context/DrawingProvider.js +14 -0
  165. package/esm/hooks/useChartDimensions.js +2 -0
  166. package/esm/hooks/useMounted.js +16 -0
  167. package/esm/hooks/useReducedMotion.js +27 -0
  168. package/esm/hooks/useTicks.js +15 -9
  169. package/esm/index.js +1 -0
  170. package/esm/internals/components/AxisSharedComponents.js +15 -70
  171. package/esm/internals/components/ChartsText.js +77 -0
  172. package/esm/internals/domUtils.js +113 -0
  173. package/esm/internals/geometry.js +36 -0
  174. package/hooks/useAxisEvents.js +2 -2
  175. package/hooks/useChartDimensions.d.ts +2 -0
  176. package/hooks/useChartDimensions.js +5 -4
  177. package/hooks/useDrawingArea.js +2 -2
  178. package/hooks/useInteractionItemProps.js +2 -2
  179. package/hooks/useMounted.d.ts +1 -0
  180. package/hooks/useMounted.js +25 -0
  181. package/hooks/useReducedMotion.d.ts +8 -0
  182. package/hooks/useReducedMotion.js +33 -0
  183. package/hooks/useScale.d.ts +2 -2
  184. package/hooks/useScale.js +2 -2
  185. package/hooks/useTicks.d.ts +19 -11
  186. package/hooks/useTicks.js +19 -14
  187. package/index.d.ts +1 -0
  188. package/index.js +12 -1
  189. package/internals/components/AxisSharedComponents.d.ts +0 -4
  190. package/internals/components/AxisSharedComponents.js +18 -78
  191. package/internals/components/ChartsText.d.ts +35 -0
  192. package/internals/components/ChartsText.js +87 -0
  193. package/internals/defaultizeColor.d.ts +7 -2
  194. package/internals/defaultizeValueFormatter.js +1 -2
  195. package/internals/domUtils.d.ts +13 -0
  196. package/internals/domUtils.js +122 -0
  197. package/internals/geometry.d.ts +9 -0
  198. package/internals/geometry.js +42 -0
  199. package/internals/isBandScale.d.ts +3 -1
  200. package/internals/stackSeries.js +2 -4
  201. package/internals/utils.d.ts +5 -0
  202. package/legacy/BarChart/BarChart.js +90 -13
  203. package/legacy/BarChart/BarElement.js +6 -3
  204. package/legacy/BarChart/BarPlot.js +151 -63
  205. package/legacy/BarChart/formatter.js +1 -1
  206. package/legacy/ChartContainer/index.js +3 -0
  207. package/legacy/ChartsAxis/ChartsAxis.js +32 -5
  208. package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
  209. package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
  210. package/legacy/ChartsLegend/ChartsLegend.js +205 -142
  211. package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
  212. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  213. package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
  214. package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
  215. package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  216. package/legacy/ChartsReferenceLine/common.js +20 -0
  217. package/legacy/ChartsReferenceLine/index.js +2 -0
  218. package/legacy/ChartsSurface.js +3 -12
  219. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
  220. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  221. package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
  222. package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
  223. package/legacy/ChartsXAxis/ChartsXAxis.js +176 -50
  224. package/legacy/ChartsYAxis/ChartsYAxis.js +97 -41
  225. package/legacy/LineChart/AreaElement.js +10 -0
  226. package/legacy/LineChart/AreaPlot.js +31 -7
  227. package/legacy/LineChart/LineChart.js +86 -13
  228. package/legacy/LineChart/LineElement.js +10 -0
  229. package/legacy/LineChart/LineHighlightElement.js +10 -0
  230. package/legacy/LineChart/LineHighlightPlot.js +13 -2
  231. package/legacy/LineChart/LinePlot.js +29 -12
  232. package/legacy/LineChart/MarkElement.js +11 -1
  233. package/legacy/LineChart/MarkPlot.js +39 -8
  234. package/legacy/LineChart/formatter.js +7 -3
  235. package/legacy/PieChart/PieArc.js +30 -62
  236. package/legacy/PieChart/PieArcLabel.js +48 -34
  237. package/legacy/PieChart/PieArcLabelPlot.js +93 -0
  238. package/legacy/PieChart/PieArcPlot.js +84 -0
  239. package/legacy/PieChart/PieChart.js +93 -16
  240. package/legacy/PieChart/PiePlot.js +76 -59
  241. package/legacy/PieChart/dataTransform/transition.js +142 -0
  242. package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
  243. package/legacy/ResponsiveChartContainer/index.js +3 -3
  244. package/legacy/ScatterChart/Scatter.js +10 -0
  245. package/legacy/ScatterChart/ScatterChart.js +74 -12
  246. package/legacy/ScatterChart/ScatterPlot.js +10 -0
  247. package/legacy/SparkLineChart/SparkLineChart.js +47 -3
  248. package/legacy/constants.js +1 -1
  249. package/legacy/context/CartesianContextProvider.js +41 -14
  250. package/legacy/context/DrawingProvider.js +14 -0
  251. package/legacy/hooks/useChartDimensions.js +2 -0
  252. package/legacy/hooks/useMounted.js +21 -0
  253. package/legacy/hooks/useReducedMotion.js +27 -0
  254. package/legacy/hooks/useTicks.js +16 -9
  255. package/legacy/index.js +2 -1
  256. package/legacy/internals/components/AxisSharedComponents.js +11 -65
  257. package/legacy/internals/components/ChartsText.js +79 -0
  258. package/legacy/internals/domUtils.js +121 -0
  259. package/legacy/internals/geometry.js +37 -0
  260. package/models/axis.d.ts +58 -20
  261. package/models/layout.d.ts +13 -6
  262. package/models/seriesType/common.d.ts +16 -0
  263. package/models/seriesType/line.d.ts +8 -3
  264. package/models/seriesType/pie.d.ts +5 -1
  265. package/modern/BarChart/BarChart.js +90 -13
  266. package/modern/BarChart/BarElement.js +7 -4
  267. package/modern/BarChart/BarPlot.js +149 -65
  268. package/modern/BarChart/formatter.js +1 -1
  269. package/modern/ChartContainer/index.js +3 -0
  270. package/modern/ChartsAxis/ChartsAxis.js +31 -5
  271. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  272. package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
  273. package/modern/ChartsLegend/ChartsLegend.js +190 -144
  274. package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
  275. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  276. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
  277. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
  278. package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  279. package/modern/ChartsReferenceLine/common.js +20 -0
  280. package/modern/ChartsReferenceLine/index.js +2 -0
  281. package/modern/ChartsSurface.js +4 -12
  282. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  283. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  284. package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
  285. package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
  286. package/modern/ChartsXAxis/ChartsXAxis.js +167 -42
  287. package/modern/ChartsYAxis/ChartsYAxis.js +92 -35
  288. package/modern/LineChart/AreaElement.js +10 -0
  289. package/modern/LineChart/AreaPlot.js +25 -6
  290. package/modern/LineChart/LineChart.js +86 -13
  291. package/modern/LineChart/LineElement.js +10 -0
  292. package/modern/LineChart/LineHighlightElement.js +10 -0
  293. package/modern/LineChart/LineHighlightPlot.js +13 -2
  294. package/modern/LineChart/LinePlot.js +23 -10
  295. package/modern/LineChart/MarkElement.js +11 -1
  296. package/modern/LineChart/MarkPlot.js +40 -8
  297. package/modern/LineChart/formatter.js +4 -3
  298. package/modern/PieChart/PieArc.js +26 -57
  299. package/modern/PieChart/PieArcLabel.js +43 -34
  300. package/modern/PieChart/PieArcLabelPlot.js +90 -0
  301. package/modern/PieChart/PieArcPlot.js +83 -0
  302. package/modern/PieChart/PieChart.js +93 -16
  303. package/modern/PieChart/PiePlot.js +76 -55
  304. package/modern/PieChart/dataTransform/transition.js +130 -0
  305. package/modern/PieChart/dataTransform/useTransformData.js +58 -0
  306. package/modern/ResponsiveChartContainer/index.js +3 -3
  307. package/modern/ScatterChart/Scatter.js +10 -0
  308. package/modern/ScatterChart/ScatterChart.js +74 -12
  309. package/modern/ScatterChart/ScatterPlot.js +10 -0
  310. package/modern/SparkLineChart/SparkLineChart.js +47 -3
  311. package/modern/constants.js +1 -1
  312. package/modern/context/CartesianContextProvider.js +40 -13
  313. package/modern/context/DrawingProvider.js +14 -0
  314. package/modern/hooks/useChartDimensions.js +2 -0
  315. package/modern/hooks/useMounted.js +16 -0
  316. package/modern/hooks/useReducedMotion.js +27 -0
  317. package/modern/hooks/useTicks.js +15 -9
  318. package/modern/index.js +2 -1
  319. package/modern/internals/components/AxisSharedComponents.js +15 -70
  320. package/modern/internals/components/ChartsText.js +77 -0
  321. package/modern/internals/domUtils.js +113 -0
  322. package/modern/internals/geometry.js +36 -0
  323. package/package.json +9 -6
  324. package/themeAugmentation/components.d.ts +1 -0
  325. package/themeAugmentation/overrides.d.ts +2 -0
@@ -0,0 +1,70 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import { ChartsXReferenceLine } from './ChartsXReferenceLine';
5
+ import { ChartsYReferenceLine } from './ChartsYReferenceLine';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ function ChartsReferenceLine(props) {
8
+ if (props.x !== undefined && props.y !== undefined) {
9
+ throw new Error('MUI-X: The ChartsReferenceLine can not have both `x` and `y` props set.');
10
+ }
11
+ if (props.x === undefined && props.y === undefined) {
12
+ throw new Error('MUI-X: The ChartsReferenceLine should have a value in `x` or `y` prop.');
13
+ }
14
+ if (props.x !== undefined) {
15
+ return /*#__PURE__*/_jsx(ChartsXReferenceLine, _extends({}, props));
16
+ }
17
+ return /*#__PURE__*/_jsx(ChartsYReferenceLine, _extends({}, props));
18
+ }
19
+ process.env.NODE_ENV !== "production" ? ChartsReferenceLine.propTypes = {
20
+ // ----------------------------- Warning --------------------------------
21
+ // | These PropTypes are generated from the TypeScript type definitions |
22
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
23
+ // ----------------------------------------------------------------------
24
+ /**
25
+ * The id of the axis used for the reference value.
26
+ * @default The `id` of the first defined axis.
27
+ */
28
+ axisId: PropTypes.string,
29
+ /**
30
+ * Override or extend the styles applied to the component.
31
+ */
32
+ classes: PropTypes.object,
33
+ /**
34
+ * The label to display along the reference line.
35
+ */
36
+ label: PropTypes.string,
37
+ /**
38
+ * The alignment if the label is in the chart drawing area.
39
+ * @default 'middle'
40
+ */
41
+ labelAlign: PropTypes.oneOf(['end', 'middle', 'start']),
42
+ /**
43
+ * The style applied to the label.
44
+ */
45
+ labelStyle: PropTypes.object,
46
+ /**
47
+ * The style applied to the line.
48
+ */
49
+ lineStyle: PropTypes.object,
50
+ /**
51
+ * Additional space arround the label in px.
52
+ * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
53
+ * @default 5
54
+ */
55
+ spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
56
+ x: PropTypes.number,
57
+ y: PropTypes.number
58
+ })]),
59
+ /**
60
+ * The x value associated with the reference line.
61
+ * If defined the reference line will be vertical.
62
+ */
63
+ x: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]),
64
+ /**
65
+ * The y value associated with the reference line.
66
+ * If defined the reference line will be horizontal.
67
+ */
68
+ y: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string])
69
+ } : void 0;
70
+ export { ChartsReferenceLine };
@@ -0,0 +1,104 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import composeClasses from '@mui/utils/composeClasses';
4
+ import { useDrawingArea, useXScale } from '../hooks';
5
+ import { ReferenceLineRoot } from './common';
6
+ import { ChartsText } from '../internals/components/ChartsText';
7
+ import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ const getTextParams = ({
11
+ top,
12
+ height,
13
+ spacingY,
14
+ labelAlign = 'middle'
15
+ }) => {
16
+ switch (labelAlign) {
17
+ case 'start':
18
+ return {
19
+ y: top + spacingY,
20
+ style: {
21
+ dominantBaseline: 'hanging',
22
+ textAnchor: 'start'
23
+ }
24
+ };
25
+ case 'end':
26
+ return {
27
+ y: top + height - spacingY,
28
+ style: {
29
+ dominantBaseline: 'auto',
30
+ textAnchor: 'start'
31
+ }
32
+ };
33
+ default:
34
+ return {
35
+ y: top + height / 2,
36
+ style: {
37
+ dominantBaseline: 'central',
38
+ textAnchor: 'start'
39
+ }
40
+ };
41
+ }
42
+ };
43
+ export function getXReferenceLineClasses(classes) {
44
+ return composeClasses({
45
+ root: ['root', 'vertical'],
46
+ line: ['line'],
47
+ label: ['label']
48
+ }, getReferenceLineUtilityClass, classes);
49
+ }
50
+ let warnedOnce = false;
51
+ function ChartsXReferenceLine(props) {
52
+ const {
53
+ x,
54
+ label = '',
55
+ spacing = 5,
56
+ classes: inClasses,
57
+ labelAlign,
58
+ lineStyle,
59
+ labelStyle,
60
+ axisId
61
+ } = props;
62
+ const {
63
+ top,
64
+ height
65
+ } = useDrawingArea();
66
+ const xAxisScale = useXScale(axisId);
67
+ const xPosition = xAxisScale(x);
68
+ if (xPosition === undefined) {
69
+ if (process.env.NODE_ENV !== 'production') {
70
+ if (!warnedOnce) {
71
+ warnedOnce = true;
72
+ console.error(`MUI X: the value ${x} does not exist in the data of x axis with id ${axisId}.`);
73
+ }
74
+ }
75
+ return null;
76
+ }
77
+ const d = `M ${xPosition} ${top} l 0 ${height}`;
78
+ const classes = getXReferenceLineClasses(inClasses);
79
+ const spacingX = typeof spacing === 'object' ? spacing.x ?? 0 : spacing;
80
+ const spacingY = typeof spacing === 'object' ? spacing.y ?? 0 : spacing;
81
+ const textParams = _extends({
82
+ x: xPosition + spacingX,
83
+ text: label,
84
+ fontSize: 12
85
+ }, getTextParams({
86
+ top,
87
+ height,
88
+ spacingY,
89
+ labelAlign
90
+ }), {
91
+ className: classes.label
92
+ });
93
+ return /*#__PURE__*/_jsxs(ReferenceLineRoot, {
94
+ className: classes.root,
95
+ children: [/*#__PURE__*/_jsx("path", {
96
+ d: d,
97
+ className: classes.line,
98
+ style: lineStyle
99
+ }), /*#__PURE__*/_jsx(ChartsText, _extends({}, textParams, {
100
+ style: _extends({}, textParams.style, labelStyle)
101
+ }))]
102
+ });
103
+ }
104
+ export { ChartsXReferenceLine };
@@ -0,0 +1,104 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ import composeClasses from '@mui/utils/composeClasses';
4
+ import { useDrawingArea, useYScale } from '../hooks';
5
+ import { ReferenceLineRoot } from './common';
6
+ import { ChartsText } from '../internals/components/ChartsText';
7
+ import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ const getTextParams = ({
11
+ left,
12
+ width,
13
+ spacingX,
14
+ labelAlign = 'middle'
15
+ }) => {
16
+ switch (labelAlign) {
17
+ case 'start':
18
+ return {
19
+ x: left + spacingX,
20
+ style: {
21
+ dominantBaseline: 'auto',
22
+ textAnchor: 'start'
23
+ }
24
+ };
25
+ case 'end':
26
+ return {
27
+ x: left + width - spacingX,
28
+ style: {
29
+ dominantBaseline: 'auto',
30
+ textAnchor: 'end'
31
+ }
32
+ };
33
+ default:
34
+ return {
35
+ x: left + width / 2,
36
+ style: {
37
+ dominantBaseline: 'auto',
38
+ textAnchor: 'middle'
39
+ }
40
+ };
41
+ }
42
+ };
43
+ let warnedOnce = false;
44
+ export function getYReferenceLineClasses(classes) {
45
+ return composeClasses({
46
+ root: ['root', 'horizontal'],
47
+ line: ['line'],
48
+ label: ['label']
49
+ }, getReferenceLineUtilityClass, classes);
50
+ }
51
+ function ChartsYReferenceLine(props) {
52
+ const {
53
+ y,
54
+ label = '',
55
+ spacing = 5,
56
+ classes: inClasses,
57
+ labelAlign,
58
+ lineStyle,
59
+ labelStyle,
60
+ axisId
61
+ } = props;
62
+ const {
63
+ left,
64
+ width
65
+ } = useDrawingArea();
66
+ const yAxisScale = useYScale(axisId);
67
+ const yPosition = yAxisScale(y);
68
+ if (yPosition === undefined) {
69
+ if (process.env.NODE_ENV !== 'production') {
70
+ if (!warnedOnce) {
71
+ warnedOnce = true;
72
+ console.error(`MUI X: the value ${y} does not exist in the data of y axis with id ${axisId}.`);
73
+ }
74
+ }
75
+ return null;
76
+ }
77
+ const d = `M ${left} ${yPosition} l ${width} 0`;
78
+ const classes = getYReferenceLineClasses(inClasses);
79
+ const spacingX = typeof spacing === 'object' ? spacing.x ?? 0 : spacing;
80
+ const spacingY = typeof spacing === 'object' ? spacing.y ?? 0 : spacing;
81
+ const textParams = _extends({
82
+ y: yPosition - spacingY,
83
+ text: label,
84
+ fontSize: 12
85
+ }, getTextParams({
86
+ left,
87
+ width,
88
+ spacingX,
89
+ labelAlign
90
+ }), {
91
+ className: classes.label
92
+ });
93
+ return /*#__PURE__*/_jsxs(ReferenceLineRoot, {
94
+ className: classes.root,
95
+ children: [/*#__PURE__*/_jsx("path", {
96
+ d: d,
97
+ className: classes.line,
98
+ style: lineStyle
99
+ }), /*#__PURE__*/_jsx(ChartsText, _extends({}, textParams, {
100
+ style: _extends({}, textParams.style, labelStyle)
101
+ }))]
102
+ });
103
+ }
104
+ export { ChartsYReferenceLine };
@@ -0,0 +1,6 @@
1
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
2
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
+ export function getReferenceLineUtilityClass(slot) {
4
+ return generateUtilityClass('MuiChartsReferenceLine', slot);
5
+ }
6
+ export const referenceLineClasses = generateUtilityClasses('MuiChartsReferenceLine', ['root', 'vertical', 'horizontal', 'line', 'label']);
@@ -0,0 +1,20 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { styled } from '@mui/material/styles';
3
+ import { referenceLineClasses } from './chartsReferenceLineClasses';
4
+ export const ReferenceLineRoot = styled('g')(({
5
+ theme
6
+ }) => ({
7
+ [`& .${referenceLineClasses.line}`]: {
8
+ fill: 'none',
9
+ stroke: (theme.vars || theme).palette.text.primary,
10
+ shapeRendering: 'crispEdges',
11
+ strokeWidth: 1,
12
+ pointerEvents: 'none'
13
+ },
14
+ [`& .${referenceLineClasses.label}`]: _extends({
15
+ fill: (theme.vars || theme).palette.text.primary,
16
+ stroke: 'none',
17
+ pointerEvents: 'none',
18
+ fontSize: 12
19
+ }, theme.typography.body1)
20
+ }));
@@ -0,0 +1,2 @@
1
+ export * from './ChartsReferenceLine';
2
+ export * from './chartsReferenceLineClasses';
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className", "sx"];
4
- import { styled } from '@mui/system';
3
+ const _excluded = ["children", "width", "height", "viewBox", "disableAxisListener", "className"];
4
+ import { styled } from '@mui/material/styles';
5
5
  import * as React from 'react';
6
6
  import { useAxisEvents } from './hooks/useAxisEvents';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -16,8 +16,7 @@ export const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurfac
16
16
  width,
17
17
  height,
18
18
  viewBox,
19
- disableAxisListener = false,
20
- sx
19
+ disableAxisListener = false
21
20
  } = props,
22
21
  other = _objectWithoutPropertiesLoose(props, _excluded);
23
22
  const svgView = _extends({
@@ -31,14 +30,7 @@ export const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurfac
31
30
  width: width,
32
31
  height: height,
33
32
  viewBox: `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`,
34
- ref: ref,
35
- sx: [{
36
- '--ChartsLegend-itemWidth': '100px',
37
- '--ChartsLegend-itemMarkSize': '20px',
38
- '--ChartsLegend-rootSpacing': '5px',
39
- '--ChartsLegend-labelSpacing': '5px',
40
- '--ChartsLegend-rootOffsetY': '-20px'
41
- }, ...(Array.isArray(sx) ? sx : [sx])]
33
+ ref: ref
42
34
  }, other, {
43
35
  children: [/*#__PURE__*/_jsx("title", {
44
36
  children: props.title
@@ -1,5 +1,7 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import * as React from 'react';
2
3
  import Typography from '@mui/material/Typography';
4
+ import { useSlotProps } from '@mui/base/utils';
3
5
  import { SeriesContext } from '../context/SeriesContextProvider';
4
6
  import { CartesianContext } from '../context/CartesianContextProvider';
5
7
  import { ChartsTooltipCell, ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipMark, ChartsTooltipRow } from './ChartsTooltipTable';
@@ -20,7 +22,6 @@ export function DefaultChartsAxisContent(props) {
20
22
  const axisFormatter = axis.valueFormatter ?? (v => v.toLocaleString());
21
23
  return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
22
24
  sx: sx,
23
- variant: "outlined",
24
25
  className: classes.root,
25
26
  children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
26
27
  children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/_jsx("thead", {
@@ -39,27 +40,33 @@ export function DefaultChartsAxisContent(props) {
39
40
  label,
40
41
  valueFormatter,
41
42
  data
42
- }) => /*#__PURE__*/_jsxs(ChartsTooltipRow, {
43
- children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
44
- className: classes.markCell,
45
- children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
46
- ownerState: {
47
- color
48
- },
49
- boxShadow: 1
50
- })
51
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
52
- className: classes.labelCell,
53
- children: label ? /*#__PURE__*/_jsx(Typography, {
54
- children: label
55
- }) : null
56
- }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
57
- className: classes.valueCell,
58
- children: /*#__PURE__*/_jsx(Typography, {
59
- children: valueFormatter(data[dataIndex])
60
- })
61
- })]
62
- }, id))
43
+ }) => {
44
+ const formattedValue = valueFormatter(data[dataIndex]);
45
+ if (formattedValue == null) {
46
+ return null;
47
+ }
48
+ return /*#__PURE__*/_jsxs(ChartsTooltipRow, {
49
+ children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
50
+ className: classes.markCell,
51
+ children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
52
+ ownerState: {
53
+ color
54
+ },
55
+ boxShadow: 1
56
+ })
57
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
58
+ className: classes.labelCell,
59
+ children: label ? /*#__PURE__*/_jsx(Typography, {
60
+ children: label
61
+ }) : null
62
+ }), /*#__PURE__*/_jsx(ChartsTooltipCell, {
63
+ className: classes.valueCell,
64
+ children: /*#__PURE__*/_jsx(Typography, {
65
+ children: formattedValue
66
+ })
67
+ })]
68
+ }, id);
69
+ })
63
70
  })]
64
71
  })
65
72
  });
@@ -67,6 +74,7 @@ export function DefaultChartsAxisContent(props) {
67
74
  export function ChartsAxisTooltipContent(props) {
68
75
  const {
69
76
  content,
77
+ contentProps,
70
78
  axisData,
71
79
  sx,
72
80
  classes
@@ -99,13 +107,19 @@ export function ChartsAxisTooltipContent(props) {
99
107
  return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
100
108
  }, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
101
109
  const Content = content ?? DefaultChartsAxisContent;
102
- return /*#__PURE__*/_jsx(Content, {
103
- axisData: axisData,
104
- series: relevantSeries,
105
- axis: relevantAxis,
106
- dataIndex: dataIndex,
107
- axisValue: axisValue,
108
- sx: sx,
109
- classes: classes
110
+ const chartTooltipContentProps = useSlotProps({
111
+ elementType: Content,
112
+ externalSlotProps: contentProps,
113
+ additionalProps: {
114
+ axisData,
115
+ series: relevantSeries,
116
+ axis: relevantAxis,
117
+ dataIndex,
118
+ axisValue,
119
+ sx,
120
+ classes
121
+ },
122
+ ownerState: {}
110
123
  });
124
+ return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
111
125
  }
@@ -1,4 +1,6 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import * as React from 'react';
3
+ import { useSlotProps } from '@mui/base/utils';
2
4
  import { SeriesContext } from '../context/SeriesContextProvider';
3
5
  import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
4
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,7 +31,6 @@ export function DefaultChartsItemContent(props) {
29
31
  const formattedValue = series.valueFormatter(series.data[itemData.dataIndex]);
30
32
  return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
31
33
  sx: sx,
32
- variant: "outlined",
33
34
  className: classes.root,
34
35
  children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
35
36
  children: /*#__PURE__*/_jsx("tbody", {
@@ -58,14 +59,21 @@ export function ChartsItemTooltipContent(props) {
58
59
  content,
59
60
  itemData,
60
61
  sx,
61
- classes
62
+ classes,
63
+ contentProps
62
64
  } = props;
63
65
  const series = React.useContext(SeriesContext)[itemData.type].series[itemData.seriesId];
64
66
  const Content = content ?? DefaultChartsItemContent;
65
- return /*#__PURE__*/_jsx(Content, {
66
- itemData: itemData,
67
- series: series,
68
- sx: sx,
69
- classes: classes
67
+ const chartTooltipContentProps = useSlotProps({
68
+ elementType: Content,
69
+ externalSlotProps: contentProps,
70
+ additionalProps: {
71
+ itemData,
72
+ series,
73
+ sx,
74
+ classes
75
+ },
76
+ ownerState: {}
70
77
  });
78
+ return /*#__PURE__*/_jsx(Content, _extends({}, chartTooltipContentProps));
71
79
  }
@@ -1,8 +1,11 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import * as React from 'react';
2
3
  import PropTypes from 'prop-types';
3
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
4
- import Popper from '@mui/material/Popper';
5
- import NoSsr from '@mui/material/NoSsr';
4
+ import composeClasses from '@mui/utils/composeClasses';
5
+ import { styled } from '@mui/material/styles';
6
+ import { Popper } from '@mui/base/Popper';
7
+ import { NoSsr } from '@mui/base/NoSsr';
8
+ import { useSlotProps } from '@mui/base/utils';
6
9
  import { InteractionContext } from '../context/InteractionProvider';
7
10
  import { generateVirtualElement, useMouseTracker, getTootipHasData } from './utils';
8
11
  import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
@@ -21,11 +24,33 @@ const useUtilityClasses = ownerState => {
21
24
  };
22
25
  return composeClasses(slots, getTooltipUtilityClass, classes);
23
26
  };
27
+ const ChartsTooltipRoot = styled(Popper, {
28
+ name: 'MuiChartsTooltip',
29
+ slot: 'Root',
30
+ overridesResolver: (_, styles) => styles.root
31
+ })(({
32
+ theme
33
+ }) => ({
34
+ pointerEvents: 'none',
35
+ zIndex: theme.zIndex.modal
36
+ }));
37
+
38
+ /**
39
+ * Demos:
40
+ *
41
+ * - [ChartsTooltip](https://mui.com/x/react-charts/tooltip/)
42
+ *
43
+ * API:
44
+ *
45
+ * - [ChartsTooltip API](https://mui.com/x/api/charts/charts-tool-tip/)
46
+ */
24
47
  function ChartsTooltip(props) {
25
48
  const {
26
49
  trigger = 'axis',
27
50
  itemContent,
28
- axisContent
51
+ axisContent,
52
+ slots,
53
+ slotProps
29
54
  } = props;
30
55
  const mousePosition = useMouseTracker();
31
56
  const {
@@ -38,33 +63,40 @@ function ChartsTooltip(props) {
38
63
  const classes = useUtilityClasses({
39
64
  classes: props.classes
40
65
  });
66
+ const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
67
+ const popperProps = useSlotProps({
68
+ elementType: PopperComponent,
69
+ externalSlotProps: slotProps?.popper,
70
+ additionalProps: {
71
+ open: popperOpen,
72
+ placement: 'right-start',
73
+ anchorEl: generateVirtualElement(mousePosition)
74
+ },
75
+ ownerState: {}
76
+ });
41
77
  if (trigger === 'none') {
42
78
  return null;
43
79
  }
44
80
  return /*#__PURE__*/_jsx(NoSsr, {
45
- children: popperOpen && /*#__PURE__*/_jsx(Popper, {
46
- open: popperOpen,
47
- placement: "right-start",
48
- anchorEl: generateVirtualElement(mousePosition),
49
- style: {
50
- pointerEvents: 'none'
51
- },
81
+ children: popperOpen && /*#__PURE__*/_jsx(PopperComponent, _extends({}, popperProps, {
52
82
  children: trigger === 'item' ? /*#__PURE__*/_jsx(ChartsItemTooltipContent, {
53
83
  itemData: displayedData,
54
- content: itemContent,
84
+ content: slots?.itemContent ?? itemContent,
85
+ contentProps: slotProps?.itemContent,
55
86
  sx: {
56
87
  mx: 2
57
88
  },
58
89
  classes: classes
59
90
  }) : /*#__PURE__*/_jsx(ChartsAxisTooltipContent, {
60
91
  axisData: displayedData,
61
- content: axisContent,
92
+ content: slots?.axisContent ?? axisContent,
93
+ contentProps: slotProps?.axisContent,
62
94
  sx: {
63
95
  mx: 2
64
96
  },
65
97
  classes: classes
66
98
  })
67
- })
99
+ }))
68
100
  });
69
101
  }
70
102
  process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
@@ -74,6 +106,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
74
106
  // ----------------------------------------------------------------------
75
107
  /**
76
108
  * Component to override the tooltip content when triger is set to 'axis'.
109
+ * @deprecated Use slots.axisContent instead
77
110
  */
78
111
  axisContent: PropTypes.elementType,
79
112
  /**
@@ -82,8 +115,19 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
82
115
  classes: PropTypes.object,
83
116
  /**
84
117
  * Component to override the tooltip content when triger is set to 'item'.
118
+ * @deprecated Use slots.itemContent instead
85
119
  */
86
120
  itemContent: PropTypes.elementType,
121
+ /**
122
+ * The props used for each component slot.
123
+ * @default {}
124
+ */
125
+ slotProps: PropTypes.object,
126
+ /**
127
+ * Overridable component slots.
128
+ * @default {}
129
+ */
130
+ slots: PropTypes.object,
87
131
  /**
88
132
  * Select the kind of tooltip to display
89
133
  * - 'item': Shows data about the item below the mouse.
@@ -1,11 +1,18 @@
1
- import Box from '@mui/material/Box';
2
- import Paper from '@mui/material/Paper';
1
+ import Box from '@mui/system/Box';
3
2
  import { styled } from '@mui/material/styles';
4
3
  import { tooltipClasses } from './tooltipClasses';
5
- export const ChartsTooltipPaper = styled(Paper, {
4
+ export const ChartsTooltipPaper = styled('div', {
6
5
  name: 'MuiChartsTooltip',
7
- slot: 'Table'
8
- })({});
6
+ slot: 'Container'
7
+ })(({
8
+ theme
9
+ }) => ({
10
+ backgroundColor: (theme.vars || theme).palette.background.paper,
11
+ color: (theme.vars || theme).palette.text.primary,
12
+ transition: theme.transitions.create('box-shadow'),
13
+ border: `1px solid ${(theme.vars || theme).palette.divider}`,
14
+ borderRadius: theme.shape.borderRadius
15
+ }));
9
16
  export const ChartsTooltipTable = styled('table', {
10
17
  name: 'MuiChartsTooltip',
11
18
  slot: 'Table'
@@ -14,7 +21,7 @@ export const ChartsTooltipTable = styled('table', {
14
21
  }) => ({
15
22
  borderSpacing: 0,
16
23
  '& thead td': {
17
- borderBottom: `solid ${theme.palette.divider} 1px`
24
+ borderBottom: `solid ${(theme.vars || theme).palette.divider} 1px`
18
25
  }
19
26
  }));
20
27
  export const ChartsTooltipRow = styled('tr', {
@@ -37,13 +44,13 @@ export const ChartsTooltipCell = styled('td', {
37
44
  theme
38
45
  }) => ({
39
46
  verticalAlign: 'middle',
40
- color: theme.palette.text.secondary,
47
+ color: (theme.vars || theme).palette.text.secondary,
41
48
  [`&.${tooltipClasses.labelCell}`]: {
42
49
  paddingLeft: theme.spacing(1)
43
50
  },
44
51
  [`&.${tooltipClasses.valueCell}`]: {
45
52
  paddingLeft: theme.spacing(4),
46
- color: theme.palette.text.primary
53
+ color: (theme.vars || theme).palette.text.primary
47
54
  },
48
55
  'td:first-of-type&': {
49
56
  paddingLeft: theme.spacing(2)
@@ -63,7 +70,7 @@ export const ChartsTooltipMark = styled(Box, {
63
70
  height: theme.spacing(1),
64
71
  borderRadius: '50%',
65
72
  backgroundColor: ownerState.color,
66
- borderColor: theme.palette.background.paper,
67
- border: `solid ${theme.palette.background.paper} ${theme.spacing(0.25)}`,
73
+ borderColor: (theme.vars || theme).palette.background.paper,
74
+ border: `solid ${(theme.vars || theme).palette.background.paper} ${theme.spacing(0.25)}`,
68
75
  boxSizing: 'content-box'
69
76
  }));