tags:

views:

40

answers:

2

Hi,

I am trying to construct a graph using cocoa.To display the points on x -axis and y- axis i used methods called drawATPoint and drawinRect which allows to draw apoint inside rect not out side .

So please mention if there is any solution to display the points.I am using the following code.

NSTextStorage *textStorage = [[NsTextStorage alloc]initWithString:@"0.0"]; [textStorage drawAtPoint:NSMakePoint(0,0)];

A: 

Your question doesn't make sense. You want to tell the string to draw “anywhere but in this rect”? Where should it draw, then?

You need to tell it where to draw. This means you need to give it either a point to start from or a rect to draw within.

If you have a rect and you want to draw the text somewhere outside of that rect, then decide where outside of that rect, and then tell the string to draw there.

Peter Hosey
A: 

Maybe you need to create a RECT big enough to draw inside and then draw the graph inside the rect say -20 on all axis so that you give the impression the rect is smaller?

Lee Armstrong
Thanks Lee i got it
Kishore