Skip to content

Instantly share code, notes, and snippets.

@romgrk
Created November 25, 2025 21:04
Show Gist options
  • Select an option

  • Save romgrk/a0c931b34a76f0752c797fff1be3fc70 to your computer and use it in GitHub Desktop.

Select an option

Save romgrk/a0c931b34a76f0752c797fff1be3fc70 to your computer and use it in GitHub Desktop.
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