Skip to content

Commit

Permalink
[charts][docs] Fix wrong props warnings (mui#16119)
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas authored Jan 10, 2025
1 parent 7541f95 commit 5999d29
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 18 deletions.
3 changes: 0 additions & 3 deletions docs/data/charts/axis/CustomDomainYAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';

const settings = {
valueFormatter: (value) => `${value}%`,
height: 200,
showTooltip: true,
showHighlight: true,
series: [{ data: [60, -15, 66, 68, 87, 82, 83, 85, 92, 75, 76, 50, 91] }],
margin: { top: 10, bottom: 20 },
};
Expand Down
7 changes: 2 additions & 5 deletions docs/data/charts/axis/CustomDomainYAxis.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { BarChart } from '@mui/x-charts/BarChart';
import { BarChart, BarChartProps } from '@mui/x-charts/BarChart';
import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';

const settings = {
valueFormatter: (value: number | null) => `${value}%`,
const settings: BarChartProps = {
height: 200,
showTooltip: true,
showHighlight: true,
series: [{ data: [60, -15, 66, 68, 87, 82, 83, 85, 92, 75, 76, 50, 91] }],
margin: { top: 10, bottom: 20 },
};
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/styling/ColorTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const legendPlacement = {
horizontal: 'right',
},
direction: 'vertical',
itemGap: 2,
},
},
margin: {
Expand Down
7 changes: 3 additions & 4 deletions docs/data/charts/styling/ColorTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { ScatterChart } from '@mui/x-charts/ScatterChart';
import { ScatterChart, ScatterChartProps } from '@mui/x-charts/ScatterChart';
import { ScatterValueType } from '@mui/x-charts/models';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
Expand Down Expand Up @@ -29,23 +29,22 @@ function getGaussianSeriesData(
});
}

const legendPlacement = {
const legendPlacement: Partial<ScatterChartProps> = {
slotProps: {
legend: {
position: {
vertical: 'middle',
horizontal: 'right',
},
direction: 'vertical',
itemGap: 2,
},
},
margin: {
top: 20,
right: 20,
left: 30,
},
} as const;
};
const series = [
{ label: 'Series 1', data: getGaussianSeriesData([-5, 0]) },
{ label: 'Series 2', data: getGaussianSeriesData([-4, 0]) },
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/styling/MuiColorTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const legendPlacement = {
slotProps: {
legend: {
direction: 'vertical',
itemGap: 2,
},
},
margin: {
Expand Down
7 changes: 3 additions & 4 deletions docs/data/charts/styling/MuiColorTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Button from '@mui/material/Button';
import Brightness4Icon from '@mui/icons-material/Brightness4';
import Brightness7Icon from '@mui/icons-material/Brightness7';
import { Chance } from 'chance';
import { ScatterChart } from '@mui/x-charts/ScatterChart';
import { ScatterChart, ScatterChartProps } from '@mui/x-charts/ScatterChart';
import { ScatterValueType } from '@mui/x-charts/models';
import {
blueberryTwilightPalette,
Expand Down Expand Up @@ -39,18 +39,17 @@ function getGaussianSeriesData(
});
}

const legendPlacement = {
const legendPlacement: Partial<ScatterChartProps> = {
slotProps: {
legend: {
direction: 'vertical',
itemGap: 2,
},
},
margin: {
top: 20,
right: 20,
},
} as const;
};

const series = [
{ label: 'Series 1', data: getGaussianSeriesData([-5, 0]) },
Expand Down

0 comments on commit 5999d29

Please sign in to comment.