Graph Maker

by Jason Peasgood

 

Issue 32

Mar/Apr 88

Next Article >>

<< Prev Article

 

 

Jason Peasgood presents a utility for pie charts, bar graphs and line graphs for simple home use. The program is suitable for the 1029 printer but we have added a routine for Epson compatibles

Many Atari owners use their computers for some sort of business or record keeping so here is a simple utility to give all those dry figures a bit of sparkle. Graph Maker is not a super sophisticated program like the commercial B/Graph but it will produce neat graphs of various figures, percentages etc. which can be dumped out on a 1029, Epson or fully Epson compatible printer.

The program gives you a choice of either a Pie Chart, usually chosen for showing percentages of a base number, a Bar Chart for showing comparative values of different objects or a Line Graph, used for showing different values over a period of time.

The main listing for Graph Maker will print out graphs on a 1029 printer, but owners of Epson or Epson compatible printers can omit lines 30000 to 30150 from Listing 1 and use Listing 2 - instead. Just leave Listing 1 in memory and carry on typing Listing 2. Listing 2 can also be used as a stand alone routine for a Graphics 8 screen dump on an Epson or compatible printer:

PREPARING YOUR GRAPHS

The program has many easy to understand prompts throughout but details of each type of graph are given here for reference.

PIE CHART: This option allows you to show percentages of any number neatly in an accurately segmented circle. After the initial circle has been drawn you will be asked to input the base number. This is the total that the segments of the pie chart will be percentages of. You will then be asked for the number of fields you require which is the number of segments that the total will be divided into, so if you wanted 5 segments you would type 5.

The name and size of each field is then requested. The size should not be input as a percentage, but as the actual number it represents. Each segment is then calculated and drawn, and the name is printed next to it. After all the segments have been named and drawn you are asked for the title of the chart. You will finally be given the option of either dumping the screen to a printer, or creating another graph.

BAR CHART: You can use this option to create graphs with up to 36 bars across (the x-axis), and a wide range of scales are available on the y-axis.

After choosing the number of bars you want you are asked for the smallest number you want on the y-axis, which can be any number from 0-49. Next you are asked for the maximum, which can be any number from 1-50, as long as it is larger than the minimum number, but the difference between the two cannot be more than 18. The numbers on the y-axis are then plotted, with the scale calculated automatically thus using as much of the screen as possible.

The height of each bar is then requested. You must calculate the figures according to the scale selected and you can only enter whole numbers up to the maximum chosen. After the bar chart is drawn you are asked if you want to create another graph or print the current one. If you choose to print it you will be asked for individual names for each bar, and labels for both axes.

LINE GRAPH: This can be used to create a line graph, similar to the sort you see on a manager's office wall referring to sales over an amount of time, but the figures could represent anything such as the increase in a baby's weight over a given period of time for example.

You will first be asked for the number of points you want plotted, up to a maximum of 36. You are then asked for the y-axis scale and the value of the points on the x-axis, with the same rules applying as for the bar chart. The points are then plotted, according to the numbers that were entered, and joined up. When this is complete you are again asked if you want to dump this graph to a printer, or create another graph. If you choose to print it you will be asked for axis labels but you have a choice whether you want individual labels for each point or if the x-axis label is the general name. For example the x-axis could be called 'November' or each point on the x-axis could be a separate day/date.

ROUTINES INCLUDED

General routines included in the program are a short program for printing text quickly onto a Graphics 8 screen and a routine for drawing an accurate circle. The printer dump routine is a Graphics 8 screen dump for the 1029 and starts at line 30000. Remember, if you have an Epson printer, use Listing 2 instead.

FINALLY ...

This program may not be as sophisticated as commercial products like Mini Office II or B/Graph, but it is a cheap and effective way to produce simple graphs and charts which should cope well for small every day needs like who pays what percentage of the telephone bill!

  AtariLister - requires Java

top