-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
autoScaleMinMaxEnabled does not work with Candle Charts #986
Comments
On further investigation this ties in with this issue: #113 Essentially any graph that has |
can you fix and a PR? |
Sorry I won't be able to put in the time for that as I have decided to switch to https://github.com/i-schuetz/SwiftCharts for now because of #194 |
You should not have |
As far as I can see this should not be closed. To omit the values is not a valid approach due to the x-axis being a array of labels instead of proper data points. If you omit the values say for a depth chart (https://en.wikipedia.org/wiki/Market_depth, the bottom one in the example) with y values for volume versus x values for price then you end up with an incorrect chart. For example say you have entries at USD 100, 150, 201, 202, 203, 300. The spacing between those entries will be the equidistant if you simply enter those entries, which is incorrect. The space between 203 and 300 should not be the same as the space between 202 and 203. At this time the only way I have found to fix this is to generate x values for each amount from 100 to 300. Any other suggestions are much appreciated. |
You are talking about the x-indices. You can add x-indices as many as you'd like, without having to add y-values for them. |
Well not with
If you have x-indices without y-values for them and you set |
I think when it tries to calculate the factors by which to scale it tries to find the y for a given x and when there isn't one it crashes. I could be totally off though, I have only just started using your library. |
I don't experience a crash. Do you have a piece of code to put in the Demo that will reproduce this? |
Thanks for taking a look at it, it must be the combination of options I have that causes it. I have two line charts and one candle chart. Same setup function for all 3. The candle chart and one of the line charts experience the crash while the other does not, this makes me assume it is the data causing it. I don't have time to prepare a demo right now but I will do it next weekend. You can leave the issue closed for now. |
I played with it with the combination you are describing - no crashes... |
Setting
chartview.autoScaleMinMaxEnabled = true
works as expected on my line charts. However on my candle chart the application crashes ifautoScaleMinMaxEnabled
is set totrue
.The relevant part of the stacktrace is here:
Any ideas as to why this might be happening? Is the documentation wrong when it states that
autoScaleMinMaxEnabled
applies to candle charts too?The text was updated successfully, but these errors were encountered: