diff --git a/docs/data/charts/axis/AxisTextCustomizationNoSnap.js b/docs/data/charts/axis/AxisTextCustomizationNoSnap.js index 9f8cc6aa3d6b3..8a6b510e845a3 100644 --- a/docs/data/charts/axis/AxisTextCustomizationNoSnap.js +++ b/docs/data/charts/axis/AxisTextCustomizationNoSnap.js @@ -2,96 +2,11 @@ import * as React from 'react'; import Box from '@mui/material/Box'; import ChartsUsageDemo from 'docsx/src/modules/components/ChartsUsageDemo'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { height: 300, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value) => `${value}mm`; diff --git a/docs/data/charts/axis/GridDemo.js b/docs/data/charts/axis/GridDemo.js index b3eb264c092d5..2bb4bb1219fa8 100644 --- a/docs/data/charts/axis/GridDemo.js +++ b/docs/data/charts/axis/GridDemo.js @@ -2,97 +2,12 @@ import * as React from 'react'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; import { chartsGridClasses } from '@mui/x-charts/ChartsGrid'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { yAxis: [{ label: 'rainfall (mm)' }], height: 300, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value) => `${value}mm`; diff --git a/docs/data/charts/axis/GridDemo.tsx b/docs/data/charts/axis/GridDemo.tsx index 056caeacb5730..3e987f4bc0a58 100644 --- a/docs/data/charts/axis/GridDemo.tsx +++ b/docs/data/charts/axis/GridDemo.tsx @@ -2,97 +2,12 @@ import * as React from 'react'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; import { chartsGridClasses } from '@mui/x-charts/ChartsGrid'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { yAxis: [{ label: 'rainfall (mm)' }], height: 300, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value: number | null) => `${value}mm`; diff --git a/docs/data/charts/bars/BarsDataset.js b/docs/data/charts/bars/BarsDataset.js index f1c7f8cdd6ca0..6ba3112538af8 100644 --- a/docs/data/charts/bars/BarsDataset.js +++ b/docs/data/charts/bars/BarsDataset.js @@ -1,6 +1,7 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; +import { dataset } from '../dataset/weather'; const chartSetting = { yAxis: [ @@ -16,92 +17,6 @@ const chartSetting = { }, }, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value) => `${value}mm`; diff --git a/docs/data/charts/bars/BarsDataset.tsx b/docs/data/charts/bars/BarsDataset.tsx index b03ac258bf589..41acf20266699 100644 --- a/docs/data/charts/bars/BarsDataset.tsx +++ b/docs/data/charts/bars/BarsDataset.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; +import { dataset } from '../dataset/weather'; const chartSetting = { yAxis: [ @@ -16,92 +17,6 @@ const chartSetting = { }, }, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value: number | null) => `${value}mm`; diff --git a/docs/data/charts/bars/GridDemo.js b/docs/data/charts/bars/GridDemo.js index b6861f237d035..6fe95c9414512 100644 --- a/docs/data/charts/bars/GridDemo.js +++ b/docs/data/charts/bars/GridDemo.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { xAxis: [ @@ -10,92 +11,6 @@ const chartSetting = { width: 500, height: 400, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value) => `${value}mm`; diff --git a/docs/data/charts/bars/GridDemo.tsx b/docs/data/charts/bars/GridDemo.tsx index a063c4a8d9cc4..9318c93c1e52b 100644 --- a/docs/data/charts/bars/GridDemo.tsx +++ b/docs/data/charts/bars/GridDemo.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { xAxis: [ @@ -10,92 +11,6 @@ const chartSetting = { width: 500, height: 400, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value: number | null) => `${value}mm`; diff --git a/docs/data/charts/bars/HorizontalBars.js b/docs/data/charts/bars/HorizontalBars.js index 5f15dcbefa11a..d58b2a3145906 100644 --- a/docs/data/charts/bars/HorizontalBars.js +++ b/docs/data/charts/bars/HorizontalBars.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { xAxis: [ @@ -10,92 +11,6 @@ const chartSetting = { width: 500, height: 400, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Feb', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value) => `${value}mm`; diff --git a/docs/data/charts/bars/HorizontalBars.tsx b/docs/data/charts/bars/HorizontalBars.tsx index 14e7fac73e4a3..38ad304c82ba3 100644 --- a/docs/data/charts/bars/HorizontalBars.tsx +++ b/docs/data/charts/bars/HorizontalBars.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { BarChart } from '@mui/x-charts/BarChart'; +import { dataset } from '../dataset/weather'; const chartSetting = { xAxis: [ @@ -10,92 +11,6 @@ const chartSetting = { width: 500, height: 400, }; -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Feb', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; const valueFormatter = (value: number | null) => `${value}mm`; diff --git a/docs/data/charts/bars/TickPlacementBars.js b/docs/data/charts/bars/TickPlacementBars.js index df201e0c5943c..6a08bef3a7c9d 100644 --- a/docs/data/charts/bars/TickPlacementBars.js +++ b/docs/data/charts/bars/TickPlacementBars.js @@ -7,6 +7,7 @@ import FormControlLabel from '@mui/material/FormControlLabel'; import Radio from '@mui/material/Radio'; import { BarChart } from '@mui/x-charts/BarChart'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; +import { dataset } from '../dataset/weather'; function TickParamsSelector({ tickPlacement, @@ -56,93 +57,6 @@ function TickParamsSelector({ ); } -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; - const valueFormatter = (value) => `${value}mm`; const chartSetting = { diff --git a/docs/data/charts/bars/TickPlacementBars.tsx b/docs/data/charts/bars/TickPlacementBars.tsx index b30b6ff39500d..66274abbf635a 100644 --- a/docs/data/charts/bars/TickPlacementBars.tsx +++ b/docs/data/charts/bars/TickPlacementBars.tsx @@ -7,6 +7,7 @@ import FormControlLabel from '@mui/material/FormControlLabel'; import Radio from '@mui/material/Radio'; import { BarChart } from '@mui/x-charts/BarChart'; import { axisClasses } from '@mui/x-charts/ChartsAxis'; +import { dataset } from '../dataset/weather'; type TickParamsSelectorProps = { tickPlacement: 'end' | 'start' | 'middle' | 'extremities'; @@ -71,93 +72,6 @@ function TickParamsSelector({ ); } -const dataset = [ - { - london: 59, - paris: 57, - newYork: 86, - seoul: 21, - month: 'Jan', - }, - { - london: 50, - paris: 52, - newYork: 78, - seoul: 28, - month: 'Fev', - }, - { - london: 47, - paris: 53, - newYork: 106, - seoul: 41, - month: 'Mar', - }, - { - london: 54, - paris: 56, - newYork: 92, - seoul: 73, - month: 'Apr', - }, - { - london: 57, - paris: 69, - newYork: 92, - seoul: 99, - month: 'May', - }, - { - london: 60, - paris: 63, - newYork: 103, - seoul: 144, - month: 'June', - }, - { - london: 59, - paris: 60, - newYork: 105, - seoul: 319, - month: 'July', - }, - { - london: 65, - paris: 60, - newYork: 106, - seoul: 249, - month: 'Aug', - }, - { - london: 51, - paris: 51, - newYork: 95, - seoul: 131, - month: 'Sept', - }, - { - london: 60, - paris: 65, - newYork: 97, - seoul: 55, - month: 'Oct', - }, - { - london: 67, - paris: 64, - newYork: 76, - seoul: 48, - month: 'Nov', - }, - { - london: 61, - paris: 70, - newYork: 103, - seoul: 25, - month: 'Dec', - }, -]; - const valueFormatter = (value: number | null) => `${value}mm`; const chartSetting = { diff --git a/docs/data/charts/dataset/weather.ts b/docs/data/charts/dataset/weather.ts new file mode 100644 index 0000000000000..0e75447ef65b8 --- /dev/null +++ b/docs/data/charts/dataset/weather.ts @@ -0,0 +1,86 @@ +export const dataset = [ + { + london: 59, + paris: 57, + newYork: 86, + seoul: 21, + month: 'Jan', + }, + { + london: 50, + paris: 52, + newYork: 78, + seoul: 28, + month: 'Feb', + }, + { + london: 47, + paris: 53, + newYork: 106, + seoul: 41, + month: 'Mar', + }, + { + london: 54, + paris: 56, + newYork: 92, + seoul: 73, + month: 'Apr', + }, + { + london: 57, + paris: 69, + newYork: 92, + seoul: 99, + month: 'May', + }, + { + london: 60, + paris: 63, + newYork: 103, + seoul: 144, + month: 'June', + }, + { + london: 59, + paris: 60, + newYork: 105, + seoul: 319, + month: 'July', + }, + { + london: 65, + paris: 60, + newYork: 106, + seoul: 249, + month: 'Aug', + }, + { + london: 51, + paris: 51, + newYork: 95, + seoul: 131, + month: 'Sept', + }, + { + london: 60, + paris: 65, + newYork: 97, + seoul: 55, + month: 'Oct', + }, + { + london: 67, + paris: 64, + newYork: 76, + seoul: 48, + month: 'Nov', + }, + { + london: 61, + paris: 70, + newYork: 103, + seoul: 25, + month: 'Dec', + }, +];