Adding Tips and Hyperlinks to Data
One of the most powerful features of GraPL.NET is the way it allows you to associate hyperlinks with your data. This way, when the data values change you do not need to redraw any image maps to fit around the new bars or pie sectors.
The object of this short tutorial is to make a simple barchart where the bars act as jumps the finished chart should look rather like this:
Of course the main point here is to make the jumps work, so there is no real need to make the headings etc. look just-so if you dont want to.
Setting up the data
The first thing we must do is set up some simple test data notice that the hyperlinks are defined as an array of strings, matching the data in length.
' Initialise the data
Col_Website = Array("HTTP://www.ibm.com",
"HTTP://www.apl2000.com",
"HTTP://www.dyadic.com")
Col_Company = Array("IBM","Cognos","Dyadic")
Col_Sites = Array(1432,987,1421)
Now to plot the sites data as a very basic barchart:
' Using data-defined hyperlinks in a simple barchart
grapl.New 0,0,432,324
grapl.FrameStyle = "Wiped,Boxed"
grapl.Margins = array(48,48,64,36)
grapl.Heading = "APL Interpreters"
grapl.Subhead = "Worldwide Installed Base"
grapl.Footnote = "Do not believe these numbers!"
grapl.Style = "Forcezero,Horizontal,Redraw"
grapl.Gap = 0.7
grapl.YLabels = Col_Company
grapl.LabelFont = "AR,12,Navy"
grapl.Barchart Col_Sites
Response.Write grapl.RenderVML
If you try this in a standard ASP script, the chart will appear correctly, so the next stage is to bring it alive with some jumps, and maybe to add popup tips to the bars as well.
|