I could be missing something but VictoryTooltip don't seem to show up when using VictoryLine, is that the intended behaviour?
You can see an example here: https://codesandbox.io/s/k5yzzrzzj3
<VictoryChart
padding={{ top: 20, left: 50, right: 50, bottom: 30 }}
width={600} height={100}
scale={{ x: "time", y: 'linear' }}
>
<VictoryAxis
tickFormat={(x) => new Date(x).getFullYear()}
style={{ tickLabels: { fontSize: 10, padding: 5 }, }}
/>
<VictoryLine
labelComponent={<VictoryTooltip />}
data={[
{ key: new Date(2018, 1, 1), b: 57, label: "57 kg" },
{ key: new Date(2018, 2, 2), b: 56, label: "56 kg" },
{ key: new Date(2018, 3, 3), b: 55, label: "55 kg" },
{ key: new Date(2018, 4, 4), b: 56, label: "56 kg" },
{ key: new Date(2018, 5, 5), b: 55, label: "55 kg" },
{ key: new Date(2018, 6, 6), b: 55, label: "55 kg" },
{ key: new Date(2018, 7, 7), b: 54, label: "54 kg" },
{ key: new Date(2018, 8, 8), b: 53, label: "53 kg" }
]}
x="key"
y="b"
/>
</VictoryChart>
@ikassi VictoryLine only has one event target (just the single line element), so VictoryTooltip wont work properly. Try using VictoryVoronoiContainer to add your tooltips: https://formidable.com/open-source/victory/docs/victory-voronoi-container/
Most helpful comment
@ikassi
VictoryLineonly has one event target (just the single line element), soVictoryTooltipwont work properly. Try usingVictoryVoronoiContainerto add your tooltips: https://formidable.com/open-source/victory/docs/victory-voronoi-container/