victory icon indicating copy to clipboard operation
victory copied to clipboard

Ability to define x axis labels independantly from the plot data

Open Mikkel-Gram opened this issue 6 years ago • 2 comments

Feature Requests

Checklist

  • [x] I've read through the Docs and Guides to make sure this functionality doesn't already exist

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

Description

Hey, and thanks for making a nice plotting library :) Im using the native charts, but i think this applies to both.

I have one specific usecase which is not supported yet (or i dont understand how to do it).

I have data points at irregular intervals in time, and sometimes with large gaps in between data points. I would like to be able to define the labels on the x axis independantly of what data i am displaying. I know right now it is possible to plot labels, but then there cannot be unequal distance between data points To give a concrete example, if i have data points at dates 25/1, 27/1, 3/2, 6/2, I would like the option to show just one label at 1/1, while also showing the unequal distance in x value between the points.

I hope this makes sense, otherwise let me know what i can elaborate more on :)

Kind regards, Mikkel

Mikkel-Gram avatar Mar 09 '20 19:03 Mikkel-Gram

Hi @Mikkel-Gram! 🎉

I think the tickValues prop on VictoryAxis will solve your use case. Here's an example: https://codesandbox.io/s/issue-1501-solution-xkvp2

Please @ me if this doesn't solve your issue.

narinluangrath avatar Mar 16 '20 03:03 narinluangrath

Thank you 👍

Mikkel-Gram avatar Mar 19 '20 17:03 Mikkel-Gram