@mui/x-charts 7.22.2 → 8.0.0-alpha.0

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 (189) hide show
  1. package/BarChart/BarChart.d.ts +7 -7
  2. package/BarChart/BarChart.js +7 -29
  3. package/BarChart/BarElement.d.ts +1 -1
  4. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  5. package/BarChart/BarPlot.js +12 -4
  6. package/BarChart/extremums.js +3 -3
  7. package/BarChart/useBarChartProps.d.ts +2 -2
  8. package/BarChart/useBarChartProps.js +3 -4
  9. package/CHANGELOG.md +142 -155
  10. package/ChartContainer/ChartContainer.d.ts +16 -33
  11. package/ChartContainer/ChartContainer.js +22 -41
  12. package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.d.ts +2 -2
  13. package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.d.ts +1 -1
  14. package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  15. package/ChartContainer/useChartContainerProps.d.ts +11 -94
  16. package/ChartContainer/useChartContainerProps.js +42 -58
  17. package/ChartsLegend/ChartsLegend.js +0 -3
  18. package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
  19. package/ChartsLegend/DefaultChartsLegend.js +1 -12
  20. package/ChartsLegend/LegendPerItem.d.ts +1 -1
  21. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  22. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  23. package/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  24. package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  25. package/ChartsTooltip/ChartsTooltip.js +45 -6
  26. package/ChartsTooltip/useAxisTooltip.js +3 -3
  27. package/ChartsTooltip/useItemTooltip.js +3 -3
  28. package/ChartsTooltip/utils.d.ts +5 -13
  29. package/ChartsTooltip/utils.js +45 -42
  30. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  31. package/Gauge/GaugeContainer.js +1 -1
  32. package/LineChart/AreaElement.d.ts +1 -1
  33. package/LineChart/AreaPlot.js +2 -6
  34. package/LineChart/LineChart.d.ts +7 -7
  35. package/LineChart/LineChart.js +7 -29
  36. package/LineChart/LineElement.d.ts +1 -1
  37. package/LineChart/LineHighlightPlot.d.ts +1 -1
  38. package/LineChart/LineHighlightPlot.js +2 -6
  39. package/LineChart/LinePlot.js +2 -6
  40. package/LineChart/MarkPlot.js +2 -6
  41. package/LineChart/extremums.js +10 -6
  42. package/LineChart/useLineChartProps.d.ts +2 -2
  43. package/LineChart/useLineChartProps.js +3 -4
  44. package/PieChart/PieArc.d.ts +0 -5
  45. package/PieChart/PieArc.js +1 -10
  46. package/PieChart/PieArcPlot.js +0 -5
  47. package/PieChart/PieChart.d.ts +9 -32
  48. package/PieChart/PieChart.js +17 -102
  49. package/README.md +2 -2
  50. package/ScatterChart/ScatterChart.d.ts +7 -7
  51. package/ScatterChart/ScatterChart.js +7 -29
  52. package/ScatterChart/ScatterPlot.js +3 -6
  53. package/ScatterChart/extremums.js +6 -6
  54. package/ScatterChart/useScatterChartProps.d.ts +2 -2
  55. package/ScatterChart/useScatterChartProps.js +3 -4
  56. package/SparkLineChart/SparkLineChart.d.ts +4 -4
  57. package/SparkLineChart/SparkLineChart.js +2 -2
  58. package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
  59. package/context/ChartDataProvider/ChartDataProvider.d.ts +41 -0
  60. package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
  61. package/context/ChartDataProvider/index.d.ts +1 -0
  62. package/context/ChartDataProvider/index.js +1 -0
  63. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +97 -0
  64. package/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
  65. package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
  66. package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  67. package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
  68. package/context/HighlightedProvider/HighlightedProvider.js +1 -16
  69. package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
  70. package/context/ZAxisContextProvider.d.ts +1 -1
  71. package/index.d.ts +1 -2
  72. package/index.js +2 -3
  73. package/internals/defaultizeColor.d.ts +1 -8
  74. package/internals/getSymbol.js +19 -3
  75. package/internals/index.d.ts +5 -5
  76. package/internals/index.js +5 -5
  77. package/internals/useStringInterpolator.js +1 -0
  78. package/models/seriesType/bar.d.ts +1 -1
  79. package/models/seriesType/common.d.ts +0 -10
  80. package/models/seriesType/config.d.ts +1 -1
  81. package/models/seriesType/line.d.ts +1 -1
  82. package/models/seriesType/pie.d.ts +1 -1
  83. package/models/seriesType/scatter.d.ts +1 -6
  84. package/modern/BarChart/BarChart.js +7 -29
  85. package/modern/BarChart/BarPlot.js +12 -4
  86. package/modern/BarChart/extremums.js +3 -3
  87. package/modern/BarChart/useBarChartProps.js +3 -4
  88. package/modern/ChartContainer/ChartContainer.js +22 -41
  89. package/modern/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  90. package/modern/ChartContainer/useChartContainerProps.js +42 -58
  91. package/modern/ChartsLegend/ChartsLegend.js +0 -3
  92. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
  93. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  94. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  95. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  96. package/modern/ChartsTooltip/ChartsTooltip.js +45 -6
  97. package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
  98. package/modern/ChartsTooltip/useItemTooltip.js +3 -3
  99. package/modern/ChartsTooltip/utils.js +45 -42
  100. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  101. package/modern/Gauge/GaugeContainer.js +1 -1
  102. package/modern/LineChart/AreaPlot.js +2 -6
  103. package/modern/LineChart/LineChart.js +7 -29
  104. package/modern/LineChart/LineHighlightPlot.js +2 -6
  105. package/modern/LineChart/LinePlot.js +2 -6
  106. package/modern/LineChart/MarkPlot.js +2 -6
  107. package/modern/LineChart/extremums.js +10 -6
  108. package/modern/LineChart/useLineChartProps.js +3 -4
  109. package/modern/PieChart/PieArc.js +1 -10
  110. package/modern/PieChart/PieArcPlot.js +0 -5
  111. package/modern/PieChart/PieChart.js +17 -102
  112. package/modern/ScatterChart/ScatterChart.js +7 -29
  113. package/modern/ScatterChart/ScatterPlot.js +3 -6
  114. package/modern/ScatterChart/extremums.js +6 -6
  115. package/modern/ScatterChart/useScatterChartProps.js +3 -4
  116. package/modern/SparkLineChart/SparkLineChart.js +2 -2
  117. package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
  118. package/modern/context/ChartDataProvider/index.js +1 -0
  119. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
  120. package/modern/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  121. package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
  122. package/modern/index.js +2 -3
  123. package/modern/internals/getSymbol.js +19 -3
  124. package/modern/internals/index.js +5 -5
  125. package/modern/internals/useStringInterpolator.js +1 -0
  126. package/node/BarChart/BarChart.js +7 -29
  127. package/node/BarChart/BarPlot.js +11 -3
  128. package/node/BarChart/extremums.js +3 -3
  129. package/node/BarChart/useBarChartProps.js +3 -4
  130. package/node/ChartContainer/ChartContainer.js +21 -40
  131. package/node/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  132. package/node/ChartContainer/useChartContainerProps.js +42 -59
  133. package/node/ChartsLegend/ChartsLegend.js +0 -3
  134. package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
  135. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  136. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  137. package/node/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  138. package/node/ChartsTooltip/ChartsTooltip.js +44 -5
  139. package/node/ChartsTooltip/useAxisTooltip.js +3 -3
  140. package/node/ChartsTooltip/useItemTooltip.js +3 -3
  141. package/node/ChartsTooltip/utils.js +46 -44
  142. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  143. package/node/Gauge/GaugeContainer.js +1 -1
  144. package/node/LineChart/AreaPlot.js +2 -6
  145. package/node/LineChart/LineChart.js +7 -29
  146. package/node/LineChart/LineHighlightPlot.js +2 -6
  147. package/node/LineChart/LinePlot.js +2 -6
  148. package/node/LineChart/MarkPlot.js +2 -6
  149. package/node/LineChart/extremums.js +10 -6
  150. package/node/LineChart/useLineChartProps.js +3 -4
  151. package/node/PieChart/PieArc.js +1 -10
  152. package/node/PieChart/PieArcPlot.js +0 -5
  153. package/node/PieChart/PieChart.js +17 -102
  154. package/node/ScatterChart/ScatterChart.js +7 -29
  155. package/node/ScatterChart/ScatterPlot.js +3 -6
  156. package/node/ScatterChart/extremums.js +6 -6
  157. package/node/ScatterChart/useScatterChartProps.js +3 -4
  158. package/node/SparkLineChart/SparkLineChart.js +2 -2
  159. package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -26
  160. package/node/context/ChartDataProvider/index.js +16 -0
  161. package/node/context/ChartDataProvider/useChartDataProviderProps.js +94 -0
  162. package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  163. package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
  164. package/node/index.js +5 -16
  165. package/node/internals/getSymbol.js +19 -3
  166. package/node/internals/index.js +37 -29
  167. package/node/internals/useStringInterpolator.js +2 -0
  168. package/package.json +4 -4
  169. package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
  170. package/ResponsiveChartContainer/index.d.ts +0 -1
  171. package/ResponsiveChartContainer/index.js +0 -1
  172. package/ResponsiveChartContainer/package.json +0 -6
  173. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
  174. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  175. package/internals/SlotComponentPropsFromProps.d.ts +0 -1
  176. package/internals/SlotComponentPropsFromProps.js +0 -1
  177. package/models/helpers.d.ts +0 -3
  178. package/models/helpers.js +0 -1
  179. package/modern/ResponsiveChartContainer/index.js +0 -1
  180. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  181. package/modern/internals/SlotComponentPropsFromProps.js +0 -1
  182. package/modern/models/helpers.js +0 -1
  183. package/node/ResponsiveChartContainer/index.js +0 -16
  184. package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
  185. package/node/internals/SlotComponentPropsFromProps.js +0 -5
  186. package/node/models/helpers.js +0 -5
  187. /package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
  188. /package/modern/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
  189. /package/node/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
+ import { MakeOptional } from '@mui/x-internals/types';
2
3
  import { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from './BarPlot';
3
- import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
4
+ import { ChartContainerProps } from '../ChartContainer';
4
5
  import { ChartsAxisProps } from '../ChartsAxis';
5
6
  import { BarSeriesType } from '../models/seriesType/bar';
6
- import { MakeOptional } from '../models/helpers';
7
7
  import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
8
- import { ChartsLegendProps, ChartsLegendSlots, ChartsLegendSlotProps } from '../ChartsLegend';
8
+ import { ChartsLegendSlots, ChartsLegendSlotProps } from '../ChartsLegend';
9
9
  import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
10
10
  import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
11
11
  import { ChartsGridProps } from '../ChartsGrid';
@@ -15,7 +15,7 @@ export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLege
15
15
  }
16
16
  export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps<'bar'>, ChartsOverlaySlotProps {
17
17
  }
18
- export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
18
+ export interface BarChartProps extends Omit<ChartContainerProps, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
19
19
  /**
20
20
  * The series to display in the bar chart.
21
21
  * An array of [[BarSeriesType]] objects.
@@ -39,9 +39,9 @@ export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'seri
39
39
  */
40
40
  axisHighlight?: ChartsAxisHighlightProps;
41
41
  /**
42
- * @deprecated Consider using `slotProps.legend` instead.
42
+ * If `true`, the legend is not rendered.
43
43
  */
