Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] tickValues are not taken in account when multiple y axis #403

Closed
sylvainroh opened this issue Oct 22, 2024 · 2 comments · Fixed by #438
Closed

[BUG] tickValues are not taken in account when multiple y axis #403

sylvainroh opened this issue Oct 22, 2024 · 2 comments · Fixed by #438
Assignees

Comments

@sylvainroh
Copy link

Describe Your Environment

What version of victory-native-xl are you using? (can be found by running npm list --depth 0 victory-native)
41.6.2

What version of React and React Native are you using?
0.74.1

What version of Reanimated and React Native Skia are you using?
reanimated : 3.16.0 and skia 1.5.0

Are you using Expo or React Native CLI?
react native cli

What platform are you on? (e.g., iOS, Android)
Android and iOS

Describe the Problem

I'm setting up 2 y axis on a graph and i expect to be able to use tickValues or tickCount independently for each y axis.
image

<CartesianChart
                data={data}
                xKey="label"
                yKeys={['battery', 'grid', 'solar', 'consumption', 'acSolar']}
                yAxis={[
                    {
                        formatYLabel: label => label + unit,
                        yKeys: ['grid', 'solar', 'consumption', 'acSolar'],
                        labelColor: theme.colors.disabledText,
                        font,
                        axisSide: 'left',
                        tickValues: [-6, 0, 3, 6, 12],
                        tickCount: 12,
                    },
                    {
                        formatYLabel: label => (label ? Math.ceil(label) + '%' : ''),
                        labelColor: theme.colors.disabledText,
                        yKeys: ['battery'],
                        font,
                        domain: [0, 100],
                        axisSide: 'right',
                        tickValues: [0, 25, 50, 75, 100],
                    },
                ]}
                 xAxis={{
                    formatXLabel: label =>
                        label
                            ? new Date(label).toLocaleDateString('en', {
                                  day: '2-digit',
                                  month: '2-digit',
                              })
                            : '',
                    font,
                    labelColor: theme.colors.disabledText,
                }}>
...
</CartesianChart>

Expected behavior: [What you expect to happen]
I expect to be able to use tickValues or tickCount independently for each y axis.

Actual behavior: [What actually happens]
Seems like the 1st axis options are overriding all other axis options.

@masiddee
Copy link
Contributor

masiddee commented Dec 6, 2024

@sylvainroh I just merged a fix for this.

@sylvainroh
Copy link
Author

Thanks you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants