
import React from 'react'
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
import { useTheme } from '@mui/material';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'BasicSparkLine ',
},
];
function BasicSparkLine() {
const theme = useTheme();
const primary = theme.palette.primary.main;
return (
<Stack direction="row" sx={{ width: '100%' }}>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart data={[1, 4, 2, 5, 7, 2, 4, 6]} height={100} color={primary} />
</Box>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart
plotType="bar"
data={[1, 4, 2, 5, 7, 2, 4, 6]}
height={100}
color={primary}
/>
</Box>
</Stack>
)
}
export default BasicSparkLine
import * as React from 'react';
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
import { useTheme } from '@mui/material';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'AreaSparkLineChart ',
},
];
export default function AreaSparkLineChart() {
const theme = useTheme();
const primary = theme.palette.primary.main;
return (
<Stack direction="row" sx={{ width: '100%' }}>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart data={[3, -10, -2, 5, 7, -2, 4, 6]} height={100} area color={primary} />
</Box>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart
data={[3, -10, -2, 5, 7, -2, 4, 6]}
height={100}
curve="natural"
color={primary}
area
/>
</Box>
</Stack>
);
}
import * as React from 'react';
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
import FormControlLabel from '@mui/material/FormControlLabel';
import Switch from '@mui/material/Switch';
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
import { useTheme } from '@mui/material';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'BasicSparkLineCustomizationChart ',
},
];
export default function BasicSparkLineCustomizationChart() {
const [showHighlight, setShowHighlight] = React.useState(true);
const [showTooltip, setShowTooltip] = React.useState(true);
const theme = useTheme();
const primary = theme.palette.primary.main;
const handleHighlightChange = (event) => {
setShowHighlight(event.target.checked);
};
const handleTooltipChange = (event) => {
setShowTooltip(event.target.checked);
};
return (
<Stack direction="column" sx={{ width: '100%' }}>
<Stack direction="row">
<FormControlLabel
value="end"
control={
<Switch
color="primary"
checked={showHighlight}
onChange={handleHighlightChange}
/>
}
label="showHighlight"
labelPlacement="end"
/>
<FormControlLabel
value="end"
control={
<Switch
color="primary"
checked={showTooltip}
onChange={handleTooltipChange}
/>
}
label="showTooltip"
labelPlacement="end"
/>
</Stack>
<Stack direction="row" sx={{ width: '100%' }}>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart
data={[1, 4, 2, 5, 7, 2, 4, 6]}
height={100}
showHighlight={showHighlight}
showTooltip={showTooltip}
color={primary}
/>
</Box>
<Box sx={{ flexGrow: 1 }}>
<SparkLineChart
plotType="bar"
data={[1, 4, 2, 5, 7, 2, 4, 6]}
height={100}
showHighlight={showHighlight}
showTooltip={showTooltip}
color={primary}
/>
</Box>
</Stack>
</Stack>
);
}