Created
November 25, 2025 21:04
-
-
Save romgrk/a0c931b34a76f0752c797fff1be3fc70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import Paper from '@mui/material/Paper'; | |
| import Box from '@mui/material/Box'; | |
| import { ChartContainer } from '@mui/x-charts/ChartContainer'; | |
| import { BarPlot } from '@mui/x-charts/BarChart'; | |
| import { LinePlot, MarkPlot } from '@mui/x-charts/LineChart'; | |
| import { ChartsXAxis } from '@mui/x-charts/ChartsXAxis'; | |
| const lineData: number[] = []; | |
| const barData: number[] = []; | |
| const xAxis: number[] = []; | |
| const pointsPerSerie = 1000; | |
| for (let i = 0; i < pointsPerSerie; i++) { | |
| lineData.push(i); | |
| barData.push(pointsPerSerie - i); | |
| xAxis.push(i); | |
| } | |
| export default function CompositionBench() { | |
| return ( | |
| <Box sx={{ width: '100%', overflow: 'auto' }}> | |
| <Paper sx={{ margin: 1, height: 300, width: 600 }} elevation={3}> | |
| <ChartContainer | |
| series={[ | |
| { | |
| type: 'bar', | |
| data: barData, | |
| }, | |
| { | |
| type: 'line', | |
| data: lineData, | |
| showMark: false, | |
| }, | |
| ]} | |
| xAxis={[ | |
| { | |
| data: xAxis, | |
| scaleType: 'band', | |
| id: 'x-axis-id', | |
| height: 45, | |
| }, | |
| ]} | |
| > | |
| <BarPlot skipAnimation={true} /> | |
| <ChartsXAxis label="X axis" axisId="x-axis-id" /> | |
| </ChartContainer> | |
| </Paper> | |
| </Box> | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment