FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Graph Functions Library
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Graph Functions Library
Posted: Fri Feb 15, 2013 08: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)
Posts: 88
Joined: Wed Apr 28, 2010 06:34 PM
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Graph Functions Library
Posted: 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)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Graph Functions Library
Posted: Wed Feb 20, 2013 08:35 PM

Jeff,

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

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Graph Functions Library
Posted: Wed Feb 20, 2013 09: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)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Graph Functions Library
Posted: 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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Graph Functions Library
Posted: 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)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Graph Functions Library
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion