diff --git a/docs/data/charts/axis/AxisTextCustomizationNoSnap.js b/docs/data/charts/axis/AxisTextCustomizationNoSnap.js index 9f8cc6aa3d6b..8a6b510e845a 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 b3eb264c092d..2bb4bb1219fa 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 056caeacb573..3e987f4bc0a5 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 f1c7f8cdd6ca..6ba3112538af 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 b03ac258bf58..41acf2026669 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 b6861f237d03..6fe95c941451 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 a063c4a8d9cc..9318c93c1e52 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 5f15dcbefa11..d58b2a314590 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 14e7fac73e4a..38ad304c82ba 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 df201e0c5943..6a08bef3a7c9 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 b30b6ff39500..66274abbf635 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 000000000000..0e75447ef65b --- /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', + }, +];