Area Chart

F1F2F3
L1 22 176
L2 23 67
L3 49 50
L4 150 95
L5 231 48
L6 280 102
L7 654 200
L8 534 100
L9 678 123
L10 654 32
L11 978 45
L12 654 100

Area Chart
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
  Dim CSV As String = "F1,F2,F3" & vbCrLf & "L1,22,176" & vbCrLf & "L2,23,67" & vbCrLf & "L3,49,50" & vbCrLf
  CSV &= "L4,150,95" & vbCrLf & "L5,231,48" & vbCrLf & "L6,280,102" & vbCrLf & "L7,654,200" & vbCrLf
  CSV &= "L8,534,100" & vbCrLf & "L9,678,123" & vbCrLf & "L10,654,32" & vbCrLf & "L11,978,45" & vbCrLf & "L12,654,100"
  Dim util As New Tornado.Util
  util.WriteFile(server.mappath("/tornado/scratch/TestArea.Csv", CSV)
  Dim Area As New Tornado.z
  With Area
    .dbQP = "U=5| S=14| PS=-1| Ni=none| M=Gc| Q=Select * From TestArea.Csv| Dt=TEXT| Pv=OLEDB"
    .dbDSN = "/tornado/scratch"
    .dbChartParams = "TitleString=3 Areas| xAxisTitle=My X-Axis Title| yAxisTitle=My Y-Axis Title| yAxisOptions=rotateTitle=true"
    .dbAreaChart = "leg=t|Label=#0#| Name0=Area Zero| Y0=#1#| Name1=Area One| Y1=#2#| Name2=User Area| Y2=321,543,890,123,890,576,400,300,200,250,400,500"
    .dbTextHolder = "Title=Area Chart"
    .ASPdbNET()
  End With
End Sub
</script>
Simplified AreaChart - Just specify the dbLineChart and override default parameters with dbChartParams.

This example creates a csv file with one label and 2 datasets, save to scratch directory and then open it as csv datasource with 3 columns - F1, F2 and F3. F1 is the label-axis and F2, F3 are the two datasets. The dbAreaChart will plot the two areas with default settings. A third line is created manually in dbChartParams with it's own settings.


Send comments on this example.
Copyright 1998-2006 ASP-db