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

SAMPLE: Simple Pie Chart - ASP.NET

The information in this article applies to:

  • Swiff Chart Generator 3

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

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using GlobFX.SwiffChartGenerator;

public partial class CSharp_QuickStarts_Pie : System.Web.UI.Page
{
    
protected void Page_Load(object sender, EventArgs e)
    {
      
// Set the heading for the graph
      
chart.Title"Geographical Distribution";

      
// Set chart categories
      
chart.SetCategoriesFromArray( new string[] { "USA""Germany""United Kingdom" } );

      
// Fill chart series
      
chart.SetSeriesValuesFromArray( 0new double[] { 45.328.416.} );

      
// 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.Looping= false;
    
}
}

Keywords:ASP.NET Pie Chart

Swiff Chart Generator