Skip to content

Commit a748e70

Browse files
committed
Keep Victory tooltips and axis label inside the chart bounds
1 parent d799f36 commit a748e70

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/pages/Victory.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export function Victory() {
3030
voronoiDimension="x"
3131
cursorDimension="x"
3232
labels={({ datum }: { datum: { x: string; y: number } }) => `${datum.x}: ${datum.y}`}
33-
labelComponent={<VictoryTooltip />}
33+
labelComponent={<VictoryTooltip constrainToVisibleArea />}
3434
/>
3535
}
3636
>
3737
<VictoryAxis label="name" />
38-
<VictoryAxis dependentAxis label="age" axisLabelComponent={<VictoryLabel dy={-48} />} />
38+
<VictoryAxis dependentAxis label="age" axisLabelComponent={<VictoryLabel dy={-34} />} />
3939
<VictoryLine data={data} />
4040
</VictoryChart>
4141
</>

0 commit comments

Comments
 (0)