Skip to main content

teamColors

import { createTheme, ThemeProvider } from "@mui/material/styles";
import { LineChart } from "@mui/x-charts/LineChart";
import { loadLeague } from "@sportsdataverse/sdvplot";
import { teamColors } from "@sportsdataverse/sdvplot/mui";

await loadLeague("nfl");
const teams = ["KC", "DEN"];
<ThemeProvider theme={createTheme({ palette: { mode: "dark" } })}>
<LineChart
width={400}
height={240}
colors={teamColors("nfl", teams)}
xAxis={[{ data: [1, 2, 3] }]}
series={[
{ id: "KC", data: [1, 2, 3] },
{ id: "DEN", data: [0, 1, 2] },
]}
/>
</ThemeProvider>;

Tags: docstring · teamColors. All sdvplot examples.