 |
 |
|
 |
06-29-2009, 11:10 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
how do you create a line graph??
hey, im fairly new to developing and have no idea how i would go about creating a line graph, such as the one in the 'ipushups' app. Any body know how i would go about doing this or know of any tutorials that would explain??
|
|
|
06-29-2009, 12:12 PM
|
#2 (permalink)
|
|
Registered Member
Join Date: Aug 2008
Posts: 398
|
Quote:
Originally Posted by eski
hey, im fairly new to developing and have no idea how i would go about creating a line graph, such as the one in the 'ipushups' app. Any body know how i would go about doing this or know of any tutorials that would explain??
|
Check out the AccelGraph Sample Code
|
|
|
06-29-2009, 05:26 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
i searched for it and it couldnt find it?
|
|
|
06-29-2009, 05:28 PM
|
#4 (permalink)
|
|
Registered Member
Join Date: Sep 2008
Location: London, UK
Posts: 793
|
Quote:
Originally Posted by eski
i searched for it and it couldnt find it? 
|
Try AccelerometerGraph in Examples in Dev Center
|
|
|
06-29-2009, 05:58 PM
|
#5 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
found it but the graphs so different to what im trying to do i wouldnt know where to start with that code. thanks any way
|
|
|
06-29-2009, 11:05 PM
|
#6 (permalink)
|
|
Registered Member
Join Date: Oct 2008
Posts: 14
|
FYI to draw a line
This code constructs a triangle from a set of three lines.
// Draw a purple triangle with using lines
CGContextSetRGBStrokeColor(ctx, 255, 0, 255, 1);
CGPoint points[6] = { CGPointMake(100, 200), CGPointMake(150, 250),
CGPointMake(150, 250), CGPointMake(50, 250),
CGPointMake(50, 250), CGPointMake(100, 200) };
CGContextStrokeLineSegments(ctx, points, 6);
u can set any point to draw graph
|
|
|
06-30-2009, 06:20 AM
|
#7 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
cool thanks, don't spose you know how id go about making the lines move to the numbers in a label? like in a graph.
|
|
|
07-01-2009, 07:06 AM
|
#8 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Location: India
Posts: 47
|
eski,
Did you find any framework for plotting graph in application? How you managed to add graph in application?
I got one framework for this named core plot. There is one good tutorial on integrating this to iphone application.
Using Core Plot in an iPhone Application | Switch on the Code
Since the project is in starting stage, many bugs and restrictions are there. So any other framework?
|
|
|
07-01-2009, 07:31 AM
|
#9 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
no luck so far  i just found that tutorial like 2mins ago lol, was just about to see if it would work
|
|
|
07-01-2009, 07:43 AM
|
#10 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Location: India
Posts: 47
|
Core plot supports only line graph in iphone OS. I have tried that and its working fine for me.
The main issue i found is in the axis label positioning. I have attached one sample screen shot of this.
When i contacted the project owner, he is working to resolve this issue.
|
|
|
07-01-2009, 08:20 AM
|
#11 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
cool its a line graph that i want. the screen shot wont load up
How did you get the code of that site the... 'hg clone Revision ae158fc377: / core-plot"
im well confused, it telling me to download Mercurial, then when i click the link to do that theres not a link to download it to mac os x 10.5 but tells me to download python2.5...iv done that now what???
|
|
|
07-01-2009, 11:51 PM
|
#12 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Location: India
Posts: 47
|
I forgot how i downloaded that file...I have uploaded the 10.5 package for you in rapid share
RapidShare: Easy Filehosting
Download and install that. After that run these two commands
macmiexport LC_ALL=en_US.UTF-8
macmiexport LANG=en_US.UTF-8
Then you can download the source using hg clone command
|
|
|
07-02-2009, 04:40 PM
|
#14 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
thanks! that made it a lot easier i managed to get all the code and i follwed the instructions exactly but now it keeps coming up with 1 error basicly saying i need a ';' before '{' but then it dosnt fix it and makes more errors appear then u fix them then it goes back to the first one taking me in circles!! well annoying!
that google api does look helpful but i dnt really understand it and where id put the code. would it mean the user would have to have access to the internet in order for th graph to work??
|
|
|
07-02-2009, 04:42 PM
|
#15 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
the CPLayerHostingView seems to be cousing problems to! did you have this problem?
|
|
|
07-03-2009, 12:08 AM
|
#16 (permalink)
|
|
Registered Member
Join Date: Jul 2009
Location: India
Posts: 47
|
no...i didnt get any error.... There will be one warning in the interface builder for the CPLayerHostingView. No issue with that.
what is the error you are getting?
|
|
|
07-03-2009, 09:56 AM
|
#17 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
- (IBAction)pushupViewController  id)sender
{
//(error:expected ';' before '{' token)
pushupViewController *push = [[pushupViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController  ush animated:NO];
}
...so from that im gathering i need to put ';' after '(id)sender' ..
- (IBAction)pushupViewController id)sender;
{
but then once i do that it it comes up with 2 errors...
- (IBAction)pushupViewController  id)sender;
{
//(error:expected identifier or '(' before '{' token)
and....
- (void)viewDidLoad {
//(error:expected ' ;' before ' {' token)
[super viewDidLoad];
then basically it passes errors along as i try and fix them.. so im thinking that the actual problem is in the header file
what you think??
|
|
|
07-03-2009, 10:11 AM
|
#18 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
and that googl chart api i get now but ivcreated a UIWebView which works fine but when i try to link it to the google api chart e.g it dosnt load any thing
do you know why this is?
thanks for all the help
|
|
|
07-05-2009, 08:32 AM
|
#19 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
hey, the problem was i had forgot to import the cocoaTouch.h file!
now im just stcuk with 1 error...
CPPlotSymbol *greenCirclePlotSymbol = [CPPlotSymbol ellipsePlotSymbol];
greenCirclePlotSymbol.fill = [CPFill fillWithColor:[CPColor greenColor]];
greenCirclePlotSymbol.size = CGSizeMake(2.0, 2.0);
xSquaredPlot.defaultPlotSymbol = greenCirclePlotSymbol;
//(error:request for member 'defaltPlotSymbol' in something not a structure or a union)
do you know what i need to do or change here??
thanks
|
|
|
07-05-2009, 09:10 AM
|
#20 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 78
|
ok, i have started from scratch on a new project done everything it says to do, im getting no errors in my code now
but i am getting one error in the targets..
//No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv6, VALID_ARCHS=i386).
what does this mean??
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 572 |
| 52 members and 520 guests |
| 6ix, alexz1, amit.wizkid, Argus, asimrs, bebus77, Blitfast, BrianSlick, CapsicumDreams, cdstamper, coconnor, DonomaGames, dre, d_amal, eric@cybercat.ca, fdifenza, gedalia, Georg, gladiator430, Guit, HemiMG, ieasyproductions, javaconvert, jbullfrog, jimkberry, JonnyBGoode, lepetitapps, luigi1977, magalhaes, mebarron, MikaelBartlett, naomipunkclan, paschi, Pedro Valentini, Picoman, rocketman240, sayhong, seezee, taptika, Thaurin, tmccphoto, tychop, ugur, warcrow, warmi, yannickd60, yojung, yujean, ziocleto |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,113
Threads: 38,883
Posts: 170,571
Top Poster: smasher (2,563)
|
| Welcome to our newest member, taptika |
|