Skip to content

Commit

Permalink
[docs] Fix remaining charts demos on mobile (#16728)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette authored Feb 25, 2025
1 parent c8b9ba4 commit d697a17
Show file tree
Hide file tree
Showing 53 changed files with 481 additions and 1,111 deletions.
5 changes: 2 additions & 3 deletions docs/data/charts/composition/BasicComposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function BasicComposition() {

const sizingProps = isResponsive ? {} : { width: 500, height: 300 };
return (
<Box sx={{ width: '100%' }}>
<Box sx={{ width: '100%', overflow: 'auto' }}>
<FormControlLabel
checked={isResponsive}
control={
Expand All @@ -22,8 +22,7 @@ export default function BasicComposition() {
label="Use responsive container"
labelPlacement="end"
/>
<Paper sx={{ width: '100%', height: 300 }} elevation={3}>
{/* @ts-ignore */}
<Paper sx={{ margin: 1, height: 300 }} elevation={3}>
<ChartContainer
series={[
{
Expand Down
5 changes: 2 additions & 3 deletions docs/data/charts/composition/BasicComposition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function BasicComposition() {

const sizingProps = isResponsive ? {} : { width: 500, height: 300 };
return (
<Box sx={{ width: '100%' }}>
<Box sx={{ width: '100%', overflow: 'auto' }}>
<FormControlLabel
checked={isResponsive}
control={
Expand All @@ -23,8 +23,7 @@ export default function BasicComposition() {
labelPlacement="end"
/>

<Paper sx={{ width: '100%', height: 300 }} elevation={3}>
{/* @ts-ignore */}
<Paper sx={{ margin: 1, height: 300 }} elevation={3}>
<ChartContainer
series={[
{
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/label/BasicLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function BasicLabel() {
}

const props = {
width: 500,
height: 300,
xAxis: [{ data: ['A', 'B', 'C'], scaleType: 'band' }],
};
1 change: 0 additions & 1 deletion docs/data/charts/label/BasicLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function BasicLabel() {
}

const props = {
width: 500,
height: 300,
xAxis: [{ data: ['A', 'B', 'C'], scaleType: 'band' as const }],
};
1 change: 0 additions & 1 deletion docs/data/charts/label/FunctionLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function FunctionLabel() {
}

const props = {
width: 500,
height: 300,
xAxis: [{ data: ['A', 'B', 'C'], scaleType: 'band' }],
};
1 change: 0 additions & 1 deletion docs/data/charts/label/FunctionLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function FunctionLabel() {
}

const props = {
width: 500,
height: 300,
xAxis: [{ data: ['A', 'B', 'C'], scaleType: 'band' as const }],
};
1 change: 0 additions & 1 deletion docs/data/charts/legend/BasicLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function BasicLegend() {
{ type: 'scatter', label: 'Var A', data: data.slice(0, 25) },
{ type: 'scatter', label: 'Var B', data: data.slice(25) },
]}
width={400}
height={300}
/>
);
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/legend/BasicLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default function BasicLegend() {
{ type: 'scatter', label: 'Var A', data: data.slice(0, 25) },
{ type: 'scatter', label: 'Var B', data: data.slice(25) },
]}
width={400}
height={300}
/>
);
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/legend/BasicLegend.tsx.preview
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
{ type: 'scatter', label: 'Var A', data: data.slice(0, 25) },
{ type: 'scatter', label: 'Var B', data: data.slice(25) },
]}
width={400}
height={300}
/>
5 changes: 3 additions & 2 deletions docs/data/charts/pie-demo/PieChartWithPaddingAngle.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const data = [

export default function PieChartWithPaddingAngle() {
return (
<Stack direction="row">
<Stack width="100%" direction="row" flexWrap="wrap">
<PieChart
series={[
{
Expand All @@ -33,11 +33,12 @@ export default function PieChartWithPaddingAngle() {
paddingAngle: 5,
innerRadius: 60,
outerRadius: 80,
cy: '75%',
data,
},
]}
width={200}
height={200}
height={150}
hideLegend
/>
</Stack>
Expand Down
5 changes: 3 additions & 2 deletions docs/data/charts/pie-demo/PieChartWithPaddingAngle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const data = [

export default function PieChartWithPaddingAngle() {
return (
<Stack direction="row">
<Stack width="100%" direction="row" flexWrap="wrap">
<PieChart
series={[
{
Expand All @@ -33,11 +33,12 @@ export default function PieChartWithPaddingAngle() {
paddingAngle: 5,
innerRadius: 60,
outerRadius: 80,
cy: '75%',
data,
},
]}
width={200}
height={200}
height={150}
hideLegend
/>
</Stack>
Expand Down
4 changes: 2 additions & 2 deletions docs/data/charts/pie-demo/StraightAnglePieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function StraightAnglePieChart() {
data,
},
]}
height={300}
width={300}
height={200}
width={200}
/>
);
}
4 changes: 2 additions & 2 deletions docs/data/charts/pie-demo/StraightAnglePieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function StraightAnglePieChart() {
data,
},
]}
height={300}
width={300}
height={200}
width={200}
/>
);
}
4 changes: 2 additions & 2 deletions docs/data/charts/pie-demo/StraightAnglePieChart.tsx.preview
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
data,
},
]}
height={300}
width={300}
height={200}
width={200}
/>
1 change: 0 additions & 1 deletion docs/data/charts/pie-demo/TwoLevelPieChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function TwoLevelPieChart() {
data: data2,
},
]}
width={400}
height={300}
hideLegend
/>
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/pie-demo/TwoLevelPieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default function TwoLevelPieChart() {
data: data2,
},
]}
width={400}
height={300}
hideLegend
/>
Expand Down
16 changes: 16 additions & 0 deletions docs/data/charts/pie-demo/TwoLevelPieChart.tsx.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<PieChart
series={[
{
innerRadius: 0,
outerRadius: 80,
data: data1,
},
{
innerRadius: 100,
outerRadius: 120,
data: data2,
},
]}
height={300}
hideLegend
/>
1 change: 0 additions & 1 deletion docs/data/charts/scatter-demo/MultipleYAxesScatterChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const data2 = [
export default function MultipleYAxesScatterChart() {
return (
<ScatterChart
width={500}
height={300}
series={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const data2 = [
export default function MultipleYAxesScatterChart() {
return (
<ScatterChart
width={500}
height={300}
series={[
{
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/scatter-demo/SimpleScatterChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const data = [
export default function SimpleScatterChart() {
return (
<ScatterChart
width={500}
height={300}
series={[{ data, label: 'pv', id: 'pvId' }]}
xAxis={[{ min: 0 }]}
Expand Down
1 change: 0 additions & 1 deletion docs/data/charts/scatter-demo/SimpleScatterChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const data = [
export default function SimpleScatterChart() {
return (
<ScatterChart
width={500}
height={300}
series={[{ data, label: 'pv', id: 'pvId' }]}
xAxis={[{ min: 0 }]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<ScatterChart
width={500}
height={300}
series={[{ data, label: 'pv', id: 'pvId' }]}
xAxis={[{ min: 0 }]}
Expand Down
Loading

0 comments on commit d697a17

Please sign in to comment.