Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VictoryZoomContainer breaks when VictoryAxis.tickFormat is an array #1617

Closed
savv opened this issue Jun 19, 2020 · 1 comment · Fixed by #1852
Closed

VictoryZoomContainer breaks when VictoryAxis.tickFormat is an array #1617

savv opened this issue Jun 19, 2020 · 1 comment · Fixed by #1852
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@savv
Copy link

savv commented Jun 19, 2020

Bugs and Questions

Checklist

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

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

  • [✔️] I am using the latest version of Victory

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

The Problem

Adding a zoom container seems to break the X axis, such that it always starts from the first tick.

Reproduction

This sandbox:
https://codesandbox.io/s/basic-victory-example-wfkmm?file=/index.js
takes the example from the FAQ here and simply adds:

        containerComponent={
          <VictoryZoomContainer
            allowPan={true}
            allowZoom={false}
            zoomDomain={{ x: [0, 2] }}
          />
        }

Panning to the right results in the X-axis resetting to start from quarter 1, despite that the rest of the chart scrolls correctly. Setting to zoomDomain to {{ y: [5000, 10000] }} doesn't seem to cause this.

@savv
Copy link
Author

savv commented Jun 19, 2020

This only seems to happen when tickFormat is an array. Changing to tickFormat={x => Quarter ${x}} fixes the issue above.

@savv savv changed the title VictoryZoomContainer breaks VictoryAxis (along the X dimension?) VictoryZoomContainer breaks when VictoryAxis.tickFormat is an array Jun 19, 2020
@boygirl boygirl added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label Aug 27, 2020
@jhumbug jhumbug linked a pull request May 14, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants