PDA

View Full Version : Drawing Bar Chart




dipaliP
Oct 16, 2008, 05:18 AM
Hi All
I want to draw bar chart using Xcode 10.5.
I am using Cocoa Touch Application for it. I am confused about how to use NSBezier, as the default framework bundle (iPhone OS2.0sdk) does not contain AppKit framework.



robbieduncan
Oct 16, 2008, 05:24 AM
Do you mean NSBezierPath? I cannot find any reference in the documentation to NSBezier. Anyway you can't use any AppKit classes on the iPhone.

dipaliP
Oct 16, 2008, 06:02 AM
Thank you for reply.

robbieduncan
Oct 16, 2008, 06:08 AM
Thank you for reply.
Is there any other way to draw bar chart using Coregraphics or any other framework?????

Have you tried read the documentation? I'm not about to do your research for you.

chbeer
Oct 16, 2008, 07:59 AM
Maybe a new Forum makes sense: "iPhone Programming for Noobs" or better "iPhone Programming for the lazy ones" or "iPhone Programming Self-Help Group"... There all noobs can ask questions and other noobs may answer them.

Please stop asking questions like "how do I enter text in the Xcode editor" or "How do I start Xcode"? ... Aaah!!!! :eek:

firewood
Oct 16, 2008, 11:44 AM
You could try building your own bar chart drawing routines using the CG graphics primitives (drawing rectangles, etc.)


Maybe a new Forum makes sense: "iPhone Programming for Noobs"

Apple already has one:
Apple.com > Support > Discussions > Developer Forums > Software Development 101 (http://discussions.apple.com/forum.jspa?forumID=728)
This is already mentioned in the Sticky FAQ here.

dipaliP
Oct 17, 2008, 03:17 AM
context variable not initializing.
As i am drawing it on view i haven't pushed CGContext.
I think there would be any other way to initialise context variable.

I am using following statement to initialize.
CGContextRef context = UIGraphicsGetCurrentContext();

firewood
Oct 17, 2008, 11:38 AM
Are you drawing inside the drawRect method of your view, or drawing to a backing bitmap?

.

dipaliP
Oct 20, 2008, 04:20 AM
I am adding new view in nib file and displaying that view on some event of previous view's control. Its goes fine up to displaying that newly added view but control does not enters into view's drawrect: method.

When i tried it with default view it displays all lines.

firewood
Oct 20, 2008, 08:59 AM
Did you send a setNeedsDisplay message to the view instance whose drawRect you want called?

Is that view visible?

.

dipaliP
Oct 21, 2008, 06:24 AM
I am displaying a view on one view.
When click event occurs on first view i am replacing existing view with another view and i want to draw some lines on newly appeared view.
i called setNeedsDisplay, but its not reaching there in drawRect method.

dipaliP
Oct 24, 2008, 12:25 AM
The code whatever i wrote that was ok, but i didn't check nib file.
Now its solved........
Thanks everyone for your help...........