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

Calling setAxisMaxValue leads to transform error. #1549

Closed
nicholassmith opened this issue Sep 24, 2016 · 2 comments
Closed

Calling setAxisMaxValue leads to transform error. #1549

nicholassmith opened this issue Sep 24, 2016 · 2 comments

Comments

@nicholassmith
Copy link

nicholassmith commented Sep 24, 2016

If I call:

[self.userDataChartView.leftAxis setAxisMaxValue:100];

or

[self.userDataChartView.xAxis setAxisMaximum:xVal + 1];

More than once it will lead to:

<Error>: CGAffineTransformInvert: singular matrix.

I have a view that allows a user to view multiple datasets by tapping a button, the datasets have different value ranges so I need to be able to specify what the minimum and maximum values should be for the range, but if those values are called more than once it seems like the axis loses the range.

Have tried:

[self.userDataChartView.xAxis resetCustomAxisMax]; [self.userDataChartView.xAxis resetCustomAxisMin];

But they do nothing to resolve the problem.

@liuxuan30
Copy link
Member

can you try if it's xAxis that giving the error?

@nicholassmith
Copy link
Author

nicholassmith commented Sep 26, 2016

I tested both in isolation and they both had the same issue, but I solved it by calling:

[self.userDataCharView autoScale]; [self.userDataChartView prepareValuePxMatrix];

Not sure which of the two actually resolved the issue, I saw them in the same header and put them in after setting the axis min &/or max and it fixed the issue. My gut instinct says prepareValuePxMatrix because the error is from a singular matrix so it feels logical. Definitely fixed the problem though.

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