data-ui icon indicating copy to clipboard operation
data-ui copied to clipboard

X / Y axis center

Open si-harps opened this issue 6 years ago • 2 comments

Hi, I was wondering if there is a quick way to position the X/Y Axis in the center of the graph (or in different positions based on dynamic median)?

This is essentially what i am trying to achieve...

screen shot 2018-09-27 at 10 45 52

si-harps avatar Sep 27 '18 09:09 si-harps

Hey @si-harps, thanks for checking out @data-ui. This isn't currently supported, but it's a great suggestion!

I think it wouldn't be too hard to implement, I think we'd just need to update the Axis components to take some type of offset prop, specifying the value of the other axis to place it at (e.g., in your example, <YAxis xIntersection={7500} />. I'd welcome a PR for this, else will add it to the list and will try to tackle it with a offset bug fix sometime this week.

williaster avatar Sep 27 '18 21:09 williaster

Hi @williaster, thanks for the quick reply. I'll take a look at this today. Adding an xIntersection/yIntersection prop sounds like a great idea. Will get back to you asap

si-harps avatar Sep 28 '18 07:09 si-harps