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

Issue Fixes for Line in BarChart using secondaryYAxis #4

Closed
sandeep-synclovis opened this issue Feb 15, 2024 · 3 comments
Closed

Issue Fixes for Line in BarChart using secondaryYAxis #4

sandeep-synclovis opened this issue Feb 15, 2024 · 3 comments

Comments

@sandeep-synclovis
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/gifted-charts-core/src/BarChart/index.ts b/node_modules/gifted-charts-core/src/BarChart/index.ts
index 76b53ee..4e63116 100644
--- a/node_modules/gifted-charts-core/src/BarChart/index.ts
+++ b/node_modules/gifted-charts-core/src/BarChart/index.ts
@@ -192,7 +192,7 @@ export const useBarChart = (props: extendedBarChartPropsType) => {
     maxAndMin.maxItem
   );
   const secondaryMaxValue = lineConfig.isSecondary
-    ? secondaryMaxAndMin.maxItem
+    ? props.secondaryYAxis.maxValue
     : maxValue;
   const mostNegativeValue = props.mostNegativeValue ?? maxAndMin.minItem;
 
diff --git a/node_modules/gifted-charts-core/src/utils/index.tsx b/node_modules/gifted-charts-core/src/utils/index.tsx
index a2e94a0..5056a83 100644
--- a/node_modules/gifted-charts-core/src/utils/index.tsx
+++ b/node_modules/gifted-charts-core/src/utils/index.tsx
@@ -709,7 +709,7 @@ export const getAxesAndRulesProps = (
   };
   if (
     (props.secondaryYAxis || props.lineConfig?.isSecondary) &&
-    maxValue !== undefined
+    maxValue !== undefined && props.secondaryYAxis.maxValue == undefined
   ) {
     axesAndRulesProps.secondaryYAxis = { ...props.secondaryYAxis, maxValue };
   }

This issue body was partially generated by patch-package.

@Abhinandan-Kushwaha
Copy link
Owner

Fixed from version 0.1.12 onwards.

@Abhinandan-Kushwaha
Copy link
Owner

Fixed from version 0.1.12 onwards.

@sandeep-synclovis
Copy link
Author

Thanks

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

No branches or pull requests

2 participants