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

SAMPLE: Simple Line Chart - ASP.NET

The information in this article applies to:

  • Swiff Chart Generator 3

This example illustrates how to generate a simple line 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_Line : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
// Set the heading for the graph
chart.Title"Financial Results";
chart.Subtitle"(Values in M$ - Quarter results)";

// Set chart categories
chart.SetCategoriesFromArray(new string[] { "Q1""Q2""Q3" });

// Fill chart series
chart.SetSeriesCaption(0"First Series");
chart.SetSeriesValuesFromArray(0new double[] { 1.23.511.});

chart.SetSeriesCaption(1"Second Series");
chart.SetSeriesValuesFromArray(1new double[] { 2.34.59.});

chart.SetSeriesCaption(2"Third Series");
chart.SetSeriesValuesFromArray(2new double[] { 3.25.514.});

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

Keywords:ASP.NET Line Chart

Swiff Chart Generator