Victory: Multiple VictoryAxis

Created on 9 Apr 2017  路  5Comments  路  Source: FormidableLabs/victory

It is currently not possible to have a second 'mirrored' VictoryAxis on a VictoryChart.

Expected behaviour would be to create a second 'Y' axis where the orientation was set so that a line graph values are easier to interpret against the axis.

Logical design is:

<VictoryChart>
  <VictoryAxis dependentAxis=false/>  
  <VictoryAxis dependentAxis=true orientation="left"/>
  <VictoryAxis dependentAxis=true orientation="right"/>
</VictoryChart>
discussion feature

Most helpful comment

react native has same problem? can you update to 0.21.0

All 5 comments

At the moment it is expected that the user will compose mutli-axis charts manually, as most users who want multiple y axes want separate domains for each. VictoryChart currently enforces a domain for each of its children. I will leave this issue open as a feature request / discussion.

1) Should VictoryChart only limit the number of _independent_ axes?

2) Should children of VictoryChart be allowed to determine their own domains when the domain prop is set?

  • in this case, how should VictoryChart reconcile the domains of its children? How will it know which children belong with which axis? Possibly VictoryGroup?

As of [email protected] multiple _dependent_ axes are allowed in VictoryChart.
All children of VictoryChart are still forced to use the same domain, so multi-axis data should be normalized and them plotted. The appearance of different domains should be achieved by scaling the displayed tickValues for each axis using the tickFormat function.

react native has same problem? can you update to 0.21.0

I too need to take advantage of this on react-native.

Trying to recreate this multi axis example from the docs using the VictoryTheme

When I wrap the example code in a VictoryChart + Theme I get this result which does not appear to use the theme:

https://codesandbox.io/s/gifted-proskuriakova-ulk0s

If I try to replace the <g /> with a <VictoryGroup /> I get the theme styles but the multi-domain stuff stops working:

https://codesandbox.io/s/hungry-brahmagupta-8mtne

Could provide an example of how to do multi-axis stuff and theming?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dinnayu picture dinnayu  路  3Comments

danielberndt picture danielberndt  路  4Comments

icd2k3 picture icd2k3  路  3Comments

captDaylight picture captDaylight  路  5Comments

tylermassey picture tylermassey  路  5Comments