Search code examples
javascriptreact-vis

How to specify the y-axis range for multiple y-axes in React Vis js


So an overview of the issue I'm encountering is I have two y-axes on my chart and I need to change the domain range of each axis separately. So far I have not found anything that can do this within React Vis.

What I am looking for is a way to set the range of each axis separately, I know that <XYPlot yDomain=[0,100]> </XYPlot> will set the range for the y-axis but it sets it for both the y-axes on the chart. I need a way to do this separately for each of the y-axes as they corresponded to different plotted data on the chart.


Solution

  • Answering my own question within there is a yDomain in which you can set the range of that specific YAxis. For example, if you had two y-axes of different ranges you could do this.

    <YAxis orientation="left" yDomain={[0,100]} /> <YAxis orientation="right" yDomain={[0,250]} />