
import * as React from 'react';
import Stack from '@mui/material/Stack';
import { Gauge } from '@mui/x-charts/Gauge';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'BasicGaugesChart ',
},
];
export default function BasicGaugesChart() {
return (
<Stack direction={{ xs: 'column', md: 'row' }} spacing={{ xs: 1, md: 3 }}>
<Gauge width={200} height={200} value={60} />
<Gauge width={200} height={200} value={60} startAngle={-90} endAngle={90} />
</Stack>
);
}
import * as React from 'react';
import { Gauge, gaugeClasses } from '@mui/x-charts/Gauge';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'ArcDesignChart ',
},
];
const settings = {
width: 200,
height: 200,
value: 60,
};
export default function ArcDesignChart() {
return (
<Gauge
{...settings}
cornerRadius="50%"
sx={(theme) => ({
[`& .${gaugeClasses.valueText}`]: {
fontSize: 40,
},
[`& .${gaugeClasses.valueArc}`]: {
fill: '#5D87FF',
},
[`& .${gaugeClasses.referenceArc}`]: {
fill: theme.palette.text.disabled,
},
})}
/>
);
}
import React from 'react'
import {
GaugeContainer,
GaugeValueArc,
GaugeReferenceArc,
useGaugeState,
} from '@mui/x-charts/Gauge';
const BCrumb = [
{
to: '/',
title: 'Home',
},
{
title: 'GaugePointerChart ',
},
];
function GaugePointer() {
const { valueAngle, outerRadius, cx, cy } = useGaugeState();
if (valueAngle === null) {
// No value to display
return null;
}
const target = {
x: cx + outerRadius * Math.sin(valueAngle),
y: cy - outerRadius * Math.cos(valueAngle),
};
return (
<g>
<circle cx={cx} cy={cy} r={5} fill="red" />
<path
d={`M ${cx} ${cy} L ${target.x} ${target.y}`}
stroke="red"
strokeWidth={3}
/>
</g>
);
}
export default function GaugePointerChart() {
return (
<GaugeContainer
width={200}
height={200}
startAngle={-110}
endAngle={110}
value={30}
>
<GaugeReferenceArc />
<GaugeValueArc />
<GaugePointer />
</GaugeContainer>
);
}