Home / Support / Swiff Chart Generator / Simple Line Chart - ASP
Knowledge Base

SAMPLE: Simple Line Chart - ASP

The information in this article applies to:

  • Swiff Chart Generator 2
  • Swiff Chart Generator 3

This example illustrates how to generate a simple line chart in ASP.

<% @Language=VBScript %> 
  Response.Expires= 0

  Dim chart

  Set chart= Server.CreateObject("SwiffChartObject.ChartObj")

  ' Fill the categories
  chart.SetCategoriesFromString "Q1;Q2;Q3;Q4"

  ' Fill the first series named "Sales Y1"
  chart.SetSeriesValuesFromString 0, "8;15;6;19"
  chart.SetSeriesCaption 0, "Sales Y1"

  ' Fill the second series named "Sales Y2"
  chart.SetSeriesValuesFromString 1, "23;8;12;14"
  chart.SetSeriesCaption 1, "Sales Y2"

  ' Set the chart title
  chart.SetTitle "Financial Results"
  chart.SetSubtitle "(Values in M$ - Year to year results)"

  ' Apply a Line style
  ' The chart type is stored in the style file (*.scs)
  ' Here the selected style is the predefined line style "Honolulu"
  chart.LoadStyle "line/Honolulu"
  chart.SetLooping false

  chart_res= chart.GetHTMLTag

  Set chart= Nothing

<H1>Line Chart</H1>

Keywords:ASP Line Chart

Swiff Chart Generator