/ Home | Support | Swiff Chart Generator | Simple Pie Chart - ASP
Knowledge Base

SAMPLE: Simple Pie 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 pie chart in ASP.

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

  Dim chart

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

  ' Fill the series and categories
  categories= "USA;Germany;United Kingdom"
  chart.SetCategoriesFromString categories

  series= "45;28;16"
  chart.SetSeriesValuesFromString 0, series

  ' Set the chart title
  chart.SetTitle "Geographical Distribution"

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

  chart_res= chart.GetHTMLTag

  Set chart= Nothing
%>

<H1>Pie Chart</H1>
<br><%=chart_res%>

Keywords:ASP Pie Chart

Swiff Chart Generator