44
- legend?: ChartsLegendProps;
44
+ hideLegend?: boolean;
45
45
  /**
46
46
  * Overridable component slots.
47
47
  * @default {}
@@ -69,5 +69,5 @@ export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'seri
69
69
  *
70
70
  * - [BarChart API](https://mui.com/x/api/charts/bar-chart/)
71
71
  */
72
- declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<unknown>>;
72
+ declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<SVGSVGElement>>;
73
73
  export { BarChart };
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useThemeProps } from '@mui/material/styles';
7
7
  import { BarPlot } from "./BarPlot.js";
8
- import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
8
+ import { ChartContainer } from "../ChartContainer/index.js";
9
9
  import { ChartsAxis } from "../ChartsAxis/index.js";
10
10
  import { ChartsTooltip } from "../ChartsTooltip/index.js";
11
11
  import { ChartsLegend } from "../ChartsLegend/index.js";
@@ -46,12 +46,12 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
46
46
  tooltipProps,
47
47
  children
48
48
  } = useBarChartProps(props);
49
- return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({
49
+ return /*#__PURE__*/_jsxs(ChartContainer, _extends({
50
50
  ref: ref
51
51
  }, chartContainerProps, {
52
52
  children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
53
53
  children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
54
- })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
54
+ })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
55
55
  }));
