Victory: VictoryTooltip don't seem to show up when using VictoryLine

Created on 12 Jun 2018  路  1Comment  路  Source: FormidableLabs/victory

Bug

The Problem

I could be missing something but VictoryTooltip don't seem to show up when using VictoryLine, is that the intended behaviour?

Reproduction

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>

Most helpful comment

@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/

>All comments

@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/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielberndt picture danielberndt  路  4Comments

pruhstal picture pruhstal  路  4Comments

iffy picture iffy  路  5Comments

icd2k3 picture icd2k3  路  3Comments

AndresTIY picture AndresTIY  路  5Comments