@mui/x-charts 7.22.1 → 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.
- package/BarChart/BarChart.d.ts +7 -7
- package/BarChart/BarChart.js +9 -29
- package/BarChart/BarElement.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarPlot.js +12 -4
- package/BarChart/extremums.js +3 -3
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/BarChart/useBarChartProps.js +3 -4
- package/CHANGELOG.md +143 -92
- package/ChartContainer/ChartContainer.d.ts +16 -33
- package/ChartContainer/ChartContainer.js +24 -41
- package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.d.ts +2 -2
- package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.d.ts +1 -1
- package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/ChartContainer/useChartContainerProps.d.ts +11 -86
- package/ChartContainer/useChartContainerProps.js +42 -58
- package/ChartsLegend/ChartsLegend.js +0 -3
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
- package/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/ChartsLegend/LegendPerItem.d.ts +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/ChartsTooltip/ChartsTooltip.js +45 -6
- package/ChartsTooltip/useAxisTooltip.js +3 -3
- package/ChartsTooltip/useItemTooltip.js +3 -3
- package/ChartsTooltip/utils.d.ts +5 -13
- package/ChartsTooltip/utils.js +45 -42
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/Gauge/GaugeContainer.js +1 -1
- package/LineChart/AreaElement.d.ts +1 -1
- package/LineChart/AreaPlot.js +2 -6
- package/LineChart/LineChart.d.ts +7 -7
- package/LineChart/LineChart.js +9 -29
- package/LineChart/LineElement.d.ts +1 -1
- package/LineChart/LineHighlightPlot.d.ts +1 -1
- package/LineChart/LineHighlightPlot.js +2 -6
- package/LineChart/LinePlot.js +2 -6
- package/LineChart/MarkPlot.js +2 -6
- package/LineChart/extremums.js +10 -6
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/LineChart/useLineChartProps.js +3 -4
- package/PieChart/PieArc.d.ts +0 -5
- package/PieChart/PieArc.js +1 -10
- package/PieChart/PieArcPlot.js +0 -5
- package/PieChart/PieChart.d.ts +9 -32
- package/PieChart/PieChart.js +19 -102
- package/README.md +2 -2
- package/ScatterChart/ScatterChart.d.ts +7 -7
- package/ScatterChart/ScatterChart.js +9 -29
- package/ScatterChart/ScatterPlot.js +3 -6
- package/ScatterChart/extremums.js +6 -6
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +3 -4
- package/SparkLineChart/SparkLineChart.d.ts +4 -4
- package/SparkLineChart/SparkLineChart.js +4 -2
- package/context/CartesianProvider/defaultizeAxis.d.ts +5 -1
- package/context/ChartDataProvider/ChartDataProvider.d.ts +41 -0
- package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +48 -27
- package/context/ChartDataProvider/index.d.ts +1 -0
- package/context/ChartDataProvider/index.js +1 -0
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +97 -0
- package/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +16 -12
- package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
- package/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
- package/context/ZAxisContextProvider.d.ts +1 -1
- package/index.d.ts +1 -2
- package/index.js +2 -3
- package/internals/computeAxisValue.js +13 -5
- package/internals/defaultizeColor.d.ts +1 -8
- package/internals/getSymbol.js +19 -3
- package/internals/index.d.ts +5 -5
- package/internals/index.js +5 -5
- package/internals/useStringInterpolator.js +1 -0
- package/models/axis.d.ts +10 -0
- package/models/seriesType/bar.d.ts +1 -1
- package/models/seriesType/common.d.ts +2 -12
- package/models/seriesType/config.d.ts +1 -1
- package/models/seriesType/line.d.ts +1 -1
- package/models/seriesType/pie.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +1 -6
- package/modern/BarChart/BarChart.js +9 -29
- package/modern/BarChart/BarPlot.js +12 -4
- package/modern/BarChart/extremums.js +3 -3
- package/modern/BarChart/useBarChartProps.js +3 -4
- package/modern/ChartContainer/ChartContainer.js +24 -41
- package/modern/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/modern/ChartContainer/useChartContainerProps.js +42 -58
- package/modern/ChartsLegend/ChartsLegend.js +0 -3
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/modern/ChartsTooltip/ChartsTooltip.js +45 -6
- package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
- package/modern/ChartsTooltip/useItemTooltip.js +3 -3
- package/modern/ChartsTooltip/utils.js +45 -42
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/LineChart/AreaPlot.js +2 -6
- package/modern/LineChart/LineChart.js +9 -29
- package/modern/LineChart/LineHighlightPlot.js +2 -6
- package/modern/LineChart/LinePlot.js +2 -6
- package/modern/LineChart/MarkPlot.js +2 -6
- package/modern/LineChart/extremums.js +10 -6
- package/modern/LineChart/useLineChartProps.js +3 -4
- package/modern/PieChart/PieArc.js +1 -10
- package/modern/PieChart/PieArcPlot.js +0 -5
- package/modern/PieChart/PieChart.js +19 -102
- package/modern/ScatterChart/ScatterChart.js +9 -29
- package/modern/ScatterChart/ScatterPlot.js +3 -6
- package/modern/ScatterChart/extremums.js +6 -6
- package/modern/ScatterChart/useScatterChartProps.js +3 -4
- package/modern/SparkLineChart/SparkLineChart.js +4 -2
- package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +48 -27
- package/modern/context/ChartDataProvider/index.js +1 -0
- package/modern/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
- package/modern/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/modern/index.js +2 -3
- package/modern/internals/computeAxisValue.js +13 -5
- package/modern/internals/getSymbol.js +19 -3
- package/modern/internals/index.js +5 -5
- package/modern/internals/useStringInterpolator.js +1 -0
- package/node/BarChart/BarChart.js +9 -29
- package/node/BarChart/BarPlot.js +11 -3
- package/node/BarChart/extremums.js +3 -3
- package/node/BarChart/useBarChartProps.js +3 -4
- package/node/ChartContainer/ChartContainer.js +23 -40
- package/node/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
- package/node/ChartContainer/useChartContainerProps.js +42 -59
- package/node/ChartsLegend/ChartsLegend.js +0 -3
- package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
- package/node/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
- package/node/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
- package/node/ChartsTooltip/ChartsTooltip.js +44 -5
- package/node/ChartsTooltip/useAxisTooltip.js +3 -3
- package/node/ChartsTooltip/useItemTooltip.js +3 -3
- package/node/ChartsTooltip/utils.js +46 -44
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
- package/node/Gauge/GaugeContainer.js +1 -1
- package/node/LineChart/AreaPlot.js +2 -6
- package/node/LineChart/LineChart.js +9 -29
- package/node/LineChart/LineHighlightPlot.js +2 -6
- package/node/LineChart/LinePlot.js +2 -6
- package/node/LineChart/MarkPlot.js +2 -6
- package/node/LineChart/extremums.js +10 -6
- package/node/LineChart/useLineChartProps.js +3 -4
- package/node/PieChart/PieArc.js +1 -10
- package/node/PieChart/PieArcPlot.js +0 -5
- package/node/PieChart/PieChart.js +19 -102
- package/node/ScatterChart/ScatterChart.js +9 -29
- package/node/ScatterChart/ScatterPlot.js +3 -6
- package/node/ScatterChart/extremums.js +6 -6
- package/node/ScatterChart/useScatterChartProps.js +3 -4
- package/node/SparkLineChart/SparkLineChart.js +4 -2
- package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +47 -26
- package/node/context/ChartDataProvider/index.js +16 -0
- package/node/context/ChartDataProvider/useChartDataProviderProps.js +94 -0
- package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
- package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
- package/node/index.js +5 -16
- package/node/internals/computeAxisValue.js +13 -5
- package/node/internals/getSymbol.js +19 -3
- package/node/internals/index.js +37 -29
- package/node/internals/useStringInterpolator.js +2 -0
- package/package.json +4 -4
- package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
- package/ResponsiveChartContainer/index.d.ts +0 -1
- package/ResponsiveChartContainer/index.js +0 -1
- package/ResponsiveChartContainer/package.json +0 -6
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
- package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/internals/SlotComponentPropsFromProps.d.ts +0 -1
- package/internals/SlotComponentPropsFromProps.js +0 -1
- package/models/helpers.d.ts +0 -3
- package/models/helpers.js +0 -1
- package/modern/ResponsiveChartContainer/index.js +0 -1
- package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
- package/modern/internals/SlotComponentPropsFromProps.js +0 -1
- package/modern/models/helpers.js +0 -1
- package/node/ResponsiveChartContainer/index.js +0 -16
- package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
- package/node/internals/SlotComponentPropsFromProps.js +0 -5
- package/node/models/helpers.js +0 -5
- /package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
- /package/modern/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
- /package/node/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ChartsSurfaceProps } from '../ChartsSurface';
|
|
5
|
-
import { CartesianProviderProps } from '../context/CartesianProvider';
|
|
6
|
-
import { HighlightedProviderProps, ZAxisContextProviderProps } from '../context';
|
|
7
|
-
import { PluginProviderProps } from '../context/PluginProvider';
|
|
8
|
-
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
|
|
9
|
-
import { MakeOptional } from '../models/helpers';
|
|
10
|
-
import { AnimationProviderProps } from '../context/AnimationProvider';
|
|
11
|
-
export type ChartContainerProps = Omit<ChartsSurfaceProps & Omit<SeriesProviderProps, 'seriesFormatters'> & Omit<DrawingProviderProps, 'svgRef'> & Pick<CartesianProviderProps, 'dataset'> & ZAxisContextProviderProps & HighlightedProviderProps & PluginProviderProps & AnimationProviderProps, 'children'> & {
|
|
2
|
+
import { ChartDataProviderProps } from '../context/ChartDataProvider';
|
|
3
|
+
export interface ChartContainerProps extends Omit<ChartDataProviderProps, 'width' | 'height'> {
|
|
12
4
|
/**
|
|
13
|
-
* The
|
|
14
|
-
* If not provided, a default axis config is used.
|
|
15
|
-
* An array of [[AxisConfig]] objects.
|
|
5
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
16
6
|
*/
|
|
17
|
-
|
|
7
|
+
width?: number;
|
|
18
8
|
/**
|
|
19
|
-
* The
|
|
20
|
-
* If not provided, a default axis config is used.
|
|
21
|
-
* An array of [[AxisConfig]] objects.
|
|
9
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
22
10
|
*/
|
|
23
|
-
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
};
|
|
26
|
-
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<ChartsSurfaceProps & Omit<SeriesProviderProps, "seriesFormatters"> & Omit<DrawingProviderProps, "svgRef"> & Pick<CartesianProviderProps, "dataset"> & ZAxisContextProviderProps & HighlightedProviderProps & PluginProviderProps & AnimationProviderProps, "children"> & {
|
|
11
|
+
height?: number;
|
|
27
12
|
/**
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
*
|
|
13
|
+
* The chart will try to wait for the parent container to resolve its size
|
|
14
|
+
* before it renders for the first time.
|
|
15
|
+
*
|
|
16
|
+
* This can be useful in some scenarios where the chart appear to grow after
|
|
17
|
+
* the first render, like when used inside a grid.
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
31
20
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* If not provided, a default axis config is used.
|
|
36
|
-
* An array of [[AxisConfig]] objects.
|
|
37
|
-
*/
|
|
38
|
-
yAxis?: MakeOptional<AxisConfig<ScaleName, any, ChartsYAxisProps>, "id">[];
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
} & React.RefAttributes<unknown>>;
|
|
21
|
+
resolveSizeBeforeRender?: boolean;
|
|
22
|
+
}
|
|
23
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<ChartContainerProps & React.RefAttributes<SVGSVGElement>>;
|
|
41
24
|
export { ChartContainer };
|
|
@@ -3,47 +3,18 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { InteractionProvider } from "../context/InteractionProvider.js";
|
|
9
|
-
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
10
|
-
import { CartesianProvider } from "../context/CartesianProvider/index.js";
|
|
11
|
-
import { ChartsAxesGradients } from "../internals/components/ChartsAxesGradients/index.js";
|
|
12
|
-
import { HighlightedProvider, ZAxisContextProvider } from "../context/index.js";
|
|
13
|
-
import { PluginProvider } from "../context/PluginProvider/index.js";
|
|
6
|
+
import { ChartDataProvider } from "../context/ChartDataProvider/index.js";
|
|
7
|
+
import { ResizableContainer } from "./ResizableContainer.js";
|
|
14
8
|
import { useChartContainerProps } from "./useChartContainerProps.js";
|
|
15
|
-
import {
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
10
|
const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
18
11
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
cartesianProviderProps,
|
|
23
|
-
zAxisContextProps,
|
|
24
|
-
highlightedProviderProps,
|
|
25
|
-
chartsSurfaceProps,
|
|
26
|
-
pluginProviderProps,
|
|
27
|
-
animationProviderProps
|
|
12
|
+
hasIntrinsicSize,
|
|
13
|
+
chartDataProviderProps,
|
|
14
|
+
resizableChartContainerProps
|
|
28
15
|
} = useChartContainerProps(props, ref);
|
|
29
|
-
return /*#__PURE__*/_jsx(
|
|
30
|
-
children: /*#__PURE__*/_jsx(
|
|
31
|
-
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
32
|
-
children: /*#__PURE__*/_jsx(CartesianProvider, _extends({}, cartesianProviderProps, {
|
|
33
|
-
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
34
|
-
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
35
|
-
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
36
|
-
children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
37
|
-
children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
|
|
38
|
-
children: children
|
|
39
|
-
}))]
|
|
40
|
-
}))
|
|
41
|
-
}))
|
|
42
|
-
})
|
|
43
|
-
}))
|
|
44
|
-
}))
|
|
45
|
-
}))
|
|
46
|
-
}))
|
|
16
|
+
return /*#__PURE__*/_jsx(ResizableContainer, _extends({}, resizableChartContainerProps, {
|
|
17
|
+
children: hasIntrinsicSize ? /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps)) : null
|
|
47
18
|
}));
|
|
48
19
|
});
|
|
49
20
|
process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
@@ -70,9 +41,9 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
70
41
|
*/
|
|
71
42
|
disableAxisListener: PropTypes.bool,
|
|
72
43
|
/**
|
|
73
|
-
* The height of the chart in px.
|
|
44
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
74
45
|
*/
|
|
75
|
-
height: PropTypes.number
|
|
46
|
+
height: PropTypes.number,
|
|
76
47
|
/**
|
|
77
48
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
78
49
|
*/
|
|
@@ -103,6 +74,16 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
103
74
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
104
75
|
*/
|
|
105
76
|
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
77
|
+
/**
|
|
78
|
+
* The chart will try to wait for the parent container to resolve its size
|
|
79
|
+
* before it renders for the first time.
|
|
80
|
+
*
|
|
81
|
+
* This can be useful in some scenarios where the chart appear to grow after
|
|
82
|
+
* the first render, like when used inside a grid.
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
resolveSizeBeforeRender: PropTypes.bool,
|
|
106
87
|
/**
|
|
107
88
|
* The array of series to display.
|
|
108
89
|
* Each type of series has its own specificity.
|
|
@@ -123,9 +104,9 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
123
104
|
y: PropTypes.number
|
|
124
105
|
}),
|
|
125
106
|
/**
|
|
126
|
-
* The width of the chart in px.
|
|
107
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
127
108
|
*/
|
|
128
|
-
width: PropTypes.number
|
|
109
|
+
width: PropTypes.number,
|
|
129
110
|
/**
|
|
130
111
|
* The configuration of the x-axes.
|
|
131
112
|
* If not provided, a default axis config is used.
|
|
@@ -152,6 +133,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
152
133
|
dataKey: PropTypes.string,
|
|
153
134
|
disableLine: PropTypes.bool,
|
|
154
135
|
disableTicks: PropTypes.bool,
|
|
136
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
155
137
|
fill: PropTypes.string,
|
|
156
138
|
hideTooltip: PropTypes.bool,
|
|
157
139
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -205,6 +187,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
205
187
|
dataKey: PropTypes.string,
|
|
206
188
|
disableLine: PropTypes.bool,
|
|
207
189
|
disableTicks: PropTypes.bool,
|
|
190
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
208
191
|
fill: PropTypes.string,
|
|
209
192
|
hideTooltip: PropTypes.bool,
|
|
210
193
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartContainerProps } from './ChartContainer';
|
|
2
2
|
/**
|
|
3
3
|
* Wrapping div that take the shape of its parent.
|
|
4
4
|
*
|
|
5
5
|
* @ignore - do not document.
|
|
6
6
|
*/
|
|
7
7
|
export declare const ResizableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
|
-
ownerState: Pick<
|
|
8
|
+
ownerState: Pick<ChartContainerProps, "width" | "height">;
|
|
9
9
|
}, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare const useChartContainerDimensions: (inWidth?: number, inHeight?: number, resolveSizeBeforeRender?: boolean) => {
|
|
3
|
-
containerRef: React.
|
|
3
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
6
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
/* eslint-disable react-compiler/react-compiler */
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
6
|
import ownerWindow from '@mui/utils/ownerWindow';
|
|
6
7
|
export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBeforeRender) => {
|
|
8
|
+
const hasInSize = inWidth !== undefined && inHeight !== undefined;
|
|
7
9
|
const stateRef = React.useRef({
|
|
8
10
|
displayError: false,
|
|
9
11
|
initialCompute: true,
|
|
@@ -40,7 +42,7 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
40
42
|
// https://github.com/mui/mui-x/issues/13477#issuecomment-2336634785
|
|
41
43
|
useEnhancedEffect(() => {
|
|
42
44
|
// computeRun is used to avoid infinite loops.
|
|
43
|
-
if (!resolveSizeBeforeRender || !stateRef.current.initialCompute || stateRef.current.computeRun > 20) {
|
|
45
|
+
if (hasInSize || !resolveSizeBeforeRender || !stateRef.current.initialCompute || stateRef.current.computeRun > 20) {
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
48
|
const computedSize = computeSize();
|
|
@@ -49,9 +51,9 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
49
51
|
} else if (stateRef.current.initialCompute) {
|
|
50
52
|
stateRef.current.initialCompute = false;
|
|
51
53
|
}
|
|
52
|
-
}, [width, height, computeSize, resolveSizeBeforeRender]);
|
|
54
|
+
}, [width, height, computeSize, resolveSizeBeforeRender, hasInSize]);
|
|
53
55
|
useEnhancedEffect(() => {
|
|
54
|
-
if (
|
|
56
|
+
if (hasInSize) {
|
|
55
57
|
return () => {};
|
|
56
58
|
}
|
|
57
59
|
computeSize();
|
|
@@ -77,7 +79,7 @@ export const useChartContainerDimensions = (inWidth, inHeight, resolveSizeBefore
|
|
|
77
79
|
observer.unobserve(elementToObserve);
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
|
-
}, [computeSize,
|
|
82
|
+
}, [computeSize, hasInSize]);
|
|
81
83
|
if (process.env.NODE_ENV !== 'production') {
|
|
82
84
|
if (stateRef.current.displayError && inWidth === undefined && width === 0) {
|
|
83
85
|
console.error(`MUI X: ChartContainer does not have \`width\` prop, and its container has no \`width\` defined.`);
|
|
@@ -1,89 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { DrawingProviderProps } from '../context/DrawingProvider';
|
|
3
|
-
import type { CartesianProviderProps } from '../context/CartesianProvider';
|
|
4
|
-
import type { SeriesProviderProps } from '../context/SeriesProvider';
|
|
5
|
-
import type { ZAxisContextProviderProps } from '../context/ZAxisContextProvider';
|
|
1
|
+
import { ChartDataProviderProps } from '../context/ChartDataProvider';
|
|
6
2
|
import type { ChartContainerProps } from './ChartContainer';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
zAxisContextProps: Omit<ZAxisContextProviderProps, "children">;
|
|
17
|
-
highlightedProviderProps: Omit<HighlightedProviderProps, "children">;
|
|
18
|
-
chartsSurfaceProps: ChartsSurfaceProps & {
|
|
19
|
-
ref: any;
|
|
3
|
+
export type UseChartContainerPropsReturnValue = {
|
|
4
|
+
hasIntrinsicSize: boolean;
|
|
5
|
+
chartDataProviderProps: ChartDataProviderProps;
|
|
6
|
+
resizableChartContainerProps: {
|
|
7
|
+
ownerState: {
|
|
8
|
+
width: ChartContainerProps['width'];
|
|
9
|
+
height: ChartContainerProps['height'];
|
|
10
|
+
};
|
|
11
|
+
ref: React.Ref<HTMLDivElement>;
|
|
20
12
|
};
|
|
21
|
-
pluginProviderProps: Omit<PluginProviderProps, "children">;
|
|
22
|
-
animationProviderProps: Omit<AnimationProviderProps, "children">;
|
|
23
|
-
xAxis: {
|
|
24
|
-
reverse?: boolean | undefined;
|
|
25
|
-
fill?: string | undefined;
|
|
26
|
-
stroke?: string | undefined;
|
|
27
|
-
data?: any[] | undefined;
|
|
28
|
-
label?: string | undefined;
|
|
29
|
-
max?: (number | Date) | undefined;
|
|
30
|
-
min?: (number | Date) | undefined;
|
|
31
|
-
valueFormatter?: ((value: any, context: import("../internals").AxisValueFormatterContext) => string) | undefined;
|
|
32
|
-
dataKey?: string | undefined;
|
|
33
|
-
sx?: import("@mui/system").SxProps | undefined;
|
|
34
|
-
classes?: Partial<import("..").ChartsAxisClasses> | undefined;
|
|
35
|
-
tickMaxStep?: number | undefined;
|
|
36
|
-
tickMinStep?: number | undefined;
|
|
37
|
-
tickNumber?: number | undefined;
|
|
38
|
-
disableLine?: boolean | undefined;
|
|
39
|
-
disableTicks?: boolean | undefined;
|
|
40
|
-
tickFontSize?: number | undefined;
|
|
41
|
-
tickLabelStyle?: import("..").ChartsTextProps["style"];
|
|
42
|
-
labelStyle?: import("..").ChartsTextProps["style"];
|
|
43
|
-
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
44
|
-
labelFontSize?: number | undefined;
|
|
45
|
-
tickSize?: number | undefined;
|
|
46
|
-
slots?: Partial<import("../internals").ChartsAxisSlots> | undefined;
|
|
47
|
-
slotProps?: Partial<import("../internals").ChartsAxisSlotProps> | undefined;
|
|
48
|
-
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
49
|
-
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
50
|
-
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
51
|
-
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
52
|
-
colorMap?: import("../models/colorMapping").ContinuousColorConfig<number | Date> | import("../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
53
|
-
hideTooltip?: boolean | undefined;
|
|
54
|
-
id: import("../internals").AxisId;
|
|
55
|
-
}[];
|
|
56
|
-
yAxis: {
|
|
57
|
-
reverse?: boolean | undefined;
|
|
58
|
-
fill?: string | undefined;
|
|
59
|
-
stroke?: string | undefined;
|
|
60
|
-
data?: any[] | undefined;
|
|
61
|
-
label?: string | undefined;
|
|
62
|
-
max?: (number | Date) | undefined;
|
|
63
|
-
min?: (number | Date) | undefined;
|
|
64
|
-
valueFormatter?: ((value: any, context: import("../internals").AxisValueFormatterContext) => string) | undefined;
|
|
65
|
-
dataKey?: string | undefined;
|
|
66
|
-
sx?: import("@mui/system").SxProps | undefined;
|
|
67
|
-
classes?: Partial<import("..").ChartsAxisClasses> | undefined;
|
|
68
|
-
tickMaxStep?: number | undefined;
|
|
69
|
-
tickMinStep?: number | undefined;
|
|
70
|
-
tickNumber?: number | undefined;
|
|
71
|
-
disableLine?: boolean | undefined;
|
|
72
|
-
disableTicks?: boolean | undefined;
|
|
73
|
-
tickFontSize?: number | undefined;
|
|
74
|
-
tickLabelStyle?: import("..").ChartsTextProps["style"];
|
|
75
|
-
labelStyle?: import("..").ChartsTextProps["style"];
|
|
76
|
-
tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
|
|
77
|
-
labelFontSize?: number | undefined;
|
|
78
|
-
tickSize?: number | undefined;
|
|
79
|
-
slots?: Partial<import("../internals").ChartsAxisSlots> | undefined;
|
|
80
|
-
slotProps?: Partial<import("../internals").ChartsAxisSlotProps> | undefined;
|
|
81
|
-
tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
|
|
82
|
-
tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
|
|
83
|
-
tickLabelPlacement?: ("middle" | "tick") | undefined;
|
|
84
|
-
scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
|
|
85
|
-
colorMap?: import("../models/colorMapping").ContinuousColorConfig<number | Date> | import("../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
86
|
-
hideTooltip?: boolean | undefined;
|
|
87
|
-
id: import("../internals").AxisId;
|
|
88
|
-
}[];
|
|
89
13
|
};
|
|
14
|
+
export declare const useChartContainerProps: (props: ChartContainerProps, ref: React.Ref<SVGSVGElement>) => UseChartContainerPropsReturnValue;
|
|
@@ -2,85 +2,69 @@
|
|
|
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 = ["width", "height", "
|
|
6
|
-
import
|
|
7
|
-
import useForkRef from '@mui/utils/useForkRef';
|
|
8
|
-
import { useDefaultizeAxis } from "./useDefaultizeAxis.js";
|
|
5
|
+
const _excluded = ["width", "height", "resolveSizeBeforeRender", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "viewBox", "xAxis", "yAxis", "zAxis", "skipAnimation"];
|
|
6
|
+
import { useChartContainerDimensions } from "./useChartContainerDimensions.js";
|
|
9
7
|
export const useChartContainerProps = (props, ref) => {
|
|
10
8
|
const {
|
|
11
9
|
width,
|
|
12
10
|
height,
|
|
13
|
-
|
|
11
|
+
resolveSizeBeforeRender,
|
|
14
12
|
margin,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
zAxis,
|
|
13
|
+
children,
|
|
14
|
+
series,
|
|
18
15
|
colors,
|
|
19
16
|
dataset,
|
|
20
|
-
sx,
|
|
21
|
-
title,
|
|
22
17
|
desc,
|
|
23
18
|
disableAxisListener,
|
|
24
19
|
highlightedItem,
|
|
25
20
|
onHighlightChange,
|
|
26
21
|
plugins,
|
|
27
|
-
|
|
22
|
+
sx,
|
|
23
|
+
title,
|
|
24
|
+
viewBox,
|
|
25
|
+
xAxis,
|
|
26
|
+
yAxis,
|
|
27
|
+
zAxis,
|
|
28
28
|
skipAnimation
|
|
29
29
|
} = props,
|
|
30
30
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const {
|
|
32
|
+
containerRef,
|
|
33
|
+
width: dWidth,
|
|
34
|
+
height: dHeight
|
|
35
|
+
} = useChartContainerDimensions(width, height, resolveSizeBeforeRender);
|
|
36
|
+
const resizableChartContainerProps = _extends({}, other, {
|
|
37
|
+
ownerState: {
|
|
38
|
+
width,
|
|
39
|
+
height
|
|
40
|
+
},
|
|
41
|
+
ref: containerRef
|
|
42
|
+
});
|
|
43
|
+
const chartDataProviderProps = {
|
|
37
44
|
margin,
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
const animationProviderProps = {
|
|
41
|
-
skipAnimation
|
|
42
|
-
};
|
|
43
|
-
const pluginProviderProps = {
|
|
44
|
-
plugins
|
|
45
|
-
};
|
|
46
|
-
const seriesProviderProps = {
|
|
45
|
+
children,
|
|
47
46
|
series,
|
|
48
47
|
colors,
|
|
49
|
-
dataset
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
xAxis: defaultizedXAxis,
|
|
53
|
-
yAxis: defaultizedYAxis,
|
|
54
|
-
dataset
|
|
55
|
-
};
|
|
56
|
-
const zAxisContextProps = {
|
|
57
|
-
zAxis,
|
|
58
|
-
dataset
|
|
59
|
-
};
|
|
60
|
-
const highlightedProviderProps = {
|
|
48
|
+
dataset,
|
|
49
|
+
desc,
|
|
50
|
+
disableAxisListener,
|
|
61
51
|
highlightedItem,
|
|
62
|
-
onHighlightChange
|
|
63
|
-
|
|
64
|
-
const chartsSurfaceProps = _extends({}, other, {
|
|
65
|
-
width,
|
|
66
|
-
height,
|
|
67
|
-
ref: chartSurfaceRef,
|
|
52
|
+
onHighlightChange,
|
|
53
|
+
plugins,
|
|
68
54
|
sx,
|
|
69
55
|
title,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
56
|
+
viewBox,
|
|
57
|
+
xAxis,
|
|
58
|
+
yAxis,
|
|
59
|
+
zAxis,
|
|
60
|
+
skipAnimation,
|
|
61
|
+
width: dWidth,
|
|
62
|
+
height: dHeight,
|
|
63
|
+
ref
|
|
64
|
+
};
|
|
73
65
|
return {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
cartesianProviderProps,
|
|
78
|
-
zAxisContextProps,
|
|
79
|
-
highlightedProviderProps,
|
|
80
|
-
chartsSurfaceProps,
|
|
81
|
-
pluginProviderProps,
|
|
82
|
-
animationProviderProps,
|
|
83
|
-
xAxis: defaultizedXAxis,
|
|
84
|
-
yAxis: defaultizedYAxis
|
|
66
|
+
hasIntrinsicSize: Boolean(dWidth && dHeight),
|
|
67
|
+
chartDataProviderProps,
|
|
68
|
+
resizableChartContainerProps
|
|
85
69
|
};
|
|
86
70
|
};
|
|
@@ -11,7 +11,6 @@ import { useThemeProps, useTheme } from '@mui/material/styles';
|
|
|
11
11
|
import { getSeriesToDisplay } from "./utils.js";
|
|
12
12
|
import { getLegendUtilityClass } from "./chartsLegendClasses.js";
|
|
13
13
|
import { DefaultChartsLegend } from "./DefaultChartsLegend.js";
|
|
14
|
-
import { useDrawingArea } from "../hooks/index.js";
|
|
15
14
|
import { useSeries } from "../hooks/useSeries.js";
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
const useUtilityClasses = ownerState => {
|
|
@@ -50,7 +49,6 @@ function ChartsLegend(inProps) {
|
|
|
50
49
|
const classes = useUtilityClasses(_extends({}, defaultizedProps, {
|
|
51
50
|
theme
|
|
52
51
|
}));
|
|
53
|
-
const drawingArea = useDrawingArea();
|
|
54
52
|
const series = useSeries();
|
|
55
53
|
const seriesToDisplay = getSeriesToDisplay(series);
|
|
56
54
|
const ChartLegendRender = slots?.legend ?? DefaultChartsLegend;
|
|
@@ -59,7 +57,6 @@ function ChartsLegend(inProps) {
|
|
|
59
57
|
externalSlotProps: slotProps?.legend,
|
|
60
58
|
additionalProps: _extends({}, other, {
|
|
61
59
|
classes,
|
|
62
|
-
drawingArea,
|
|
63
60
|
series,
|
|
64
61
|
seriesToDisplay
|
|
65
62
|
}),
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FormattedSeries } from '../context/SeriesProvider';
|
|
3
3
|
import { LegendPerItemProps } from './LegendPerItem';
|
|
4
|
-
import { DrawingArea } from '../context/DrawingProvider';
|
|
5
4
|
import { SeriesLegendItemContext } from './chartsLegend.types';
|
|
6
5
|
export interface LegendRendererProps extends Omit<LegendPerItemProps, 'itemsToDisplay' | 'onItemClick'> {
|
|
7
6
|
series: FormattedSeries;
|
|
8
7
|
seriesToDisplay: LegendPerItemProps['itemsToDisplay'];
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use the `useDrawingArea` hook instead.
|
|
11
|
-
*/
|
|
12
|
-
drawingArea: Omit<DrawingArea, 'isPointInside'>;
|
|
13
8
|
/**
|
|
14
9
|
* Callback fired when a legend item is clicked.
|
|
15
10
|
* @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
|
|
@@ -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 = ["
|
|
5
|
+
const _excluded = ["seriesToDisplay", "hidden", "onItemClick"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { LegendPerItem } from "./LegendPerItem.js";
|
|
@@ -43,17 +43,6 @@ process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
|
43
43
|
* The default depends on the chart.
|
|
44
44
|
*/
|
|
45
45
|
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated Use the `useDrawingArea` hook instead.
|
|
48
|
-
*/
|
|
49
|
-
drawingArea: PropTypes.shape({
|
|
50
|
-
bottom: PropTypes.number.isRequired,
|
|
51
|
-
height: PropTypes.number.isRequired,
|
|
52
|
-
left: PropTypes.number.isRequired,
|
|
53
|
-
right: PropTypes.number.isRequired,
|
|
54
|
-
top: PropTypes.number.isRequired,
|
|
55
|
-
width: PropTypes.number.isRequired
|
|
56
|
-
}).isRequired,
|
|
57
46
|
/**
|
|
58
47
|
* Set to true to hide the legend.
|
|
59
48
|
* @default false
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
3
|
import { DrawingArea } from '../context/DrawingProvider';
|
|
3
4
|
import { ChartsTextStyle } from '../ChartsText';
|
|
4
5
|
import { CardinalDirections } from '../models/layout';
|
|
5
6
|
import { LegendItemParams } from './chartsLegend.types';
|
|
6
7
|
import { AnchorPosition, Direction, LegendPlacement } from './legend.types';
|
|
7
8
|
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
8
|
-
import { DefaultizedProps } from '../models/helpers';
|
|
9
9
|
export type ChartsLegendRootOwnerState = {
|
|
10
10
|
position: AnchorPosition;
|
|
11
11
|
direction: Direction;
|
|
@@ -39,8 +39,8 @@ function ChartsOnAxisClickHandler(props) {
|
|
|
39
39
|
Object.keys(series).filter(seriesType => ['bar', 'line'].includes(seriesType)).forEach(seriesType => {
|
|
40
40
|
series[seriesType]?.seriesOrder.forEach(seriesId => {
|
|
41
41
|
const seriesItem = series[seriesType].series[seriesId];
|
|
42
|
-
const providedXAxisId = seriesItem.xAxisId
|
|
43
|
-
const providedYAxisId = seriesItem.yAxisId
|
|
42
|
+
const providedXAxisId = seriesItem.xAxisId;
|
|
43
|
+
const providedYAxisId = seriesItem.yAxisId;
|
|
44
44
|
const axisKey = isXaxis ? providedXAxisId : providedYAxisId;
|
|
45
45
|
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
46
46
|
seriesValues[seriesId] = seriesItem.data[dataIndex];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
-
import { SlotComponentPropsFromProps } from '
|
|
3
|
+
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
|
|
4
4
|
export declare function useNoData(): boolean;
|
|
5
5
|
export type CommonOverlayProps = React.SVGAttributes<SVGTextElement> & {
|
|
6
6
|
/**
|
|
@@ -40,14 +40,14 @@ function ChartsAxisTooltipContent(props) {
|
|
|
40
40
|
Object.keys(series).filter(isCartesianSeriesType).forEach(seriesType => {
|
|
41
41
|
series[seriesType].seriesOrder.forEach(seriesId => {
|
|
42
42
|
const item = series[seriesType].series[seriesId];
|
|
43
|
-
const providedXAxisId = item.xAxisId
|
|
44
|
-
const providedYAxisId = item.yAxisId
|
|
43
|
+
const providedXAxisId = item.xAxisId;
|
|
44
|
+
const providedYAxisId = item.yAxisId;
|
|
45
45
|
const axisKey = isXaxis ? providedXAxisId : providedYAxisId;
|
|
46
46
|
if (axisKey === undefined || axisKey === USED_AXIS_ID) {
|
|
47
47
|
const seriesToAdd = series[seriesType].series[seriesId];
|
|
48
48
|
const xAxisId = providedXAxisId ?? xAxisIds[0];
|
|
49
49
|
const yAxisId = providedYAxisId ?? yAxisIds[0];
|
|
50
|
-
const zAxisId = seriesToAdd.zAxisId ??
|
|
50
|
+
const zAxisId = seriesToAdd.zAxisId ?? zAxisIds[0];
|
|
51
51
|
const getColor = colorProcessors[seriesType]?.(seriesToAdd, xAxis[xAxisId], yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
|
|
52
52
|
rep.push(_extends({}, seriesToAdd, {
|
|
53
53
|
getColor
|
|
@@ -30,9 +30,9 @@ function ChartsItemTooltipContent(props) {
|
|
|
30
30
|
zAxisIds
|
|
31
31
|
} = React.useContext(ZAxisContext);
|
|
32
32
|
const colorProcessors = useColorProcessor();
|
|
33
|
-
const xAxisId = series.xAxisId ??
|
|
34
|
-
const yAxisId = series.yAxisId ??
|
|
35
|
-
const zAxisId = series.zAxisId ??
|
|
33
|
+
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
34
|
+
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
35
|
+
const zAxisId = series.zAxisId ?? zAxisIds[0];
|
|
36
36
|
const getColor = colorProcessors[series.type]?.(series, xAxisId && xAxis[xAxisId], yAxisId && yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
|
|
37
37
|
const Content = content ?? DefaultChartsItemTooltipContent;
|
|
38
38
|
const chartTooltipContentProps = useSlotProps({
|