Graph Functions Library

Graph Functions Library

Postby Jeff Barnes » Fri Feb 15, 2013 8:27 pm

Hi,

Does anyone know of a decent library for generating graphs on the screen that will work with xHarbour/FWH ?
I'm looking for something that can handle about 250,000 data points on the Y axis so scaling/scrolling would need to be available.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Re: Graph Functions Library

Postby Jeff Barnes » Sun Feb 17, 2013 12:53 am

Thanks Aferra. I will take a look at it.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Graph Functions Library

Postby James Bott » Wed Feb 20, 2013 8:35 pm

Jeff,

Have you looked at the TGraph class that comes with FW?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Graph Functions Library

Postby Jeff Barnes » Wed Feb 20, 2013 9:45 pm

Hi James,

I haven't looked at that yet...

I'm doing a complete re-write of an older app. One part of the app took data from a medical device (one data point every second) over a 12 hour period. I used LineTo() and MoveTo() to draw the line graph. Now I am looking at doing the same type of graph but over 72 hours.

When I used the LineTo and MoveTo the code I needed to create was just massive. I had to have different display ranges (1 min, 5 min, 15 min, 60 min and the entire data set). I also had to allow the user to page through the data. It was labor intensive and I was looking for an easier way to do it :oops:
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Graph Functions Library

Postby James Bott » Wed Feb 20, 2013 11:03 pm

Jeff,

You can most of this very easily with TGraph. You just need to define the parameters of the graph (e.g. Line type, grids, legends) and feed it the data. This will be much simpler than what you were doing. The only coding would be to do a manual paging which I think you can do by just substituting an new data range for each time the user presses a button to go forward or backward.

The only issue you will have is the Y-axis range. TGraph auto scales it but It always starts at zero, so depending on your data range this can become a real issue. However, there is hope. There are some links in this thread

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=22687

pointing to a modified version of TGraph that supposedly allows setting of the y-axis range. I have been meaning to look at it, but haven't done it yet.

Coincidentally, I have been using TGraph for a medical data graphing system (blood pressures). For this app, the Y range has not been a problem.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Graph Functions Library

Postby Jeff Barnes » Wed Feb 20, 2013 11:16 pm

Hi James,

My Y axis will be values from 40 to 100. So I hope it won't be an issue...

As for the X axis, this is the one where my data will be around 250,000 data points (I made a typo in my original post saying it was the Y axis with the large data).
The X axis will be time in the format of hh:mm:ss ... can TGraph handle this?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 933
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Graph Functions Library

Postby James Bott » Thu Feb 21, 2013 12:16 am

Jeff,

>The X axis will be time in the format of hh:mm:ss ... can TGraph handle this?

I think so. My chart is also using time on the x-axis but I have been just letting the chart plot it one point per interval even though my times are not the same interval (they could be 5 times in one day, and zero in the next).

However, yours are one data point per second and thus all the intervals are the same so it should work fine for you. I don't know about labeling the increments in time format though. That could be a physical space issue too since each label is eight characters wide and I don't know if it handles vertical labels. I'm not even using labels on the x-axis on mine.

If you want to email me a sample list of data (say 25 points), I will see if I can put together a quick chart for you.

jbott at compuserve dot com

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano and 82 guests