victory icon indicating copy to clipboard operation
victory copied to clipboard

voronoiDimension not working VictoryVoronoiContainer with log scale chart

Open wokalski opened this issue 5 years ago • 0 comments

Bugs and Questions

Checklist

  • [x] This is not a victory-native specific issue. (Issues that only appear in victory-native should be opened here)

  • [x] I have read through the FAQ and Guides before asking a question

  • [x] I am using the latest version of Victory

  • [x] I've searched open issues to make sure I'm not opening a duplicate issue

The Problem

When we wrap a chart with scale={{ y: "log", x: "linear"}} with a VictoryVoronoiContainer with voronoiDimension="x", it does not move highlight as a user moves the mouse. It always stays at the a random value. There have been several related issues in the past.

Reproduction

class App extends React.Component {
  render() {
    return (
      <div style={{ width: "300px", height: "400px" }}>
        <VictoryChart
          scale={{ x: "linear", y: "log" }}
          containerComponent={
            <VictoryVoronoiContainer
              voronoiDimension={"x"}
              labels={({ datum }) => String(datum)}
            />
          }
        >
          <VictoryScatter
            data={[{ x: 0, y: 1 }, { x: 1, y: 40 }, { x: 2, y: 40 }]}
          />
        </VictoryChart>
      </div>
    );
  }
}

Sorry, sandbox somehow didn't work for me :(. I couldn't fork the example. but it's enough to repro the issue ^

wokalski avatar Mar 23 '20 18:03 wokalski