Victory-native: x axis tick labels are centered with tick on Android, but start at tick on iOS

Created on 26 Dec 2017  路  12Comments  路  Source: FormidableLabs/victory-native

iOS:
iOS screenshot

Android:
Android screenshot

Code:

<VictoryChart responsive={true} height={200} width={width} padding={{top: 3, left: 25, right: 15, bottom: 22}}>

// VictoryArea code here
// Y Axis code here 
// ....

      <VictoryAxis
         style={{ axis: { stroke: '#A4A4A4' },
         axisLabel: { fontSize: 8 },
         ticks: { stroke: '#A4A4A4' },
         tickLabels: { fontSize: 8, fill: '#999', padding: 0}}}
        />
</VictoryChart>

I don't think this is a surrounding container or padding issue in the VictoryChart tag because that shouldn't actually move the tick labels.

Is this the correct default behavior? Using 0.16.1

All 12 comments

Hi, I have the same problem.... in Android is perfect in Ios the label are wrong... you have find a solution?

20180103_154819 1

The issue is that in IOS props of <VictoryLabel /> like textAnchor and verticalAnchor has no effect. It is quite a serious bug for me as I cant use charts with label located chaotically over the chart.

uhm... if you use the version 0.15.0 work all fine...

I use victory-native": "0.16.6" and have a problem. Should I downgrade?
https://github.com/waubau/weather

yes if you use the 0.15.0 work fine in ios

I confirm that 0.15.0 works but I have lost a quite nice barRatio option. But it is much lesser evil.
Also Y positioning of tick labels is slightly different between platforms but it also can be adjusted by dy option for Android.

I hope in the new versione have this problem fix :)

<VictoryTooltip /> is also affected:
screen shot 2018-02-02 at 5 14 33 pm

Please add a +1 if you can reproduce this issue in the Latest versions: [email protected], react-native-svg@^6.1.0.

:( now i have [email protected] expo 25.0.0 in Ios the problem is the same....

is impossible to have align the Y axis

20180207_095850 1

@robertobrogi the version of react-native-svg will determine whether this can work properly. I know that expo-sdk is on an older version of react-native-svg. Current victory-native must use react-native-svg@^6.0.1-rc.1 or higher in order to align labels properly.

I believe it's related to this issue: https://github.com/expo/expo/issues/1393

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericschaal picture ericschaal  路  4Comments

ararog picture ararog  路  4Comments

jlo1 picture jlo1  路  3Comments

aszheng picture aszheng  路  5Comments

yvonne6344 picture yvonne6344  路  4Comments