iOSPlot icon indicating copy to clipboard operation
iOSPlot copied to clipboard

Line Chart crashes when it's changed to the Landscape mode

Open guysung opened this issue 11 years ago • 11 comments

Hi, Thanks for the great contribution in advance. The crashing point is the line 107 of the drawRect: message in PCLineChartView.m.

I am using it under iOS5.1 target.

Any idea?

guysung avatar Jun 03 '13 01:06 guysung

What is the console output when it crashes? Have you placed a breakpoint to inspect the value of formatString and y_axis?

ricsantos avatar Jun 04 '13 02:06 ricsantos

See the screenshot below.

littlesnapper

guysung avatar Jun 04 '13 20:06 guysung

The screenshot doesn't show the console :/

My guess is that it's got something to do with that really tiny value for power

ricsantos avatar Jun 05 '13 00:06 ricsantos

I am sorry that there were no ouput through the console, see the screen shot below when the app crashes. iosplot error Thanks.

vsymguysung avatar Jun 05 '13 01:06 vsymguysung

OK well it is failing in the stringWithFormat method. It is because the value of power is too large. My guess is that power is never initialised as self.autoscaleYAxis is true. See around line 80 where power is declared, change that to int power = 0;.

ricsantos avatar Jun 05 '13 01:06 ricsantos

Hi trici, It works by initializing int power local variable with 0. Thanks so much for tracking it down. Should I made a pull request for this fix or will you? Let me know.

guysung avatar Jun 05 '13 01:06 guysung

You are welcome. I can't approve the pull request, as it is not my repo! Hopefully @honcheng will approve it :)

ricsantos avatar Jun 05 '13 02:06 ricsantos

Hi Ricardo, I made the pull request for honcheng. Thank you so much for your help.

On Tuesday, June 4, 2013, Ricardo Santos wrote:

You are welcome. I can't approve the pull request, as it is not my repo! Hopefully @honcheng https://github.com/honcheng will approve it :)

— Reply to this email directly or view it on GitHubhttps://github.com/honcheng/iOSPlot/issues/20#issuecomment-18951747 .

Guysung Kim [email protected] [email protected] www.vsym.com www.lifeservant.com

www.webfca.com

guysung avatar Jun 05 '13 02:06 guysung

Oh I see! Doh. Send a link to your app when it's finished - I want to see this graph now!

ricsantos avatar Jun 05 '13 02:06 ricsantos

Hi Ricard, Any problem with my pull request? Let me know if there is.

For now, I don't really have an App for this iOSPlot and just want to research and keep a possible graph library for future work.

Thanks for your help again.

guysung avatar Jun 05 '13 02:06 guysung

trici I had this same problem and have been working on this graph for 5 days! Setting the power to 0 worked right away. Thank you so much for your input on this page!!!

LarryBrian avatar Aug 31 '14 08:08 LarryBrian