Graphing Library Description
This graphing system is a set of library routines and classes which can be included in any MFC windows application to give the developer the ability to display data in the form of a graph. The distribution file is basically just a winzipped version of the folder where I made the project. I included all of the source code and project settings from Visual C++, so that you can just download, unzip it, and then start reading the help files There are several graph types which can be displayed.

Linear Graph
The Linear graph can display data as a Line, SemilogX, SemilogY, or a LogLog graph. The Line graph is the typical 2 dimensional graph with a x, and y axis. The SemilogX graph is virtually identical, except that the x axis uses a logarithmic scale instead of a linear scale. The SemilogY uses a logarithmic y axis, and the LogLog graph has both axis's with log scales. The data for this type of graph is a sequential list of x and y points. For instance, to graph the function y = 5*x, you would set up a loop and evaluate y for a range of x values and store those values for each iteration at the end of a list. This data list would then be passed to a graph class, and the program would call the MakeGraph function to display the data. All data and graph classes are included so there is no need to spend time creating them yourself. Once the graph is displayed on the screen then it is possible for the user to alter any of the attributes interactively by using the attributes dialog box.

Pie Graph
The Pie graph is similar to the type of graph that can be found in Excel. It takes some data and displays it as a circle where each wedge represents the portion of the pie that this element takes up. For instance, lets say you want to see what portion of the this years budget goes to Social Security. You would pass the dollar amount of every program that the government spent money on this year (a BIG job) into the pie graph, and it would calculate the percentage for each element. Then you just call the MakeGraph function and the graph is displayed showing you the answer graphically.

Bar Graph
The Bar Graph is also virtually identical to the type used in spreadsheets. It takes some data and displays it at a series of bars. If, instead of looking at this years budget, you wanted to see how the national debt has grown over the last 50 years then you would pass in the debt figure for each year into the bar graph and call the MakeGraph function. This would display a graph where the x axis would be the year and the height of the individual bars would represent the debt during that year.

Histogram
The Histogram is based on the bar graph but it has a slight twist. It is primarily used to count the frequency of data items. For instance, lets say that you are a biologist who is studying the hubba-bubba moth, and you are interested in the size of the moths. So, you go out and capture 1000 moths and rate the size of each moth. To make a histogram of this data then you would need to setup how many bars you wanted to see and how big they are. Like, 20 bars ranging from size 0 to 20 centimeters, where each bar is one centimeter. Then you would pass in the size data for each moth and call the MakeGraph function to display the data. What you would get is a graph consisting of 20 bars, where the height of each bar is determined by how many of the moths fell within its size. For instance, if the were 10 moths between 3 and 4 centimeters wide, then the 3 cm. Bar would be 10 units high and so on. This allows you to see the how often some event occurred, or its frequency.
This page hosted by
Get your own Free Home Page