TransWar File Browser

Path: C:\

<%@ language="vbscript" %>
<%
Set cd = CreateObject("ChartDirector.API")

' Get the selected year and month
selectedYear = CInt(Request("year"))
selectedMonth = CInt(Request("x")) + 1

'
' In real life, the data may come from a database based on selectedYear. In this
' example, we just use a random number generator.
'
seed = (selectedYear - 1992) * (100 + 3 * selectedMonth)
Set rantable = cd.RanTable(seed, 1, 4)
Call rantable.setCol(0, seed * 0.003, seed * 0.017)

data = rantable.getCol(0)

' The labels for the pie chart
labels = Array("Services", "Hardware", "Software", "Others")

' Create a PieChart object of size 600 x 240 pixels
Set c = cd.PieChart(600, 280)

' Set the center of the pie at (300, 140) and the radius to 120 pixels
Call c.setPieSize(300, 140, 120)

' Add a title to the pie chart using 18 pts Times Bold Italic font
Call c.addTitle("Revenue Breakdown for " & selectedMonth & "/" & selectedYear, _
    "timesbi.ttf", 18)

' Draw the pie in 3D with 20 pixels 3D depth
Call c.set3D(20)

' Set label format to display sector label, value and percentage in two lines
Call c.setLabelFormat("{label}<*br*>${value|2}M ({percent}%)")

' Set label style to 10 pts Arial Bold Italic font. Set background color to the same
' as the sector color, with reduced-glare glass effect and rounded corners.
Set t = c.setLabelStyle("arialbi.ttf", 10)
Call t.setBackground(cd.SameAsMainColor, cd.Transparent, cd.glassEffect( _
    cd.ReducedGlare))
Call t.setRoundedCorners()

' Use side label layout method
Call c.setLabelLayout(cd.SideLayout)

' Set the pie data and the pie labels
Call c.setData(data, labels)

' Create the image and save it in a temporary location
chart1URL = c.makeSession(Session, "chart1")

' Create an image map for the chart
imageMap = c.getHTMLImageMap("piestub.asp", "", "title='{label}:US$ {value|2}M'")
%>
<html>
<body style="margin:5px 0px 0px 5px">
<div style="font-size:18pt; font-family:verdana; font-weight:bold">
    Simple Clickable Pie Chart
</div>
<hr style="border:solid 1px #000080" />
<div style="font-size:10pt; font-family:verdana; margin-bottom:20">
    <a href="viewsource.asp?file=<%=Request("SCRIPT_NAME")%>">View Source Code</a>
</div>
<img src="getchart.asp?<%=chart1URL%>" border="0" usemap="#map1">
<map name="map1">
<%=imageMap%>
</map>
</body>
</html>