Path: C:\
<%@ language="vbscript" %>
<%
Set cd = CreateObject("ChartDirector.API")
'
' Retrieve the data from the query parameters
'
selectedYear = Request("year")
software = Split(Request("software"), ",")
hardware = Split(Request("hardware"), ",")
services = Split(Request("services"), ",")
'
' Now we obtained the data into arrays, we can draw the chart using ChartDirector
'
' Create a XYChart object of size 600 x 300 pixels, with a light grey (eeeeee)
' background, black border, 1 pixel 3D border effect and rounded corners.
Set c = cd.XYChart(600, 300, &Heeeeee, &H000000, 1)
Call c.setRoundedFrame()
' Set the plotarea at (60, 60) and of size 520 x 200 pixels. Set background color to
' white (ffffff) and border and grid colors to grey (cccccc)
Call c.setPlotArea(60, 60, 520, 200, &Hffffff, -1, &Hcccccc, &Hccccccc)
' Add a title to the chart using 15pts Times Bold Italic font, with a light blue
' (ccccff) background and with glass lighting effects.
Call c.addTitle("Global Revenue for Year " & selectedYear, "timesbi.ttf", 15 _
).setBackground(&Hccccff, &H000000, cd.glassEffect())
' Add a legend box at (70, 32) (top of the plotarea) with 9pts Arial Bold font
Call c.addLegend(70, 32, False, "arialbd.ttf", 9).setBackground(cd.Transparent)
' Add a line chart layer using the supplied data
Set layer = c.addLineLayer2()
Call layer.addDataSet(software, &Hff0000, "Software").setDataSymbol(cd.CircleShape,9)
Call layer.addDataSet(hardware, &H00ff00, "Hardware").setDataSymbol( _
cd.DiamondShape, 11)
Call layer.addDataSet(services, &Hffaa00, "Services").setDataSymbol(cd.Cross2Shape( _
), 11)
' Set the line width to 3 pixels
Call layer.setLineWidth(3)
' Set the x axis labels. In this example, the labels must be Jan - Dec.
labels = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", _
"Oct", "Nov", "Dec")
Call c.xAxis().setLabels(labels)
' Set the y axis title
Call c.yAxis().setTitle("USD (Millions)")
' Set axes width to 2 pixels
Call c.xAxis().setWidth(2)
Call c.yAxis().setWidth(2)
' Output the chart in PNG format
Response.ContentType = "image/png"
Response.BinaryWrite c.makeChart2(cd.PNG)
Response.End
%>