<%@ language="vbscript" %>
<%
Set cd = CreateObject("ChartDirector.API")
normalDistribution = Array(0.011,0.044,0.135,0.325,0.607,0.882,1.000, _
0.882,0.607,0.325,0.135,0.044,0.011)
'Create a XYChart object of size 250 x 250 pixels
Set c = cd.XYChart(600, 300)
'Set the plotarea at (30, 20) and of size 200 x 200 pixels
Call c.setPlotArea(50, 20, 500, 250, cd.Transparent, cd.Transparent, cd.Transparent, _
cd.Transparent, cd.Transparent)
Call c.yAxis().setColors(cd.Transparent, cd.Transparent)
'Add a line chart layer using the given data
Set layer = c.addSplineLayer(normalDistribution)
midPoint = UBound(normalDistribution) / 2
Call c.xAxis().setLinearScale2(0, Ubound(normalDistribution), Nothing)
Call c.xAxis().addLabel(midPoint, "AAAA")
Call c.xAxis().addLabel(midPoint + 2, "BBBB")
Call c.xAxis().addLabel(midPoint - 2, "CCCC")
Call c.addScatterLayer(Array(midPoint), Array(normalDistribution(midPoint)), "", cd.CircleSymbol, 11, &Hff0000)
Call c.addInterLineLayer(c.yAxis().addMark(0, 0).getLine(), layer.getLine(), _
c.xZoneColor(midPoint - 2, cd.Transparent, c.xZoneColor(midPoint + 2, &Heeeeee, cd.Transparent)))
'output the chart
Response.ContentType = "image/png"
Response.BinaryWrite c.makeChart2(cd.PNG)
Response.End
%>
|