Skip to main content

Function: LogoTick()

LogoTick(props): ReactElement

Defined in: packages/sdvplot/src/react/victory.tsx:230

Team logos as an axis' tick labels: <VictoryAxis tickLabelComponent={<LogoTick league />} /> on an axis whose labels are teams. The logo sits where the label would, on the side of Victory's anchor the label would run (under a bottom axis, left of a left one), size px tall. A label that resolves to no logo keeps its text, drawn by Victory's own VictoryLabel (loaded from victory when it first draws one; it then also warns once), as sdvplot/echarts' withAxisLogos does. Logos do not rotate with a tick's angle. Synchronous: call it after loadLeague(league).

Parameters​

props​

LogoTickProps

Returns​

ReactElement

Example​

import { loadLeague } from "@sportsdataverse/sdvplot";
import { LogoTick } from "@sportsdataverse/sdvplot/react";
import { VictoryAxis, VictoryBar, VictoryChart } from "victory";

await loadLeague("nfl");
const rows = [
{ team: "KC", wins: 15 },
{ team: "BUF", wins: 13 },
{ team: "LAC", wins: 11 },
];
<VictoryChart domainPadding={40} padding={{ top: 20, bottom: 60, left: 50, right: 20 }}>
<VictoryAxis tickLabelComponent={<LogoTick league="nfl" size={32} />} />
<VictoryAxis dependentAxis />
<VictoryBar data={rows} x="team" y="wins" />
</VictoryChart>;