Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Apr 26, 2017 6:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Line Chart Component
PostPosted: Mon Aug 20, 2012 7:42 pm 
Offline

Joined: Sat Aug 18, 2012 3:14 am
Posts: 11
Hello,

Really new to RealStudio and RealBasic as a whole, long time developer in Delphi along with Actionscript.

I am looking to start a new project in RealStudio and I need a simple Line Chart component. I've searched the forums and the web and the ones I've seen are either no longer existent (GraphPro site gives me errors all the time) or too complex for what I need (Chart Director).

I am just after a component that will allow me to plug in my data (via arrays or what not) and then display the lines plotted from those values.
Any got any suggestions please ?

Regards
Anthoni


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Mon Aug 20, 2012 7:54 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
Anthoni wrote:
Hello,

Really new to RealStudio and RealBasic as a whole, long time developer in Delphi along with Actionscript.

I am looking to start a new project in RealStudio and I need a simple Line Chart component. I've searched the forums and the web and the ones I've seen are either no longer existent (GraphPro site gives me errors all the time) or too complex for what I need (Chart Director).

I am just after a component that will allow me to plug in my data (via arrays or what not) and then display the lines plotted from those values.
Any got any suggestions please ?

Regards
Anthoni


1. Plugins can be expensive but that will save you lot's of time.
2. Draw them yourself in a Canvas control.

If you are evaluating a trial i won't recommend buying plugins yet.
You can however try plugins in the IDE and Run them.

Same for the Canvas control. It allows you to draw anything how you want it.
http://docs.realsoftware.com/index.php/Canvas

There should be some examples when you click "new project" and expand the Examples folder in the list.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Mon Aug 20, 2012 8:08 pm 
Offline

Joined: Sun Nov 23, 2008 12:27 am
Posts: 404
A while ago, I started to work on creating a bar chart and posted what I did.

http://forums.realsoftware.com/viewtopic.php?f=1&t=37003

maybe you can find this usefully in creating a line chart. :)


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Mon Aug 20, 2012 8:19 pm 
Offline

Joined: Sat Aug 18, 2012 3:14 am
Posts: 11
Sky Stream wrote:
A while ago, I started to work on creating a bar chart and posted what I did.

http://forums.realsoftware.com/viewtopic.php?f=1&t=37003

maybe you can find this usefully in creating a line chart. :)


Thanks will certainly give it a look.


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Mon Aug 20, 2012 9:09 pm 
Offline

Joined: Sun Nov 23, 2008 12:27 am
Posts: 404
Actually.. you might be in luck.. I found my old code in which I was tinkering with creating a bunch of charts. It still needs work, but it would get you going in A direction :)

In it.. has a line chart. if you like.. PM me and I can send it to you.


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Tue Aug 21, 2012 3:28 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Line charts are probably the easiest to draw yourself in code.

For the moment, forget that in RB y values go down the page when they get bigger.
Think graph paper.

You have an array of values.
Find the largest (say this is 300)
The canvas is (say) 200 tall.

This means that to keep the Y values inside the canvas (Assuming it starts at the bottom), you need to multiply all the values by 200/300 to keep them inside the available area.

Similarly, if your canvas is 400 wide and you have 100 values to plot, starting at zero, then the x values need to be placed every 400/100 = 4 pixels to make them fit.


Starting from the first pair of values to the last, you draw a line from

1*4, y *200/300
to
2 * 4, y2 * 200/300

then from

2 * 4, y2 * 200/300
to
3 * 4, y3 * 200/300



and so on.


You can add embellishments like circles at the actual points, and a scale etc


Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Wed Aug 29, 2012 1:13 am 
Offline

Joined: Fri May 08, 2009 1:42 am
Posts: 71
ChartPart 2.0b1 is posted for general download, I think you can get it from the wayback machine:

http://web.archive.org/web/200602070856 ... ngpicture/

I use it for Bar Charts, but it has line charts as well, I think. And another XY plotter I like, from Roger Meiers:

http://opensource.the-meiers.org/


Last edited by pate on Thu Aug 30, 2012 12:55 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Line Chart Component
PostPosted: Wed Aug 29, 2012 3:41 am 
Offline

Joined: Sat Aug 18, 2012 3:14 am
Posts: 11
Hello and thanks to all.
I am now using a component / class from Sky Stream (Rich) and it's not only working brilliantly but his help has been amazing :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group