react-garden
Version:
React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.
119 lines (112 loc) • 2.96 kB
JavaScript
// ** MUI Imports
import Box from '@mui/material/Box'
import Card from '@mui/material/Card'
import CardHeader from '@mui/material/CardHeader'
import Typography from '@mui/material/Typography'
import CardContent from '@mui/material/CardContent'
// ** Icons Imports
import ArrowUp from 'mdi-material-ui/ArrowUp'
// ** Custom Components Imports
import CustomChip from '~/@core/components/mui/chip'
import ReactApexcharts from '~/@core/components/react-apexcharts'
const ApexLineChart = () => {
const options = {
chart: {
parentHeightOffset: 0,
zoom: { enabled: false },
toolbar: { show: false }
},
markers: {
strokeWidth: 7,
strokeOpacity: 1,
colors: ['#ff9f43'],
strokeColors: ['#fff']
},
dataLabels: {
enabled: false
},
stroke: {
curve: 'straight'
},
colors: ['#ff9f43'],
grid: {
xaxis: {
lines: {
show: true
}
},
padding: {
top: -10
}
},
tooltip: {
custom(data) {
return `<div class='bar-chart'>
<span>${data.series[data.seriesIndex][data.dataPointIndex]}%</span>
</div>`
}
},
xaxis: {
categories: [
'7/12',
'8/12',
'9/12',
'10/12',
'11/12',
'12/12',
'13/12',
'14/12',
'15/12',
'16/12',
'17/12',
'18/12',
'19/12',
'20/12',
'21/12'
]
}
}
const series = [
{
data: [280, 200, 220, 180, 270, 250, 70, 90, 200, 150, 160, 100, 150, 100, 50]
}
]
return (
<Card>
<CardHeader
title='Balance'
titleTypographyProps={{ variant: 'h6' }}
subheader='Commercial networks & enterprises'
subheaderTypographyProps={{ variant: 'caption' }}
sx={{
flexDirection: ['column', 'row'],
alignItems: ['flex-start', 'center'],
'& .MuiCardHeader-action': { mb: 0 },
'& .MuiCardHeader-content': { mb: [2, 0] }
}}
action={
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Typography variant='h6' sx={{ mr: 5 }}>
$221,267
</Typography>
<CustomChip
skin='light'
color='success'
sx={{ fontWeight: 500, borderRadius: 1, fontSize: '0.875rem' }}
label={
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<ArrowUp sx={{ fontSize: '1rem', mr: 1 }} />
<span>22%</span>
</Box>
}
/>
</Box>
}
/>
<CardContent>
<ReactApexcharts options={options} series={series} type='line' height={400} />
</CardContent>
</Card>
)
}
export default ApexLineChart