Assignment 2 - Graphing Tool


Note: There is a discussion page set up for this at http://pbl.cc.gatech.edu/cs2390/1557.html

Programming Assignment #2: A Graphing Tool

I want a reusable tool that takes an array of values (or two) and returns a Form of a graph of the set of values. Support both LineGraphs and BarGraphs. Display them, but also return them for use later. By default, include labels on the axes for values and for positions in the list. Assume that values will be between 0 and 1000, and that there may be as many as 50 values. Graphs should not be larger than 350 by 350 points.

Support all of the following:

MyGraphTool type: 'line' on: #(12 13 45).
"Display a line graph with these three values"

MyGraphTool type: 'bar' on: #(12 13 45). "Display a bar graph with these three values"

MyGraphTool type: 'line' on: #(12 13 45) and: #(2 10 45 20). "Display a line graph with both sets of values" MyGraphTool type: 'bar' on: #(1 2 3) and: #(4 5 6). "BarGraph's with two sets of values will always have the same number of elements in each set."

|f | f := MyGraphTool type: 'bar' formOn: #(12 13 45). "Return a Form with the BarGraph" f display. "Display the Form" MyGraphTool type: 'bar' on: #(12 13 45) with: #('City1' 'City2' 'City3'). "Label the bar graph with these names on the horizontal axis" MyGraphTool type 'line' on: #(12 13 45) with: #('City1' 'City2' 'City3'). "Label the line graph with these names on the horizontal axis" MyGraphTool type 'line' on: #(12 13 45) color: #('red' 'blue' 'yellow'). "Show this line graph with the data in the specified colors"

Scenarios

Extra Credit
If you do any of these, clearly document how the user accesses these features!

Hints, Issues, Suggestions

Grading Breakdown
50 points for the design doc -

50 points for code (5 for LineGraph, 5 for BarGraph on these) -


Back to the top | Over to CoWeb