Charts

SuperCard 4.5 & 4.6 projects (.zip archives only please).

Charts

Postby sctell » Wed Apr 13, 2011 10:51 am

I have been creating a couple of externals recently called THPieChart and THBarChart, however a thought occurred to me that those of you with more scripting experience than me would maybe appreciate creating the charts yourself using something like the THGraphics external.

It is my intention to add more charts as time goes by but I thought it may be a catalyst for those with some spare time and ambition to create a library of charts for all to use.

Charts.zip
(147.95 KiB) Downloaded 222 times
Last edited by sctell on Sun Apr 17, 2011 5:57 am, edited 1 time in total.
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: Charts

Postby LorenzT » Wed Apr 13, 2011 11:59 pm

This looks great and is very well commented in the scripts!
One thing I would change, thou, would be the starting angle of the first segment. I don't know if this is a rule but in most cases the first segment starts at the 12 o'clock position.
And one more thing: the Apple segment is far too small!!! ;)
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: Charts

Postby sctell » Thu Apr 14, 2011 2:56 am

LorenzT wrote:One thing I would change, thou, would be the starting angle of the first segment. I don't know if this is a rule but in most cases the first segment starts at the 12 o'clock position.


Just change the tStartAngle and tEndAngle from 0 to 270 in the drawSegments and drawSegmentLabels and that will sort it.

I will change the project at the next issue.

LorenzT wrote:And one more thing: the Apple segment is far too small!!



Perhaps at the next issue it's segment will have grown ;)
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: Charts

Postby LorenzT » Thu Apr 14, 2011 8:48 am

Oh, it's THAT simple. I should have looked more closely at the scripts. :oops:

As you already made the calculations for positioning the value labels I guess it would be easy (?) to explode selected segments of the pie. Isn't it?
LorenzT
 
Posts: 176
Joined: Thu Dec 02, 2010 2:32 am
Location: Switzerland

Re: Charts

Postby sctell » Sun Apr 17, 2011 6:05 am

Hi all,

I have posted an update.

The project now contains:

1. A pie chart

2. A bar chart

The scripts are now contained in the graphic script for each type of chart, so they are self contained.

There are a limited number of user properties for each chart but others could be added, for example:

1. The colour of axes.
2. The font,colour & size of text for bars, labels, titles.
3. Line thicknesses.
4. Show ticks/don't show ticks.
5. Show grid lines/don't show grid lines.
6. Show/don't show axes.

I have implemented the charts so these items are easy to include.
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am


Return to Sample & Demo Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron