Example 47: Tornado chart sample
Steps:
1. Create a new Windows
application project (C#) and name it
Tutorial47_Tornado.
2. Add Super 2d/3d Graph
Library to the toolbox pallete and drag it
to Form1.
3. Copy and paste de
following code:
Note: the code in the
Form1_Load event could be used in ASP.NET
applications as well.
Form Code
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
using
Super2d3dGraphLibrary;
namespace
Tutorial47_Tornado
{
public
partial
class
Form1 :
Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(object
sender,
EventArgs
e)
{
// look & feel
super2d3dGraph1.LicenseeIdentifier =
"PROF";
super2d3dGraph1.Title =
"Tornado Chart Sample";
super2d3dGraph1.Style =
STYLE2D3D.STYLE2D_TORNADO;
super2d3dGraph1.YAxisScaleMode =
SCALEMODE.SCALEMODE_FIXED;
super2d3dGraph1.YAxisScaleMaximum
= 15;
super2d3dGraph1.YAxisScaleMinimum = 0;
super2d3dGraph1.YAxisLabelsRotated =
true;
super2d3dGraph1.ShowDividersX =
true;
super2d3dGraph1.ShowValues =
false;
// group descriptions
String[]
itemsLegend =
new
String[15];
for (int
k = 1; k <= 15; k++) { itemsLegend[k - 1] =
"Group "
+ k; }
super2d3dGraph1.ItemsLegend = itemsLegend;
super2d3dGraph1.XAxisLabelsRotated90 =
true;
super2d3dGraph1.ShowXAxis =
true;
// legend & datatable
super2d3dGraph1.LegendAlignment =
STYLEALIGNMENT.STYLEALIGNMENT_TOP_CENTER;
super2d3dGraph1.LegendText =
"Sections";
String[]
seriesLegend =
new
String[]
{
"Section 1",
"Section 2"
};
super2d3dGraph1.SeriesLegend = seriesLegend;
super2d3dGraph1.DataTableText =
"Data";
super2d3dGraph1.DataTableFont =
new
Font("Tahoma",
10);
super2d3dGraph1.ShowItemsLegend =
true;
super2d3dGraph1.ShowLegendInDataTable =
true;
// data
SeriesFactory
sf =
new
SeriesFactory();
Random
rnd =
new
Random();
for (int
k = 0; k < 8; k++)
{
sf.AddValue(rnd.Next(15));
}
sf.NewSerie();
for (int
k = 0; k < 8; k++)
{
sf.AddValue(rnd.Next(15));
}
sf.ApplyTo(super2d3dGraph1);
}
}
}
Result:

|