Overview of Graphing Articles
Introduction
- A number of resources are already available on the
internet for adding graphing functionality to
ASP-based websites.
- At the time of writing (February 2001) these resources
are limited. You must either
- Plot very limited graphs (typical ASP examples
allow you to plot ONE series in a bar graph); OR
- Install COM components on your server, which
render the graphs, convert the output to JPG or
GIF format, and then send the bitmap to the
client.
- The articles in this series will focus on how you
can add decent graphing functionality using pure ASP,
without requiring that the end user install plug-ins into
their browser.
- At present these articles are not Netscape friendly.
I haven't included examples of graphs that display
correctly in Netscape 4.7 or 6. However, this not
because the graph includes do not support Netscape;
it is because
- The current version of the graphing include
writes out browser-specific HTML
(it detects the browser type itself) to keep
down the page weight.
- As I am, for now, publishing to a site that
allows only static pages, building Netscape
versions of all the files would take me a lot
of extra time.
- One handy feature (offsetting images so that
pie slices and stacked areas can display them
correctly) does not work for Netscape yet.
Articles
- An ASP graphing include
This article provides working demonstrations of graphs
generated by an ASP graphing include that I have written.
The source code of the include
is also available, as a text file, with a test script that
feeds it canned data, allowing you to view several different
types of graph.
There are also links to some graph types that - at
present - require large page sizes.
The article discusses some of the limitations of the
graphing include, and talks about some of the directions
I am considering taking it.
-
Graphing in HTML
This article (not written yet) is to provide an
introduction to the rendering techniques used in the ASP graphing include from
article#1. It discusses
in detail how, for example, you might go about
- Adding labels and captions to your graphs
- Plotting bar charts with multiple series
- Plotting X/Y scatter graphs
- Plotting lines in HTML
- Plotting non-rectangular shapes
- Plotting stacked area graphs
- Plotting pie charts
- Plotting arbitraty shapes
The focus here is on what you have to tell the browser
to do. The next article discusses how you might go from
raw data to scaled and labelled graphs.
-
Implementation Details
This article discusses the implementation details of the
graphing include provided in
article#1.
In turn, it discusses such features as
- How to scale data for plotting
- How to render axes and grid lines
- How to assign labels to axes or data points
- How stacked area charting scan-lines are calculated
- How pie chart scan-lines are calculated
- Cross-browser rendering differences and issues
- How to render multiple series on one chart
There is also some discussion of techniques that are not
directly related to graphing, but have a more general
application (each of these is used in the include):
- Passing functions VB expressions to be evaluated
later
- Array primitives
- Routines for modifying columns of an array
- Routines for sorting arrays
- Routines for finding distinct values in a column
-
Javascript Graphing Functions
This (planned) article is to discuss the issues involved in
implementing graphing functionality, in client-side Javascript.
Surprisingly, it is not much more difficult to implement graphing
in Javascript. Where the ASP version writes HTML to the Response,
the client-side javascript version would write HTML to either a
DIV tag (in Internet Explorer) or to the document of the corresponding LAYER
(in Netscape).
Client-side graphing would have a number of advantages:
- Average page weight would decrease, particularly for
line, pie, and stacked area graphs
- It would be possible to change the graph type, on the
client, without a round trip to the server.
- With some tweaking, and additional code, it would be
possible to provide functionality like "zoom in"
and "zoom out". It would also be possible to
apply filters to graphs, and to switch graphing layers
on and off (for example, in a line+point graph you'd
be able to turn off the lines, or turn off the points,
at will).