56
56
  });
57
57
  process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
@@ -116,6 +116,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
116
116
  * The height of the chart in px. If not defined, it takes the height of the parent element.
117
117
  */
118
118
  height: PropTypes.number,
119
+ /**
120
+ * If `true`, the legend is not rendered.
121
+ */
122
+ hideLegend: PropTypes.bool,
119
123
  /**
120
124
  * The item currently highlighted. Turns highlighting into a controlled prop.
121
125
  */
@@ -134,32 +138,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
134
138
  * @default yAxisIds[0] The id of the first provided axis
135
139
  */
136
140
  leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
137
- /**
138
- * @deprecated Consider using `slotProps.legend` instead.
139
- */
140
- legend: PropTypes.shape({
141
- classes: PropTypes.object,
142
- direction: PropTypes.oneOf(['column', 'row']),
143
- hidden: PropTypes.bool,
144
- itemGap: PropTypes.number,
145
- itemMarkHeight: PropTypes.number,
146
- itemMarkWidth: PropTypes.number,
147
- labelStyle: PropTypes.object,
148
- markGap: PropTypes.number,
149
- onItemClick: PropTypes.func,
150
- padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
151
- bottom: PropTypes.number,
152
- left: PropTypes.number,
153
- right: PropTypes.number,
154
- top: PropTypes.number
155
- })]),
156
- position: PropTypes.shape({
157
- horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
158
- vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
159
- }),
160
- slotProps: PropTypes.object,
161
- slots: PropTypes.object
162
- }),
163
141
  /**
164
142
  * If `true`, a loading overlay is displayed.
165
143
  * @default false
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { AnimatedProps } from '@react-spring/web';
3
- import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
3
+ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
4
4
  import { SeriesId } from '../models/seriesType/common';
5
5
  export interface BarElementClasses {
6
6
  /** Styles applied to the root element. */
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SlotComponentPropsFromProps } from '../../internals/SlotComponentPropsFromProps';
2
+ import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
3
3
  import { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
4
4
  import { BarLabelProps } from './BarLabel';
5
5
  export interface BarLabelSlots {
@@ -9,7 +9,7 @@ import { useTransition } from '@react-spring/web';
9
9
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
10
10
  import { BarElement } from "./BarElement.js";
11
11
  import getColor from "./getColor.js";
12
- import { useChartId } from "../hooks/index.js";
12
+ import { useChartId, useDrawingArea } from "../hooks/index.js";
13
13
  import { BarClipPath } from "./BarClipPath.js";
14
14
  import { BarLabelPlot } from "./BarLabel/BarLabelPlot.js";
15
15
  import { checkScaleErrors } from "./checkScaleErrors.js";
@@ -51,6 +51,7 @@ const useAggregatedData = () => {
51
51
  seriesOrder: []
52
52
  };
53
53
  const axisData = useCartesianContext();
54
+ const drawingArea = useDrawingArea();
54
55
  const chartId = useChartId();
55
56
  const {
56
57
  series,
@@ -68,9 +69,13 @@ const useAggregatedData = () => {
68
69
  const data = stackingGroups.flatMap(({
69
70
  ids: groupIds
70
71
  }, groupIndex) => {
72
+ const xMin = drawingArea.left;
73
+ const xMax = drawingArea.left + drawingArea.width;
74
+ const yMin = drawingArea.top;
75
+ const yMax = drawingArea.top + drawingArea.height;
71
76
  return groupIds.flatMap(seriesId => {
72
- const xAxisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey ?? defaultXAxisId;
73
- const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey ?? defaultYAxisId;
77
+ const xAxisId = series[seriesId].xAxisId ?? defaultXAxisId;
78
+ const yAxisId = series[seriesId].yAxisId ?? defaultYAxisId;
74
79
  const xAxisConfig = xAxis[xAxisId];
75
80
  const yAxisConfig = yAxis[yAxisId];
76
81
  const verticalLayout = series[seriesId].layout === 'vertical';
@@ -111,6 +116,9 @@ const useAggregatedData = () => {
111
116
  value: series[seriesId].data[dataIndex],
112
117
  maskId: `${chartId}_${stackId || seriesId}_${groupIndex}_${dataIndex}`
113
118
  };
119
+ if (result.x > xMax || result.x + result.width < xMin || result.y > yMax || result.y + result.height < yMin) {
120
+ return null;
121
+ }
114
122
  if (!masks[result.maskId]) {
115
123
  masks[result.maskId] = {
116
124
  id: result.maskId,
@@ -133,7 +141,7 @@ const useAggregatedData = () => {
133
141
  mask.hasNegative = mask.hasNegative || (result.value ?? 0) < 0;
134
142
  mask.hasPositive = mask.hasPositive || (result.value ?? 0) > 0;
135
143
  return result;
136
- });
144
+ }).filter(rectangle => rectangle !== null);
137
145
  });
138
146
  });
139
147
  return {
@@ -36,7 +36,7 @@ const getValueExtremum = direction => params => {
36
36
  isDefaultAxis
37
37
  } = params;
38
38
  return Object.keys(series).filter(seriesId => {
39
- const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
39
+ const yAxisId = series[seriesId].yAxisId;
40
40
  return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
41
41
  }).reduce((acc, seriesId) => {
42
42
  const {
@@ -45,8 +45,8 @@ const getValueExtremum = direction => params => {
45
45
  const filter = getFilters?.({
46
46
  currentAxisId: axis.id,
47
47
  isDefaultAxis,
48
- seriesXAxisId: series[seriesId].xAxisId ?? series[seriesId].xAxisKey,
49
- seriesYAxisId: series[seriesId].yAxisId ?? series[seriesId].yAxisKey
48
+ seriesXAxisId: series[seriesId].xAxisId,
49
+ seriesYAxisId: series[seriesId].yAxisId
50
50
  });
51
51
  const [seriesMin, seriesMax] = stackedData?.reduce((seriesAcc, values, index) => {
52
52
  if (filter && (!filter(createResult(values[0], direction), index) || !filter(createResult(values[1], direction), index))) {
@@ -1,5 +1,5 @@
1
1
  import type { BarChartProps } from './BarChart';
2
- import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
2
+ import { ChartContainerProps } from '../ChartContainer';
3
3
  import { BarPlotProps } from './BarPlot';
4
4
  import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
5
5
  import { ChartsGridProps } from '../ChartsGrid';
@@ -17,7 +17,7 @@ import { ChartsTooltipProps } from '../ChartsTooltip';
17
17
  * @returns An object with props for the children components of BarChart
18
18
  */
19
19
  export declare const useBarChartProps: (props: BarChartProps) => {
20
- chartContainerProps: ResponsiveChartContainerProps;
20
+ chartContainerProps: ChartContainerProps;
21
21
  barPlotProps: BarPlotProps;
22
22
  axisClickHandlerProps: ChartsOnAxisClickHandlerProps;
23
23
  gridProps: ChartsGridProps;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
6
6
  import useId from '@mui/utils/useId';
7
7
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
8
8
  /**
@@ -26,7 +26,6 @@ export const useBarChartProps = props => {
26
26
  tooltip,
27
27
  onAxisClick,
28
28
  axisHighlight,
29
- legend,
30
29
  grid,
31
30
  topAxis,
32
31
  leftAxis,
@@ -117,10 +116,10 @@ export const useBarChartProps = props => {
117
116
  } : {
118
117
  x: 'band'
119
118
  }, axisHighlight);
120
- const legendProps = _extends({}, legend, {
119
+ const legendProps = {
121
120
  slots,
122
121
  slotProps
123
- });
122
+ };
124
123
  const tooltipProps = _extends({}, tooltip, {
125
124
  slots,
126
125
  slotProps