Gallery
Surface Designer
<%@ Page Language="C#" Description="dotnetCHARTING Component" AutoEventWireup="true" %>
<%@ Register TagPrefix="dnc" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="dotnetCHARTING.Mapping" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
populateControls();
// Demonstrates usage of the box header properties and code to generate them.
// It is meant to be used as a box header designer offering all the properties necessary to create all the styles.
updateChart();
}
// This method populates the color dropdown controls.
void populateColors()
{
populateColors(meshColor);
populateColors(seriesLineColor);
populateColors(meshColor2);
populateColors(seriesLineColor2);
populateColors(meshColor3);
populateColors(seriesLineColor3);
populateColors(meshColor4);
populateColors(seriesLineColor4);
}
void populateColors(DropDownList dlist)
{
int hi = dlist.SelectedIndex;
if (dlist.Items.Count == 0) hi = 136;
dlist.Items.Clear();
bool startNow = false;
// Exclude Control, Active, Menu, Text
foreach (string s in Enum.GetNames(typeof(System.Drawing.KnownColor)))
{
if (s == "AliceBlue") startNow = true;
if (startNow && !s.Contains("Menu") && !s.Contains("Button") && !s.Contains("Caption"))
{
ListItem li = new ListItem(s);
ListItem li2 = new ListItem(s);
li.Attributes.Add("style", "background-color:" + s);
li2.Attributes.Add("style", "background-color:" + s);
dlist.Items.Add(li);
}
}
dlist.SelectedIndex = hi;
}
void populateControls()
{
populateColors();
int ei = elevation.SelectedIndex;
int ai = azimuth.SelectedIndex;
int ti = seriesLineTransparecy.SelectedIndex;
int ali = meshTransparency.SelectedIndex;
int et = defaultElementTransparency.SelectedIndex;
int ti2 = seriesLineTransparecy2.SelectedIndex;
int ali2 = meshTransparency2.SelectedIndex;
int et2 = defaultElementTransparency2.SelectedIndex;
int ti3 = seriesLineTransparecy3.SelectedIndex;
int ali3 = meshTransparency3.SelectedIndex;
int et3 = defaultElementTransparency3.SelectedIndex;
int ti4 = seriesLineTransparecy4.SelectedIndex;
int ali4 = meshTransparency4.SelectedIndex;
int et4 = defaultElementTransparency4.SelectedIndex;
if (ei == 0 && ai == 0)
{
ei = 3; ai = 3; ti = 0; ali = 0; et = 0; ti2 = 0; ali2 = 0;
et2 = 0; ti3 = 0; ali3 = 0; et3 = 0; ti4 = 0; ali4 = 0; et4 = 0;
}
populateNumericControl(elevation, 0, 90, 15, ei);
populateNumericControl(azimuth, 0, 180, 15, ai);
populateNumericControl(meshTransparency, 0, 100, 10, ali);
populateNumericControl(seriesLineTransparecy, 0, 100, 10, ti);
populateNumericControl(defaultElementTransparency, 0, 100, 10, et);
populateNumericControl(meshTransparency2, 0, 100, 10, ali2);
populateNumericControl(seriesLineTransparecy2, 0, 100, 10, ti2);
populateNumericControl(defaultElementTransparency2, 0, 100, 10, et2);
populateNumericControl(meshTransparency3, 0, 100, 10, ali3);
populateNumericControl(seriesLineTransparecy3, 0, 100, 10, ti3);
populateNumericControl(defaultElementTransparency3, 0, 100, 10, et3);
populateNumericControl(meshTransparency4, 0, 100, 10, ali4);
populateNumericControl(seriesLineTransparecy4, 0, 100, 10, ti4);
populateNumericControl(defaultElementTransparency4, 0, 100, 10, et4);
}
void populateNumericControl(DropDownList dlist, int start, int end, int step, int defaultSelectedIndex)
{
int si = dlist.SelectedIndex;
dlist.Items.Clear();
for (int i = start; i <= end; i += step)
{
ListItem li = new ListItem(i.ToString());
dlist.Items.Add(li);
}
if (defaultSelectedIndex == -1)
dlist.SelectedIndex = si;
else
dlist.SelectedIndex = defaultSelectedIndex;
}
// Apply the chart settings.
void updateChart()
{
closeUnusedSeries();
updateCode();
Chart c = new Chart();
c.Size = "800x550";
c.TempDirectory = "temp";
c.Debug = true;
c.Type = ChartType.Surface;
c.YAxis.Label.Text = "Y Axis";
c.XAxis.Label.Text = "X Axis";
c.ZAxis.Label.Text = "z Axis";
c.DefaultAxis.DefaultTick.Line.Length = 15;
c.LegendBox.Visible = false;
c.MarginTop = 20;
c.View3D.EnableLighting = EnableLighting.Checked;
if (Use3DCheckBox.Checked)
c.Use3D = true;
else
c.Use3D = false;
c.View3D.AngleOfRotation = int.Parse(azimuth.SelectedItem.Text);
c.View3D.AngleOfTilt = int.Parse(elevation.SelectedItem.Text);
bool distort = false;
SeriesCollection mySC = null;
if (dataSet.Text == "1")
mySC = getRData(distort);
else if (dataSet.Text == "2")
mySC = getRData2(distort);
else if (dataSet.Text == "3")
mySC = getRData3(distort);
else if (dataSet.Text == "4")
mySC = getRData4(distort);
else if (dataSet.Text == "5")
mySC = getRData5(distort);
if (colorType.Text == "1")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.Yellow, Color.Red);
}
else if (colorType.Text == "2")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.LimeGreen, Color.Yellow);
}
else if (colorType.Text == "3")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.Red, Color.Yellow, Color.YellowGreen);
}
else if (colorType.Text == "4")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.Aqua, Color.Yellow);
}
else if (colorType.Text == "5")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.Blue, Color.Aqua, Color.Green, Color.Yellow, Color.Orange, Color.Red, Color.Pink);
}
else if (colorType.Text == "6")
{
c.SmartPalette = mySC[0].GetSmartPalette(ElementValue.ZValue, Color.Blue, Color.Aqua, Color.LightGreen, Color.Yellow, Color.Orange, Color.Red, Color.Crimson, Color.White);
}
// Add the random data.
c.SeriesCollection.Add(mySC);
// First Series
Series s1 = mySC[0];
if (Use3DCheckBox.Checked)
s1.Use3D = true;
s1.Type = (SeriesTypeSurface)Enum.Parse(typeof(SeriesTypeSurface), surfaceType.SelectedItem.Text);
s1.DefaultElement.DrawToFloor = DropToFloor.Checked;
s1.InterpolationFillFactor = int.Parse(numberInterp.Text);
s1.ContourCount = int.Parse(numberContours.Text);
if (seriesLineColor.SelectedItem.Text != "White" || seriesLineTransparecy.Text != "250")
s1.Line.DashStyle = (DashStyle)Enum.Parse(typeof(DashStyle), seriesLineDashStyle.SelectedItem.Text);
s1.Line.Width = int.Parse(seriesLineWidth.Text);
s1.DefaultElement.Transparency = int.Parse(defaultElementTransparency.SelectedItem.Text);
if (seriesBackgroundColorCheckBox.Checked)
s1.Background.Color = (Color)(new ColorConverter()).ConvertFromString(meshColor.SelectedItem.Text);
if (seriesLineColorCheckBox.Checked)
s1.Line.Color = (Color)(new ColorConverter()).ConvertFromString(seriesLineColor.SelectedItem.Text);
s1.Background.Transparency = int.Parse(meshTransparency.Text);
s1.Line.Transparency = int.Parse(seriesLineTransparecy.Text);
// Second series
if (surfaceType2.Text != "None")
{
Series s2 = new Series();
if (seriesLineColor2.SelectedItem.Text != "White" || seriesLineTransparecy2.Text != "250")
s2.Line.DashStyle = (DashStyle)Enum.Parse(typeof(DashStyle), seriesLineDashStyle2.SelectedItem.Text);
s2.Line.Width = int.Parse(seriesLineWidth2.Text);
s2.DefaultElement.DrawToFloor = DropToFloor2.Checked;
s2.InterpolationFillFactor = int.Parse(numberInterp2.Text);
s2.ContourCount = int.Parse(numberContours2.Text);
s2.DefaultElement.Transparency = int.Parse(defaultElementTransparency2.SelectedItem.Text);
if (seriesBackgroundColorCheckBox2.Checked)
s2.Background.Color = (Color)(new ColorConverter()).ConvertFromString(meshColor2.SelectedItem.Text);
if (seriesLineColorCheckBox2.Checked)
s2.Line.Color = (Color)(new ColorConverter()).ConvertFromString(seriesLineColor2.SelectedItem.Text);
s2.Background.Transparency = int.Parse(meshTransparency2.Text);
s2.Line.Transparency = int.Parse(seriesLineTransparecy2.Text);
s2.Type = (SeriesTypeSurface)Enum.Parse(typeof(SeriesTypeSurface), surfaceType2.SelectedItem.Text);
if (Use3DCheckBox2.Checked)
s2.Use3D = true;
else
s2.Use3D = false;
c.SeriesCollection.Add(s2);
}
// Third series
if (surfaceType3.Text != "None")
{
Series s3 = new Series();
if (seriesLineColor3.SelectedItem.Text != "White" || seriesLineTransparecy3.Text != "250")
s3.Line.DashStyle = (DashStyle)Enum.Parse(typeof(DashStyle), seriesLineDashStyle3.SelectedItem.Text);
s3.Line.Width = int.Parse(seriesLineWidth3.Text);
s3.DefaultElement.DrawToFloor = DropToFloor3.Checked;
s3.InterpolationFillFactor = int.Parse(numberInterp3.Text);
s3.ContourCount = int.Parse(numberContours3.Text);
s3.DefaultElement.Transparency = int.Parse(defaultElementTransparency3.SelectedItem.Text);
if (seriesBackgroundColorCheckBox3.Checked)
s3.Background.Color = (Color)(new ColorConverter()).ConvertFromString(meshColor3.SelectedItem.Text);
if (seriesLineColorCheckBox3.Checked)
s3.Line.Color = (Color)(new ColorConverter()).ConvertFromString(seriesLineColor3.SelectedItem.Text);
s3.Background.Transparency = int.Parse(meshTransparency3.Text);
s3.Line.Transparency = int.Parse(seriesLineTransparecy3.Text);
s3.Type = (SeriesTypeSurface)Enum.Parse(typeof(SeriesTypeSurface), surfaceType3.SelectedItem.Text);
if (Use3DCheckBox3.Checked)
s3.Use3D = true;
else
s3.Use3D = false;
c.SeriesCollection.Add(s3);
}
// Fourth series
if (surfaceType4.Text != "None")
{
Series s4 = new Series();
if (seriesLineColor4.SelectedItem.Text != "White" || seriesLineTransparecy4.Text != "250")
s4.Line.DashStyle = (DashStyle)Enum.Parse(typeof(DashStyle), seriesLineDashStyle4.SelectedItem.Text);
s4.Line.Width = int.Parse(seriesLineWidth4.Text);
s4.DefaultElement.DrawToFloor = DropToFloor4.Checked;
s4.InterpolationFillFactor = int.Parse(numberInterp4.Text);
s4.ContourCount = int.Parse(numberContours4.Text);
s4.DefaultElement.Transparency = int.Parse(defaultElementTransparency4.SelectedItem.Text);
if (seriesBackgroundColorCheckBox4.Checked)
s4.Background.Color = (Color)(new ColorConverter()).ConvertFromString(meshColor4.SelectedItem.Text);
if (seriesLineColorCheckBox3.Checked)
s4.Line.Color = (Color)(new ColorConverter()).ConvertFromString(seriesLineColor4.SelectedItem.Text);
s4.Background.Transparency = int.Parse(meshTransparency4.Text);
s4.Line.Transparency = int.Parse(seriesLineTransparecy4.Text);
s4.Type = (SeriesTypeSurface)Enum.Parse(typeof(SeriesTypeSurface), surfaceType4.SelectedItem.Text);
if (Use3DCheckBox4.Checked)
s4.Use3D = true;
else
s4.Use3D = false;
c.SeriesCollection.Add(s4);
}
Annotation an = new Annotation(getSwatch(200, c.SmartPalette, 15, true));
an.Position = new Point(80, 3);
an.ClearColors();
an.DynamicSize = false;
c.Annotations.Add(an);
chartImage.ImageUrl = c.FileManager.SaveImage();
}
string getSwatch(int width, SmartPalette sp, int divisions, bool withValues)
{
// Get Maximum Value of the smart palette range
double max = (double)sp.GetScaleRange("*").ValueHigh;
double min = (double)sp.GetScaleRange("*").ValueLow;
string swatch = "", spacers = "";
double step = (max - min) / divisions;
// Width of each division.
int boxWidth = width / divisions;
// Generate swatch string for each division.
for (int i = 0; i <= divisions; i++)
{
spacers += "<Chart:Spacer size='" + boxWidth + "x1'>";
// Get the color of the current division.
string color = getHTMLColor(sp.GetValueColor("", min + (i * (step))));
if (withValues)
swatch += "<block hAlignment='Center' bgColor='" + color + "'>" + Math.Round((min + (i * (step))), 1);
else
swatch += "<block bgColor='" + color + "' fColor='" + color + "'>_";
}
//return the swatch string.
return spacers + "<row>" + swatch;
}
string getHTMLColor(Color c)
{
return "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
}
SeriesCollection getRData(bool distort)
{
Random myR = new Random();
SeriesCollection SC = new SeriesCollection();
double[][] zVals = new double[9][];
zVals[0] = new double[] { 0.00, -1.75, -3.00, -3.75, -4.00, -3.75, -3.00, -1.75, 0.00 };
zVals[1] = new double[] { 1.75, 0.00, -1.25, -2.00, -2.25, -2.00, -1.25, 0.00, 1.75 };
zVals[2] = new double[] { 3.00, 1.25, 0.00, -0.75, -1.00, -0.75, 0.00, 1.25, 3.00 };
zVals[3] = new double[] { 3.75, 2.00, 0.75, 0.00, -0.25, 0.00, 0.75, 2.00, 3.75 };
zVals[4] = new double[] { 4.00, 2.25, 1.00, 0.25, 0.00, 0.25, 1.00, 2.25, 4.00 };
zVals[5] = new double[] { 3.75, 2.00, 0.75, 0.00, -0.25, 0.00, 0.75, 2.00, 3.75 };
zVals[6] = new double[] { 3.00, 1.25, 0.00, -0.75, -1.00, -0.75, 0.00, 1.25, 3.00 };
zVals[7] = new double[] { 1.75, 0.00, -1.25, -2.00, -2.25, -2.00, -1.25, 0.00, 1.75 };
zVals[8] = new double[] { 0.00, -1.75, -3.00, -3.75, -4.00, -3.75, -3.00, -1.75, 0.00 };
if (distort)
for (int x = 0; x < zVals.Length; x++)
{
for (int i = 0; i < zVals[x].Length; i++)
zVals[x][i] += -.5f + (myR.Next(10) / 10f);
}
Series s = Series.FromSurfaceData("", new double[] { -2, -1.5, -1, -.5, 0, .5, 1, 1.5, 2 }, new double[] { -2, -1.5, -1, -.5, 0, .5, 1, 1.5, 2 }, zVals);
SC.Add(s);
return SC;
}
SeriesCollection getRData2(bool distort)
{
Random r = new Random();
int size = 50;
double xMin = -2;
double xSpacing = .1;
double yMin = -2;
double ySpacing = .1;
double[][] zVals = new double[size][];
double[] xVals = new double[size];
double[] yVals = new double[size];
for (int i = 0; i < size; i++)
{
zVals[i] = new double[size];
for (int j = 0; j < size; j++)
{
float distortion = (-.5f + (float)r.Next(20) / 20);
if (!distort) distortion = 0;
double x = (double)(xMin + i * xSpacing);
double y = (double)(yMin + j * ySpacing);
xVals[i] = x;
yVals[j] = y;
double z = 3 * Math.Pow((1 - x), 2) * Math.Exp(-x * x -
(y + 1) * (y + 1)) - 10 * (0.2 * x - Math.Pow(x, 3) -
Math.Pow(y, 5)) * Math.Exp(-x * x - y * y) -
1 / 3 * Math.Exp(-(x + 1) * (x + 1) - y * y);
yVals[j] = y;
zVals[i][j] = z + distortion;
}
}
SeriesCollection SC = new SeriesCollection();
Series s = Series.FromSurfaceData("", xVals, yVals, zVals);
SC.Add(s);
return SC;
}
SeriesCollection getRData3(bool distort)
{
Random r = new Random();
int size = 30;
double xMin = -2;
double xSpacing = .1;
double yMin = -2;
double ySpacing = .1;
double[][] zVals = new double[size][];
double[] xVals = new double[size];
double[] yVals = new double[size];
for (int i = 0; i < size; i++)
{
zVals[i] = new double[size];
for (int j = 0; j < size; j++)
{
float distortion = (-.2f + (float)(r.Next(20) / 20f) * .4f);
if (!distort) distortion = 0;
double x = (double)(xMin + i * xSpacing);
double y = (double)(yMin + j * ySpacing);
xVals[i] = x;
yVals[j] = y;
double z = Math.Sin(x * 2.2) + Math.Cos(y);
zVals[i][j] = z + distortion;
}
}
SeriesCollection SC = new SeriesCollection();
Series s = Series.FromSurfaceData("", xVals, yVals, zVals);
SC.Add(s);
return SC;
}
SeriesCollection getRData4(bool distort)
{
Random r = new Random();
int size = 30;
double xMin = -2;
double xSpacing = .1;
double yMin = -2;
double ySpacing = .1;
double[][] zVals = new double[size][];
double[] xVals = new double[size];
double[] yVals = new double[size];
for (int i = 0; i < size; i++)
{
float distortion = (-.5f + (float)r.Next(20) / 20);
if (!distort) distortion = 0;
zVals[i] = new double[size];
for (int j = 0; j < size; j++)
{
double x = (double)(xMin + i * xSpacing);
double y = (double)(yMin + j * ySpacing);
xVals[i] = x;
yVals[j] = y;
double z = Math.Atan(x) - Math.Atan(y * 2) * 10;
zVals[i][j] = z + distortion;
}
}
SeriesCollection SC = new SeriesCollection();
Series s = Series.FromSurfaceData("", xVals, yVals, zVals);
SC.Add(s);
return SC;
}
SeriesCollection getRData5(bool distort)
{
Random r = new Random();
int size = 25;
double xMin = -2;
double xSpacing = .1;
double yMin = -2;
double ySpacing = .1;
double[][] zVals = new double[size][];
double[] xVals = new double[size];
double[] yVals = new double[size];
Series s = new Series();
for (int i = 0; i < size; i++)
{
zVals[i] = new double[size];
for (int j = 0; j < size; j++)
{
float distortion = (-.5f + (float)r.Next(20) / 20);
if (!distort) distortion = 0;
double x = (double)(xMin + i * xSpacing);
double y = (double)(yMin + j * ySpacing);
xVals[i] = x;
yVals[j] = y;
double z = Math.Sin(x * 3.2) + Math.Cos(y * 2) + Math.Sin(x * 1.2) + Math.Sin(y * 1.2);
zVals[i][j] = z + distortion;
Element e = new Element();
e.XValue = x;
e.YValue = y;
e.ZValue = z + distortion;
s.Elements.Add(e);
}
}
SeriesCollection SC = new SeriesCollection();
SC.Add(s);
return SC;
}
// This method generates code necessary to create the annotation visual.
void updateCode()
{
string code = "";
code += "private void applySurfaceStyling(Chart chart, SeriesCollection mySC)\n";
code += "{\n";
code += "\tchart.Type = ChartType.Surface;\n";
if (azimuth.SelectedItem.Text != "45")
code += "\tchart.Surface.AngleOfRotation = " + azimuth.SelectedItem.Text + ";\n";
if (elevation.SelectedItem.Text != "45")
code += "\tchart.Surface.AngleOfTilt = " + elevation.SelectedItem.Text + ";\n";
if (!EnableLighting.Checked)
code += "\tchart.Surface.EnableLighting = false;\n";
// Series 1
code += "\tSeries s1 = mySC[0];\n";
code += "\ts1.Use3D = " + Use3DCheckBox.Checked.ToString().ToLower() + ";\n";
if (surfaceType.SelectedItem.Text != "Surface")
code += "\ts1.Type = SeriesTypeSurface." + surfaceType.SelectedItem.Text + ";\n";
if (DropToFloor.Checked)
code += "\ts1.DefaultElement.DrawToFloor = true;\n";
if (numberInterp.Text != "1")
code += "\ts1.InterpolationFilFactor = " + numberInterp.Text + ";\n";
if (numberContours.Text != "10")
code += "\ts1.ContourCount = " + numberContours.Text + ";\n";
if (seriesLineDashStyle.SelectedItem.Text != "Solid")
code += "\ts1.Line.DashStyle = DashStyle." + seriesLineDashStyle.SelectedItem.Text + ";\n";
if (seriesLineWidth.Text != "1")
code += "\ts1.Line.Width = " + seriesLineWidth.Text + ";\n";
if (defaultElementTransparency.SelectedItem.Text != "0")
code += "\ts1.DefaultElement.Transparency = " + defaultElementTransparency.SelectedItem.Text + ";\n";
if (seriesBackgroundColorCheckBox.Checked)
code += "\ts1.Background.Color = Color." + meshColor.SelectedItem.Text + ";\n";
if (seriesLineColorCheckBox.Checked)
code += "\ts1.Line.Color = Color." + seriesLineColor.SelectedItem.Text + ";\n";
if (meshTransparency.Text != "0")
code += "\ts1.Background.Transparency = " + (meshTransparency.Text) + ";\n";
if (seriesLineTransparecy.Text != "0")
code += "\ts1.Line.Transparency = " + (seriesLineTransparecy.Text) + ";\n";
code += "\tchart.SeriesCollection.Add(s1);\n";
if (surfaceType2.Text != "None")
{
// Series 2
code += "\nSeries s2 = new Series();\n";
code += "\ts2.Use3D = " + Use3DCheckBox2.Checked.ToString().ToLower() + ";\n";
if (surfaceType2.SelectedItem.Text != "Surface")
code += "\ts2.Type = SeriesTypeSurface." + surfaceType2.SelectedItem.Text + ";\n";
if (DropToFloor2.Checked)
code += "\ts2.DefaultElement.DrawToFloor = true;\n";
if (numberInterp2.Text != "1")
code += "\ts2.InterpolationFilFactor = " + numberInterp2.Text + ";\n";
if (numberContours2.Text != "10")
code += "\ts2.ContourCount = " + numberContours2.Text + ";\n";
if (seriesLineDashStyle2.SelectedItem.Text != "Solid")
code += "\ts2.Line.DashStyle = DashStyle." + seriesLineDashStyle2.SelectedItem.Text + ";\n";
if (seriesLineWidth2.Text != "1")
code += "\ts2.Line.Width = " + seriesLineWidth2.Text + ";\n";
if (defaultElementTransparency2.SelectedItem.Text != "0")
code += "\ts2.DefaultElement.Transparency = " + defaultElementTransparency2.SelectedItem.Text + ";\n";
if (seriesBackgroundColorCheckBox2.Checked)
code += "\ts2.Background.Color = Color." + meshColor2.SelectedItem.Text + ";\n";
if (seriesLineColorCheckBox2.Checked)
code += "\ts2.Line.Color = Color." + seriesLineColor2.SelectedItem.Text + ";\n";
if (meshTransparency2.Text != "0")
code += "\ts2.Background.Transparency = " + (meshTransparency2.Text) + ";\n";
if (seriesLineTransparecy2.Text != "0")
code += "\ts2.Line.Transparency = " + (seriesLineTransparecy2.Text) + ";\n";
code += "\tchart.SeriesCollection.Add(s2);\n";
}
if (surfaceType3.Text != "None")
{
// Series 3
code += "\nSeries s3 = new Series();\n";
code += "\ts3.Use3D = " + Use3DCheckBox3.Checked.ToString().ToLower() + ";\n";
if (surfaceType3.SelectedItem.Text != "Surface")
code += "\ts3.Type = SeriesTypeSurface." + surfaceType3.SelectedItem.Text + ";\n";
if (DropToFloor3.Checked)
code += "\ts3.DefaultElement.DrawToFloor = true;\n";
if (numberInterp3.Text != "1")
code += "\ts3.InterpolationFilFactor = " + numberInterp3.Text + ";\n";
if (numberContours3.Text != "10")
code += "\ts3.ContourCount = " + numberContours3.Text + ";\n";
if (seriesLineDashStyle3.SelectedItem.Text != "Solid")
code += "\ts3.Line.DashStyle = DashStyle." + seriesLineDashStyle3.SelectedItem.Text + ";\n";
if (seriesLineWidth3.Text != "1")
code += "\ts3.Line.Width = " + seriesLineWidth3.Text + ";\n";
if (defaultElementTransparency3.SelectedItem.Text != "0")
code += "\ts3.DefaultElement.Transparency = " + defaultElementTransparency3.SelectedItem.Text + ";\n";
if (seriesBackgroundColorCheckBox3.Checked)
code += "\ts3.Background.Color = Color." + meshColor3.SelectedItem.Text + ";\n";
if (seriesLineColorCheckBox3.Checked)
code += "\ts3.Line.Color = Color." + seriesLineColor3.SelectedItem.Text + ";\n";
if (meshTransparency3.Text != "0")
code += "\ts3.Background.Transparency = " + (meshTransparency3.Text) + ";\n";
if (seriesLineTransparecy3.Text != "0")
code += "\ts3.Line.Transparency = " + (seriesLineTransparecy3.Text) + ";\n";
code += "\tchart.SeriesCollection.Add(s3);\n";
}
if (surfaceType4.Text != "None")
{
// Series 4
code += "\nSeries s4 = new Series();\n";
code += "\ts4.Use3D = " + Use3DCheckBox4.Checked.ToString().ToLower() + ";\n";
if (surfaceType4.SelectedItem.Text != "Surface")
code += "\ts4.Type = SeriesTypeSurface." + surfaceType4.SelectedItem.Text + ";\n";
if (DropToFloor4.Checked)
code += "\ts4.DefaultElement.DrawToFloor = true;\n";
if (numberInterp4.Text != "1")
code += "\ts4.InterpolationFilFactor = " + numberInterp4.Text + ";\n";
if (numberContours4.Text != "10")
code += "\ts4.ContourCount = " + numberContours4.Text + ";\n";
if (seriesLineDashStyle4.SelectedItem.Text != "Solid")
code += "\ts4.Line.DashStyle = DashStyle." + seriesLineDashStyle4.SelectedItem.Text + ";\n";
if (seriesLineWidth4.Text != "1")
code += "\ts4.Line.Width = " + seriesLineWidth4.Text + ";\n";
if (defaultElementTransparency4.SelectedItem.Text != "0")
code += "\ts4.DefaultElement.Transparency = " + defaultElementTransparency4.SelectedItem.Text + ";\n";
if (seriesBackgroundColorCheckBox4.Checked)
code += "\ts4.Background.Color = Color." + meshColor4.SelectedItem.Text + ";\n";
if (seriesLineColorCheckBox4.Checked)
code += "\ts4.Line.Color = Color." + seriesLineColor4.SelectedItem.Text + ";\n";
if (meshTransparency4.Text != "0")
code += "\ts4.Background.Transparency = " + (meshTransparency4.Text) + ";\n";
if (seriesLineTransparecy4.Text != "0")
code += "\ts4.Line.Transparency = " + (seriesLineTransparecy4.Text) + ";\n";
code += "\tchart.SeriesCollection.Add(s4);\n";
}
code += "}\n";
codeBox.Text = code;
}
//// Presets
protected void presets1(object sender, EventArgs e)
{
// Reset settings.
presets0(null, null);
azimuth.SelectedIndex = 4;
elevation.SelectedIndex = 4;
dataSet.SelectedIndex = 0;
colorType.SelectedIndex = 0;
Use3DCheckBox.Checked = true;
surfaceType.SelectedIndex = 0;
numberContours.Text = "10";
numberInterp.SelectedIndex = 2;
meshTransparency.SelectedIndex = 3;
seriesLineTransparecy.SelectedIndex = 2;
defaultElementTransparency.SelectedIndex = 1;
surfaceType2.SelectedIndex = 2;
Use3DCheckBox2.Checked = false;
seriesBackgroundColorCheckBox2.Checked = false;
seriesLineColorCheckBox2.Checked = false;
updateChart();
}
protected void presets2(object sender, EventArgs e)
{
// Reset settings.
presets0(null, null);
azimuth.SelectedIndex = 1;
elevation.SelectedIndex = 3;
dataSet.SelectedIndex = 4;
colorType.SelectedIndex = 2;
Use3DCheckBox.Checked = true;
surfaceType.SelectedIndex = 1;
updateChart();
}
// WaterFall
protected void presets3(object sender, EventArgs e)
{
// Reset settings.
presets0(null, null);
azimuth.SelectedIndex = 4;
elevation.SelectedIndex = 3;
dataSet.SelectedIndex = 1;
colorType.SelectedIndex = 1;
Use3DCheckBox.Checked = true;
surfaceType.SelectedIndex = 2;
DropToFloor.Checked = true;
meshTransparency.SelectedIndex = 5;
seriesLineTransparecy.SelectedIndex = 1;
defaultElementTransparency.SelectedIndex = 2;
updateChart();
}
// HeatMap
protected void presets4(object sender, EventArgs e)
{
// Reset settings.
presets0(null, null);
surfaceType.SelectedIndex = 0;
dataSet.SelectedIndex = 2;
colorType.SelectedIndex = 5;
numberInterp.SelectedIndex = 2;
seriesLineTransparecy.SelectedIndex = 10;
updateChart();
}
// Reset
protected void presets0(object sender, EventArgs e)
{
azimuth.SelectedIndex = 3;
elevation.SelectedIndex = 3;
dataSet.SelectedIndex = 0;
colorType.SelectedIndex = 0;
// Series 1
surfaceType.SelectedIndex = 1;
numberContours.Text = "10";
numberInterp.SelectedIndex = 0;
meshColor.SelectedIndex = 136;
meshTransparency.SelectedIndex = 0;
seriesLineColor.SelectedIndex = 136;
seriesLineTransparecy.SelectedIndex = 0;
seriesLineDashStyle.SelectedIndex = 0;
seriesLineWidth.Text = "1";
defaultElementTransparency.SelectedIndex = 0;
seriesLineColorCheckBox.Checked = false;
seriesBackgroundColorCheckBox.Checked = false;
DropToFloor.Checked = false;
Use3DCheckBox.Checked = false;
// Series 2
surfaceType2.SelectedIndex = 0;
numberContours2.Text = "10";
numberInterp2.SelectedIndex = 0;
meshColor2.SelectedIndex = 136;
meshTransparency2.SelectedIndex = 0;
seriesLineColor2.SelectedIndex = 136;
seriesLineTransparecy2.SelectedIndex = 0;
seriesLineDashStyle2.SelectedIndex = 0;
seriesLineWidth2.Text = "1";
defaultElementTransparency2.SelectedIndex = 0;
seriesLineColorCheckBox2.Checked = false;
seriesBackgroundColorCheckBox2.Checked = false;
DropToFloor2.Checked = false;
Use3DCheckBox2.Checked = false;
// Series 3
surfaceType3.SelectedIndex = 0;
numberContours3.Text = "10";
numberInterp3.SelectedIndex = 0;
meshColor3.SelectedIndex = 136;
meshTransparency3.SelectedIndex = 0;
seriesLineColor3.SelectedIndex = 136;
seriesLineTransparecy3.SelectedIndex = 0;
seriesLineDashStyle3.SelectedIndex = 0;
seriesLineWidth3.Text = "1";
defaultElementTransparency3.SelectedIndex = 0;
seriesLineColorCheckBox3.Checked = false;
seriesBackgroundColorCheckBox3.Checked = false;
DropToFloor3.Checked = false;
Use3DCheckBox3.Checked = false;
// Series 4
surfaceType4.SelectedIndex = 0;
numberContours4.Text = "10";
numberInterp4.SelectedIndex = 0;
meshColor4.SelectedIndex = 136;
meshTransparency4.SelectedIndex = 0;
seriesLineColor4.SelectedIndex = 136;
seriesLineTransparecy4.SelectedIndex = 0;
seriesLineDashStyle4.SelectedIndex = 0;
seriesLineWidth4.Text = "1";
defaultElementTransparency4.SelectedIndex = 0;
seriesLineColorCheckBox4.Checked = false;
seriesBackgroundColorCheckBox4.Checked = false;
DropToFloor4.Checked = false;
Use3DCheckBox4.Checked = false;
updateChart();
}
// Randomize
protected void randomize(object sender, EventArgs e)
{
Random r = new Random();
int ei = elevation.SelectedIndex;
int ai = azimuth.SelectedIndex;
foreach (Control c in form1.Controls)
{
DropDownList ddl = c as DropDownList;
if (ddl != null)
ddl.SelectedIndex = r.Next(ddl.Items.Count);
}
elevation.SelectedIndex = ei;
azimuth.SelectedIndex = ai;
updateChart();
}
protected void OnValueChanged(object sender, EventArgs e)
{
populateControls();
updateChart();
}
protected void surfaceType_SelectedIndexChanged(object sender, EventArgs e)
{
closeUnusedSeries();
}
void closeUnusedSeries()
{
if (surfaceType2.SelectedIndex == 0)
Series2Table.Visible = false;
else
Series2Table.Visible = true;
if (surfaceType3.SelectedIndex == 0)
Series3Table.Visible = false;
else
Series3Table.Visible = true;
if (surfaceType4.SelectedIndex == 0)
Series4Table.Visible = false;
else
Series4Table.Visible = true;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<style type="text/css">
.RadioButtons
{
border: 1px solid #808080;
font-family: Arial, Helvetica, sans-serif;
font-size: x-small;
padding-right: 3px;
padding-top: 0px;
margin-right: 2px;
}
.LabelStyle
{
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: xx-small;
color: #333333;
font-weight: bold;
}
.DropDownStyle
{
font-family: Arial, Helvetica, sans-serif;
font-size: xx-small;
border: 1px solid #666666;
}
#form1
{
text-align: left;
}
.ButtonStyle
{
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: x-small;
background-color: #FFFFFF;
border: 1px solid #808080;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table style="width: 100%">
<tr>
<td>
<table style="width: 100%">
<tr class="LabelStyle">
<td style="background-color: #DADEEB" colspan="5">
Presets:
<asp:Button ID="preset1" runat="server" OnClick="presets1" Text="Surface" CssClass="ButtonStyle" />
<asp:Button ID="preset2" runat="server" OnClick="presets2" Text="Contour" CssClass="ButtonStyle" />
<asp:Button ID="preset3" runat="server" OnClick="presets3" Text="Waterfall"
CssClass="ButtonStyle" />
<asp:Button ID="preset4" runat="server" OnClick="presets4" Text="HeatMap" CssClass="ButtonStyle" />
<asp:Button ID="preset0" runat="server" OnClick="presets0" Text="[Reset]" CssClass="ButtonStyle" />
</td>
</tr>
<tr class="LabelStyle">
<td style="background-color: #DADEEB">
Lighting
</td>
<td style="background-color: #DADEEB">
Camera Angle
</td>
<td style="background-color: #DADEEB">
Camera Height Angle
</td>
<td style="background-color: #DAEBE9">
Data Set
</td>
<td style="background-color: #DAEBE9">
Color Scheme
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="EnableLighting" Text="Enabled" runat="server" Checked="true" AutoPostBack="true"
CssClass="LabelStyle" />
</td>
<td>
<asp:DropDownList ID="azimuth" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="elevation" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="dataSet" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="colorType" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 1 Type
<asp:DropDownList ID="surfaceType" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem Selected="True">Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series1Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 2 Type
<asp:DropDownList ID="surfaceType2" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<table id="Series2Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
<asp:DropDownList ID="meshColor2" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
<asp:DropDownList ID="seriesLineColor2" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle2" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth2" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours2" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor2" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 3 Type
<asp:DropDownList ID="surfaceType3" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series3Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor3" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor3" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle3" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth3" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours3" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor3" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 4 Type
<asp:DropDownList ID="surfaceType4" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series4Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor4" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor4" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle4" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth4" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours4" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor4" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
<tr>
<td style="text-align: center">
<asp:Image ID="chartImage" runat="server" />
<br>
<br>
<asp:Button ID="submitButton" runat="server" Text="Refresh" CssClass="ButtonStyle" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td valign="top" class="LabelStyle">
<br />
</td>
<td style="text-align: left">
</td>
</tr>
<tr>
<td class="LabelStyle">
Code
</td>
<td style="text-align: left">
<asp:TextBox ID="codeBox" TextMode="MultiLine" runat="server" Height="249px" Width="714px" />
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" AutoEventWireup="true" %>
<%@ Register TagPrefix="dnc" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="dotnetCHARTING.Mapping" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
populateControls()
' Demonstrates usage of the box header properties and code to generate them.
' It is meant to be used as a box header designer offering all the properties necessary to create all the styles.
updateChart()
End Sub
' This method populates the color dropdown controls.
Sub populateColors()
populateColors(meshColor)
populateColors(seriesLineColor)
populateColors(meshColor2)
populateColors(seriesLineColor2)
populateColors(meshColor3)
populateColors(seriesLineColor3)
populateColors(meshColor4)
populateColors(seriesLineColor4)
End Sub
Sub populateColors(ByVal dlist As DropDownList)
Dim hi As Integer = dlist.SelectedIndex
If dlist.Items.Count = 0 Then
hi = 136
End If
dlist.Items.Clear()
Dim startNow As Boolean = False
' Exclude Control, Active, Menu, Text
For Each s As String In System.Enum.GetNames(GetType(System.Drawing.KnownColor))
If s = "AliceBlue" Then
startNow = True
End If
If startNow AndAlso (Not s.Contains("Menu")) AndAlso (Not s.Contains("Button")) AndAlso (Not s.Contains("Caption")) Then
Dim li As ListItem = New ListItem(s)
Dim li2 As ListItem = New ListItem(s)
li.Attributes.Add("style", "background-color:" & s)
li2.Attributes.Add("style", "background-color:" & s)
dlist.Items.Add(li)
End If
Next s
dlist.SelectedIndex = hi
End Sub
Sub populateControls()
populateColors()
Dim ei As Integer = elevation.SelectedIndex
Dim ai As Integer = azimuth.SelectedIndex
Dim ti As Integer = seriesLineTransparecy.SelectedIndex
Dim ali As Integer = meshTransparency.SelectedIndex
Dim et As Integer = defaultElementTransparency.SelectedIndex
Dim ti2 As Integer = seriesLineTransparecy2.SelectedIndex
Dim ali2 As Integer = meshTransparency2.SelectedIndex
Dim et2 As Integer = defaultElementTransparency2.SelectedIndex
Dim ti3 As Integer = seriesLineTransparecy3.SelectedIndex
Dim ali3 As Integer = meshTransparency3.SelectedIndex
Dim et3 As Integer = defaultElementTransparency3.SelectedIndex
Dim ti4 As Integer = seriesLineTransparecy4.SelectedIndex
Dim ali4 As Integer = meshTransparency4.SelectedIndex
Dim et4 As Integer = defaultElementTransparency4.SelectedIndex
If ei = 0 AndAlso ai = 0 Then
ei = 3
ai = 3
ti = 0
ali = 0
et = 0
ti2 = 0
ali2 = 0
et2 = 0
ti3 = 0
ali3 = 0
et3 = 0
ti4 = 0
ali4 = 0
et4 = 0
End If
populateNumericControl(elevation, 0, 90, 15, ei)
populateNumericControl(azimuth, 0, 180, 15, ai)
populateNumericControl(meshTransparency, 0, 100, 10, ali)
populateNumericControl(seriesLineTransparecy, 0, 100, 10, ti)
populateNumericControl(defaultElementTransparency, 0, 100, 10, et)
populateNumericControl(meshTransparency2, 0, 100, 10, ali2)
populateNumericControl(seriesLineTransparecy2, 0, 100, 10, ti2)
populateNumericControl(defaultElementTransparency2, 0, 100, 10, et2)
populateNumericControl(meshTransparency3, 0, 100, 10, ali3)
populateNumericControl(seriesLineTransparecy3, 0, 100, 10, ti3)
populateNumericControl(defaultElementTransparency3, 0, 100, 10, et3)
populateNumericControl(meshTransparency4, 0, 100, 10, ali4)
populateNumericControl(seriesLineTransparecy4, 0, 100, 10, ti4)
populateNumericControl(defaultElementTransparency4, 0, 100, 10, et4)
End Sub
Sub populateNumericControl(ByVal dlist As DropDownList, ByVal start As Integer, ByVal [end] As Integer, ByVal [step] As Integer, ByVal defaultSelectedIndex As Integer)
Dim si As Integer = dlist.SelectedIndex
dlist.Items.Clear()
For i As Integer = start To [end] Step [step]
Dim li As ListItem = New ListItem(i.ToString())
dlist.Items.Add(li)
Next i
If defaultSelectedIndex = -1 Then
dlist.SelectedIndex = si
Else
dlist.SelectedIndex = defaultSelectedIndex
End If
End Sub
' Apply the chart settings.
Sub updateChart()
closeUnusedSeries()
updateCode()
Dim c As Chart = New Chart()
c.Size = "800x550"
c.TempDirectory = "temp"
c.Debug = True
c.Type = ChartType.Surface
c.YAxis.Label.Text = "Y Axis"
c.XAxis.Label.Text = "X Axis"
c.ZAxis.Label.Text = "z Axis"
c.DefaultAxis.DefaultTick.Line.Length = 15
c.LegendBox.Visible = False
c.MarginTop = 20
c.View3D.EnableLighting = EnableLighting.Checked
If Use3DCheckBox.Checked Then
c.Use3D = True
Else
c.Use3D = False
End If
c.View3D.AngleOfRotation = Integer.Parse(azimuth.SelectedItem.Text)
c.View3D.AngleOfTilt = Integer.Parse(elevation.SelectedItem.Text)
Dim distort As Boolean = False
Dim mySC As SeriesCollection = Nothing
If dataSet.Text = "1" Then
mySC = getRData(distort)
ElseIf dataSet.Text = "2" Then
mySC = getRData2(distort)
ElseIf dataSet.Text = "3" Then
mySC = getRData3(distort)
ElseIf dataSet.Text = "4" Then
mySC = getRData4(distort)
ElseIf dataSet.Text = "5" Then
mySC = getRData5(distort)
End If
If colorType.Text = "1" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.Yellow, Color.Red)
ElseIf colorType.Text = "2" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.LimeGreen, Color.Yellow)
ElseIf colorType.Text = "3" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.Red, Color.Yellow, Color.YellowGreen)
ElseIf colorType.Text = "4" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.Aqua, Color.Yellow)
ElseIf colorType.Text = "5" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.Blue, Color.Aqua, Color.Green, Color.Yellow, Color.Orange, Color.Red, Color.Pink)
ElseIf colorType.Text = "6" Then
c.SmartPalette = mySC(0).GetSmartPalette(ElementValue.ZValue, Color.Blue, Color.Aqua, Color.LightGreen, Color.Yellow, Color.Orange, Color.Red, Color.Crimson, Color.White)
End If
' Add the random data.
c.SeriesCollection.Add(mySC)
' First Series
Dim s1 As Series = mySC(0)
If Use3DCheckBox.Checked Then
s1.Use3D = True
End If
s1.Type = CType(System.Enum.Parse(GetType(SeriesTypeSurface), surfaceType.SelectedItem.Text), SeriesTypeSurface)
s1.DefaultElement.DrawToFloor = DropToFloor.Checked
s1.InterpolationFillFactor = Integer.Parse(numberInterp.Text)
s1.ContourCount = Integer.Parse(numberContours.Text)
If seriesLineColor.SelectedItem.Text <> "White" OrElse seriesLineTransparecy.Text <> "250" Then
s1.Line.DashStyle = CType(System.Enum.Parse(GetType(DashStyle), seriesLineDashStyle.SelectedItem.Text), DashStyle)
End If
s1.Line.Width = Integer.Parse(seriesLineWidth.Text)
s1.DefaultElement.Transparency = Integer.Parse(defaultElementTransparency.SelectedItem.Text)
If seriesBackgroundColorCheckBox.Checked Then
s1.Background.Color = CType((New ColorConverter()).ConvertFromString(meshColor.SelectedItem.Text), Color)
End If
If seriesLineColorCheckBox.Checked Then
s1.Line.Color = CType((New ColorConverter()).ConvertFromString(seriesLineColor.SelectedItem.Text), Color)
End If
s1.Background.Transparency = Integer.Parse(meshTransparency.Text)
s1.Line.Transparency = Integer.Parse(seriesLineTransparecy.Text)
' Second series
If surfaceType2.Text <> "None" Then
Dim s2 As Series = New Series()
If seriesLineColor2.SelectedItem.Text <> "White" OrElse seriesLineTransparecy2.Text <> "250" Then
s2.Line.DashStyle = CType(System.Enum.Parse(GetType(DashStyle), seriesLineDashStyle2.SelectedItem.Text), DashStyle)
End If
s2.Line.Width = Integer.Parse(seriesLineWidth2.Text)
s2.DefaultElement.DrawToFloor = DropToFloor2.Checked
s2.InterpolationFillFactor = Integer.Parse(numberInterp2.Text)
s2.ContourCount = Integer.Parse(numberContours2.Text)
s2.DefaultElement.Transparency = Integer.Parse(defaultElementTransparency2.SelectedItem.Text)
If seriesBackgroundColorCheckBox2.Checked Then
s2.Background.Color = CType((New ColorConverter()).ConvertFromString(meshColor2.SelectedItem.Text), Color)
End If
If seriesLineColorCheckBox2.Checked Then
s2.Line.Color = CType((New ColorConverter()).ConvertFromString(seriesLineColor2.SelectedItem.Text), Color)
End If
s2.Background.Transparency = Integer.Parse(meshTransparency2.Text)
s2.Line.Transparency = Integer.Parse(seriesLineTransparecy2.Text)
s2.Type = CType(System.Enum.Parse(GetType(SeriesTypeSurface), surfaceType2.SelectedItem.Text), SeriesTypeSurface)
If Use3DCheckBox2.Checked Then
s2.Use3D = True
Else
s2.Use3D = False
End If
c.SeriesCollection.Add(s2)
End If
' Third series
If surfaceType3.Text <> "None" Then
Dim s3 As Series = New Series()
If seriesLineColor3.SelectedItem.Text <> "White" OrElse seriesLineTransparecy3.Text <> "250" Then
s3.Line.DashStyle = CType(System.Enum.Parse(GetType(DashStyle), seriesLineDashStyle3.SelectedItem.Text), DashStyle)
End If
s3.Line.Width = Integer.Parse(seriesLineWidth3.Text)
s3.DefaultElement.DrawToFloor = DropToFloor3.Checked
s3.InterpolationFillFactor = Integer.Parse(numberInterp3.Text)
s3.ContourCount = Integer.Parse(numberContours3.Text)
s3.DefaultElement.Transparency = Integer.Parse(defaultElementTransparency3.SelectedItem.Text)
If seriesBackgroundColorCheckBox3.Checked Then
s3.Background.Color = CType((New ColorConverter()).ConvertFromString(meshColor3.SelectedItem.Text), Color)
End If
If seriesLineColorCheckBox3.Checked Then
s3.Line.Color = CType((New ColorConverter()).ConvertFromString(seriesLineColor3.SelectedItem.Text), Color)
End If
s3.Background.Transparency = Integer.Parse(meshTransparency3.Text)
s3.Line.Transparency = Integer.Parse(seriesLineTransparecy3.Text)
s3.Type = CType(System.Enum.Parse(GetType(SeriesTypeSurface), surfaceType3.SelectedItem.Text), SeriesTypeSurface)
If Use3DCheckBox3.Checked Then
s3.Use3D = True
Else
s3.Use3D = False
End If
c.SeriesCollection.Add(s3)
End If
' Fourth series
If surfaceType4.Text <> "None" Then
Dim s4 As Series = New Series()
If seriesLineColor4.SelectedItem.Text <> "White" OrElse seriesLineTransparecy4.Text <> "250" Then
s4.Line.DashStyle = CType(System.Enum.Parse(GetType(DashStyle), seriesLineDashStyle4.SelectedItem.Text), DashStyle)
End If
s4.Line.Width = Integer.Parse(seriesLineWidth4.Text)
s4.DefaultElement.DrawToFloor = DropToFloor4.Checked
s4.InterpolationFillFactor = Integer.Parse(numberInterp4.Text)
s4.ContourCount = Integer.Parse(numberContours4.Text)
s4.DefaultElement.Transparency = Integer.Parse(defaultElementTransparency4.SelectedItem.Text)
If seriesBackgroundColorCheckBox4.Checked Then
s4.Background.Color = CType((New ColorConverter()).ConvertFromString(meshColor4.SelectedItem.Text), Color)
End If
If seriesLineColorCheckBox3.Checked Then
s4.Line.Color = CType((New ColorConverter()).ConvertFromString(seriesLineColor4.SelectedItem.Text), Color)
End If
s4.Background.Transparency = Integer.Parse(meshTransparency4.Text)
s4.Line.Transparency = Integer.Parse(seriesLineTransparecy4.Text)
s4.Type = CType(System.Enum.Parse(GetType(SeriesTypeSurface), surfaceType4.SelectedItem.Text), SeriesTypeSurface)
If Use3DCheckBox4.Checked Then
s4.Use3D = True
Else
s4.Use3D = False
End If
c.SeriesCollection.Add(s4)
End If
Dim an As Annotation = New Annotation(getSwatch(200, c.SmartPalette, 15, True))
an.Position = New Point(80, 3)
an.ClearColors()
an.DynamicSize = False
c.Annotations.Add(an)
chartImage.ImageUrl = c.FileManager.SaveImage()
End Sub
Function getSwatch(ByVal width As Integer, ByVal sp As SmartPalette, ByVal divisions As Integer, ByVal withValues As Boolean) As String
' Get Maximum Value of the smart palette range
Dim max As Double = CDbl(sp.GetScaleRange("*").ValueHigh)
Dim min As Double = CDbl(sp.GetScaleRange("*").ValueLow)
Dim swatch As String = "", spacers As String = ""
Dim [step] As Double = (max - min) / divisions
' Width of each division.
Dim boxWidth As Integer = width / divisions
' Generate swatch string for each division.
For i As Integer = 0 To divisions
spacers &= "<Chart:Spacer size='" & boxWidth & "x1'>"
' Get the color of the current division.
Dim color As String = getHTMLColor(sp.GetValueColor("", min + (i * ([step]))))
If withValues Then
swatch &= "<block hAlignment='Center' bgColor='" & color & "'>" & Math.Round((min + (i * ([step]))), 1)
Else
swatch &= "<block bgColor='" & color & "' fColor='" & color & "'>_"
End If
Next i
'return the swatch string.
Return spacers & "<row>" & swatch
End Function
Function getHTMLColor(ByVal c As Color) As String
Return "#" & c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2")
End Function
Function getRData(ByVal distort As Boolean) As SeriesCollection
Dim myR As Random = New Random()
Dim SC As SeriesCollection = New SeriesCollection()
Dim zVals As Double()() = New Double(8)(){}
zVals(0) = New Double() { 0.00, -1.75, -3.00, -3.75, -4.00, -3.75, -3.00, -1.75, 0.00 }
zVals(1) = New Double() { 1.75, 0.00, -1.25, -2.00, -2.25, -2.00, -1.25, 0.00, 1.75 }
zVals(2) = New Double() { 3.00, 1.25, 0.00, -0.75, -1.00, -0.75, 0.00, 1.25, 3.00 }
zVals(3) = New Double() { 3.75, 2.00, 0.75, 0.00, -0.25, 0.00, 0.75, 2.00, 3.75 }
zVals(4) = New Double() { 4.00, 2.25, 1.00, 0.25, 0.00, 0.25, 1.00, 2.25, 4.00 }
zVals(5) = New Double() { 3.75, 2.00, 0.75, 0.00, -0.25, 0.00, 0.75, 2.00, 3.75 }
zVals(6) = New Double() { 3.00, 1.25, 0.00, -0.75, -1.00, -0.75, 0.00, 1.25, 3.00 }
zVals(7) = New Double() { 1.75, 0.00, -1.25, -2.00, -2.25, -2.00, -1.25, 0.00, 1.75 }
zVals(8) = New Double() { 0.00, -1.75, -3.00, -3.75, -4.00, -3.75, -3.00, -1.75, 0.00 }
If distort Then
For x As Integer = 0 To zVals.Length - 1
For i As Integer = 0 To zVals(x).Length - 1
zVals(x)(i) += -.5f + (myR.Next(10) / 10f)
Next i
Next x
End If
Dim s As Series = Series.FromSurfaceData("", New Double() { -2, -1.5, -1, -.5, 0,.5, 1, 1.5, 2 }, New Double() { -2, -1.5, -1, -.5, 0,.5, 1, 1.5, 2 }, zVals)
SC.Add(s)
Return SC
End Function
Function getRData2(ByVal distort As Boolean) As SeriesCollection
Dim r As Random = New Random()
Dim size As Integer = 50
Dim xMin As Double = -2
Dim xSpacing As Double =.1
Dim yMin As Double = -2
Dim ySpacing As Double =.1
Dim zVals As Double()() = New Double(size - 1)(){}
Dim xVals As Double() = New Double(size - 1){}
Dim yVals As Double() = New Double(size - 1){}
For i As Integer = 0 To size - 1
zVals(i) = New Double(size - 1){}
For j As Integer = 0 To size - 1
Dim distortion As Single = (-.5f + CSng(r.Next(20)) / 20)
If (Not distort) Then
distortion = 0
End If
Dim x As Double = CDbl(xMin + i * xSpacing)
Dim y As Double = CDbl(yMin + j * ySpacing)
xVals(i) = x
yVals(j) = y
Dim z As Double = 3 * Math.Pow((1 - x), 2) * Math.Exp(-x * x - (y + 1) * (y + 1)) - 10 * (0.2 * x - Math.Pow(x, 3) - Math.Pow(y, 5)) * Math.Exp(-x * x - y * y) - 1 / 3 * Math.Exp(-(x + 1) * (x + 1) - y * y)
yVals(j) = y
zVals(i)(j) = z + distortion
Next j
Next i
Dim SC As SeriesCollection = New SeriesCollection()
Dim s As Series = Series.FromSurfaceData("", xVals, yVals, zVals)
SC.Add(s)
Return SC
End Function
Function getRData3(ByVal distort As Boolean) As SeriesCollection
Dim r As Random = New Random()
Dim size As Integer = 30
Dim xMin As Double = -2
Dim xSpacing As Double =.1
Dim yMin As Double = -2
Dim ySpacing As Double =.1
Dim zVals As Double()() = New Double(size - 1)(){}
Dim xVals As Double() = New Double(size - 1){}
Dim yVals As Double() = New Double(size - 1){}
For i As Integer = 0 To size - 1
zVals(i) = New Double(size - 1){}
For j As Integer = 0 To size - 1
Dim distortion As Single = (-.2f + CSng(r.Next(20) / 20f) *.4f)
If (Not distort) Then
distortion = 0
End If
Dim x As Double = CDbl(xMin + i * xSpacing)
Dim y As Double = CDbl(yMin + j * ySpacing)
xVals(i) = x
yVals(j) = y
Dim z As Double = Math.Sin(x * 2.2) + Math.Cos(y)
zVals(i)(j) = z + distortion
Next j
Next i
Dim SC As SeriesCollection = New SeriesCollection()
Dim s As Series = Series.FromSurfaceData("", xVals, yVals, zVals)
SC.Add(s)
Return SC
End Function
Function getRData4(ByVal distort As Boolean) As SeriesCollection
Dim r As Random = New Random()
Dim size As Integer = 30
Dim xMin As Double = -2
Dim xSpacing As Double =.1
Dim yMin As Double = -2
Dim ySpacing As Double =.1
Dim zVals As Double()() = New Double(size - 1)(){}
Dim xVals As Double() = New Double(size - 1){}
Dim yVals As Double() = New Double(size - 1){}
For i As Integer = 0 To size - 1
Dim distortion As Single = (-.5f + CSng(r.Next(20)) / 20)
If (Not distort) Then
distortion = 0
End If
zVals(i) = New Double(size - 1){}
For j As Integer = 0 To size - 1
Dim x As Double = CDbl(xMin + i * xSpacing)
Dim y As Double = CDbl(yMin + j * ySpacing)
xVals(i) = x
yVals(j) = y
Dim z As Double = Math.Atan(x) - Math.Atan(y * 2) * 10
zVals(i)(j) = z + distortion
Next j
Next i
Dim SC As SeriesCollection = New SeriesCollection()
Dim s As Series = Series.FromSurfaceData("", xVals, yVals, zVals)
SC.Add(s)
Return SC
End Function
Function getRData5(ByVal distort As Boolean) As SeriesCollection
Dim r As Random = New Random()
Dim size As Integer = 25
Dim xMin As Double = -2
Dim xSpacing As Double =.1
Dim yMin As Double = -2
Dim ySpacing As Double =.1
Dim zVals As Double()() = New Double(size - 1)(){}
Dim xVals As Double() = New Double(size - 1){}
Dim yVals As Double() = New Double(size - 1){}
Dim s As Series = New Series()
For i As Integer = 0 To size - 1
zVals(i) = New Double(size - 1){}
For j As Integer = 0 To size - 1
Dim distortion As Single = (-.5f + CSng(r.Next(20)) / 20)
If (Not distort) Then
distortion = 0
End If
Dim x As Double = CDbl(xMin + i * xSpacing)
Dim y As Double = CDbl(yMin + j * ySpacing)
xVals(i) = x
yVals(j) = y
Dim z As Double = Math.Sin(x * 3.2) + Math.Cos(y * 2) + Math.Sin(x * 1.2) + Math.Sin(y * 1.2)
zVals(i)(j) = z + distortion
Dim e As Element = New Element()
e.XValue = x
e.YValue = y
e.ZValue = z + distortion
s.Elements.Add(e)
Next j
Next i
Dim SC As SeriesCollection = New SeriesCollection()
SC.Add(s)
Return SC
End Function
' This method generates code necessary to create the annotation visual.
Sub updateCode()
Dim code As String = ""
code &= "private void applySurfaceStyling(Chart chart, SeriesCollection mySC)" & Constants.vbLf
code &= "{" & Constants.vbLf
code &= Constants.vbTab & "chart.Type = ChartType.Surface;" & Constants.vbLf
If azimuth.SelectedItem.Text <> "45" Then
code &= Constants.vbTab & "chart.Surface.AngleOfRotation = " & azimuth.SelectedItem.Text & ";" & Constants.vbLf
End If
If elevation.SelectedItem.Text <> "45" Then
code &= Constants.vbTab & "chart.Surface.AngleOfTilt = " & elevation.SelectedItem.Text & ";" & Constants.vbLf
End If
If (Not EnableLighting.Checked) Then
code &= Constants.vbTab & "chart.Surface.EnableLighting = false;" & Constants.vbLf
End If
' Series 1
code &= Constants.vbTab & "Series s1 = mySC[0];" & Constants.vbLf
code &= Constants.vbTab & "s1.Use3D = " & Use3DCheckBox.Checked.ToString().ToLower() & ";" & Constants.vbLf
If surfaceType.SelectedItem.Text <> "Surface" Then
code &= Constants.vbTab & "s1.Type = SeriesTypeSurface." & surfaceType.SelectedItem.Text & ";" & Constants.vbLf
End If
If DropToFloor.Checked Then
code &= Constants.vbTab & "s1.DefaultElement.DrawToFloor = true;" & Constants.vbLf
End If
If numberInterp.Text <> "1" Then
code &= Constants.vbTab & "s1.InterpolationFilFactor = " & numberInterp.Text & ";" & Constants.vbLf
End If
If numberContours.Text <> "10" Then
code &= Constants.vbTab & "s1.ContourCount = " & numberContours.Text & ";" & Constants.vbLf
End If
If seriesLineDashStyle.SelectedItem.Text <> "Solid" Then
code &= Constants.vbTab & "s1.Line.DashStyle = DashStyle." & seriesLineDashStyle.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineWidth.Text <> "1" Then
code &= Constants.vbTab & "s1.Line.Width = " & seriesLineWidth.Text & ";" & Constants.vbLf
End If
If defaultElementTransparency.SelectedItem.Text <> "0" Then
code &= Constants.vbTab & "s1.DefaultElement.Transparency = " & defaultElementTransparency.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesBackgroundColorCheckBox.Checked Then
code &= Constants.vbTab & "s1.Background.Color = Color." & meshColor.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineColorCheckBox.Checked Then
code &= Constants.vbTab & "s1.Line.Color = Color." & seriesLineColor.SelectedItem.Text & ";" & Constants.vbLf
End If
If meshTransparency.Text <> "0" Then
code &= Constants.vbTab & "s1.Background.Transparency = " & (meshTransparency.Text) & ";" & Constants.vbLf
End If
If seriesLineTransparecy.Text <> "0" Then
code &= Constants.vbTab & "s1.Line.Transparency = " & (seriesLineTransparecy.Text) & ";" & Constants.vbLf
End If
code &= Constants.vbTab & "chart.SeriesCollection.Add(s1);" & Constants.vbLf
If surfaceType2.Text <> "None" Then
' Series 2
code &= Constants.vbLf & "Series s2 = new Series();" & Constants.vbLf
code &= Constants.vbTab & "s2.Use3D = " & Use3DCheckBox2.Checked.ToString().ToLower() & ";" & Constants.vbLf
If surfaceType2.SelectedItem.Text <> "Surface" Then
code &= Constants.vbTab & "s2.Type = SeriesTypeSurface." & surfaceType2.SelectedItem.Text & ";" & Constants.vbLf
End If
If DropToFloor2.Checked Then
code &= Constants.vbTab & "s2.DefaultElement.DrawToFloor = true;" & Constants.vbLf
End If
If numberInterp2.Text <> "1" Then
code &= Constants.vbTab & "s2.InterpolationFilFactor = " & numberInterp2.Text & ";" & Constants.vbLf
End If
If numberContours2.Text <> "10" Then
code &= Constants.vbTab & "s2.ContourCount = " & numberContours2.Text & ";" & Constants.vbLf
End If
If seriesLineDashStyle2.SelectedItem.Text <> "Solid" Then
code &= Constants.vbTab & "s2.Line.DashStyle = DashStyle." & seriesLineDashStyle2.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineWidth2.Text <> "1" Then
code &= Constants.vbTab & "s2.Line.Width = " & seriesLineWidth2.Text & ";" & Constants.vbLf
End If
If defaultElementTransparency2.SelectedItem.Text <> "0" Then
code &= Constants.vbTab & "s2.DefaultElement.Transparency = " & defaultElementTransparency2.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesBackgroundColorCheckBox2.Checked Then
code &= Constants.vbTab & "s2.Background.Color = Color." & meshColor2.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineColorCheckBox2.Checked Then
code &= Constants.vbTab & "s2.Line.Color = Color." & seriesLineColor2.SelectedItem.Text & ";" & Constants.vbLf
End If
If meshTransparency2.Text <> "0" Then
code &= Constants.vbTab & "s2.Background.Transparency = " & (meshTransparency2.Text) & ";" & Constants.vbLf
End If
If seriesLineTransparecy2.Text <> "0" Then
code &= Constants.vbTab & "s2.Line.Transparency = " & (seriesLineTransparecy2.Text) & ";" & Constants.vbLf
End If
code &= Constants.vbTab & "chart.SeriesCollection.Add(s2);" & Constants.vbLf
End If
If surfaceType3.Text <> "None" Then
' Series 3
code &= Constants.vbLf & "Series s3 = new Series();" & Constants.vbLf
code &= Constants.vbTab & "s3.Use3D = " & Use3DCheckBox3.Checked.ToString().ToLower() & ";" & Constants.vbLf
If surfaceType3.SelectedItem.Text <> "Surface" Then
code &= Constants.vbTab & "s3.Type = SeriesTypeSurface." & surfaceType3.SelectedItem.Text & ";" & Constants.vbLf
End If
If DropToFloor3.Checked Then
code &= Constants.vbTab & "s3.DefaultElement.DrawToFloor = true;" & Constants.vbLf
End If
If numberInterp3.Text <> "1" Then
code &= Constants.vbTab & "s3.InterpolationFilFactor = " & numberInterp3.Text & ";" & Constants.vbLf
End If
If numberContours3.Text <> "10" Then
code &= Constants.vbTab & "s3.ContourCount = " & numberContours3.Text & ";" & Constants.vbLf
End If
If seriesLineDashStyle3.SelectedItem.Text <> "Solid" Then
code &= Constants.vbTab & "s3.Line.DashStyle = DashStyle." & seriesLineDashStyle3.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineWidth3.Text <> "1" Then
code &= Constants.vbTab & "s3.Line.Width = " & seriesLineWidth3.Text & ";" & Constants.vbLf
End If
If defaultElementTransparency3.SelectedItem.Text <> "0" Then
code &= Constants.vbTab & "s3.DefaultElement.Transparency = " & defaultElementTransparency3.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesBackgroundColorCheckBox3.Checked Then
code &= Constants.vbTab & "s3.Background.Color = Color." & meshColor3.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineColorCheckBox3.Checked Then
code &= Constants.vbTab & "s3.Line.Color = Color." & seriesLineColor3.SelectedItem.Text & ";" & Constants.vbLf
End If
If meshTransparency3.Text <> "0" Then
code &= Constants.vbTab & "s3.Background.Transparency = " & (meshTransparency3.Text) & ";" & Constants.vbLf
End If
If seriesLineTransparecy3.Text <> "0" Then
code &= Constants.vbTab & "s3.Line.Transparency = " & (seriesLineTransparecy3.Text) & ";" & Constants.vbLf
End If
code &= Constants.vbTab & "chart.SeriesCollection.Add(s3);" & Constants.vbLf
End If
If surfaceType4.Text <> "None" Then
' Series 4
code &= Constants.vbLf & "Series s4 = new Series();" & Constants.vbLf
code &= Constants.vbTab & "s4.Use3D = " & Use3DCheckBox4.Checked.ToString().ToLower() & ";" & Constants.vbLf
If surfaceType4.SelectedItem.Text <> "Surface" Then
code &= Constants.vbTab & "s4.Type = SeriesTypeSurface." & surfaceType4.SelectedItem.Text & ";" & Constants.vbLf
End If
If DropToFloor4.Checked Then
code &= Constants.vbTab & "s4.DefaultElement.DrawToFloor = true;" & Constants.vbLf
End If
If numberInterp4.Text <> "1" Then
code &= Constants.vbTab & "s4.InterpolationFilFactor = " & numberInterp4.Text & ";" & Constants.vbLf
End If
If numberContours4.Text <> "10" Then
code &= Constants.vbTab & "s4.ContourCount = " & numberContours4.Text & ";" & Constants.vbLf
End If
If seriesLineDashStyle4.SelectedItem.Text <> "Solid" Then
code &= Constants.vbTab & "s4.Line.DashStyle = DashStyle." & seriesLineDashStyle4.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineWidth4.Text <> "1" Then
code &= Constants.vbTab & "s4.Line.Width = " & seriesLineWidth4.Text & ";" & Constants.vbLf
End If
If defaultElementTransparency4.SelectedItem.Text <> "0" Then
code &= Constants.vbTab & "s4.DefaultElement.Transparency = " & defaultElementTransparency4.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesBackgroundColorCheckBox4.Checked Then
code &= Constants.vbTab & "s4.Background.Color = Color." & meshColor4.SelectedItem.Text & ";" & Constants.vbLf
End If
If seriesLineColorCheckBox4.Checked Then
code &= Constants.vbTab & "s4.Line.Color = Color." & seriesLineColor4.SelectedItem.Text & ";" & Constants.vbLf
End If
If meshTransparency4.Text <> "0" Then
code &= Constants.vbTab & "s4.Background.Transparency = " & (meshTransparency4.Text) & ";" & Constants.vbLf
End If
If seriesLineTransparecy4.Text <> "0" Then
code &= Constants.vbTab & "s4.Line.Transparency = " & (seriesLineTransparecy4.Text) & ";" & Constants.vbLf
End If
code &= Constants.vbTab & "chart.SeriesCollection.Add(s4);" & Constants.vbLf
End If
code &= "}" & Constants.vbLf
codeBox.Text = code
End Sub
'// Presets
Protected Sub presets1(ByVal sender As Object, ByVal e As EventArgs)
' Reset settings.
presets0(Nothing, Nothing)
azimuth.SelectedIndex = 4
elevation.SelectedIndex = 4
dataSet.SelectedIndex = 0
colorType.SelectedIndex = 0
Use3DCheckBox.Checked = True
surfaceType.SelectedIndex = 0
numberContours.Text = "10"
numberInterp.SelectedIndex = 2
meshTransparency.SelectedIndex = 3
seriesLineTransparecy.SelectedIndex = 2
defaultElementTransparency.SelectedIndex = 1
surfaceType2.SelectedIndex = 2
Use3DCheckBox2.Checked = False
seriesBackgroundColorCheckBox2.Checked = False
seriesLineColorCheckBox2.Checked = False
updateChart()
End Sub
Protected Sub presets2(ByVal sender As Object, ByVal e As EventArgs)
' Reset settings.
presets0(Nothing, Nothing)
azimuth.SelectedIndex = 1
elevation.SelectedIndex = 3
dataSet.SelectedIndex = 4
colorType.SelectedIndex = 2
Use3DCheckBox.Checked = True
surfaceType.SelectedIndex = 1
updateChart()
End Sub
' WaterFall
Protected Sub presets3(ByVal sender As Object, ByVal e As EventArgs)
' Reset settings.
presets0(Nothing, Nothing)
azimuth.SelectedIndex = 4
elevation.SelectedIndex = 3
dataSet.SelectedIndex = 1
colorType.SelectedIndex = 1
Use3DCheckBox.Checked = True
surfaceType.SelectedIndex = 2
DropToFloor.Checked = True
meshTransparency.SelectedIndex = 5
seriesLineTransparecy.SelectedIndex = 1
defaultElementTransparency.SelectedIndex = 2
updateChart()
End Sub
' HeatMap
Protected Sub presets4(ByVal sender As Object, ByVal e As EventArgs)
' Reset settings.
presets0(Nothing, Nothing)
surfaceType.SelectedIndex = 0
dataSet.SelectedIndex = 2
colorType.SelectedIndex = 5
numberInterp.SelectedIndex = 2
seriesLineTransparecy.SelectedIndex = 10
updateChart()
End Sub
' Reset
Protected Sub presets0(ByVal sender As Object, ByVal e As EventArgs)
azimuth.SelectedIndex = 3
elevation.SelectedIndex = 3
dataSet.SelectedIndex = 0
colorType.SelectedIndex = 0
' Series 1
surfaceType.SelectedIndex = 1
numberContours.Text = "10"
numberInterp.SelectedIndex = 0
meshColor.SelectedIndex = 136
meshTransparency.SelectedIndex = 0
seriesLineColor.SelectedIndex = 136
seriesLineTransparecy.SelectedIndex = 0
seriesLineDashStyle.SelectedIndex = 0
seriesLineWidth.Text = "1"
defaultElementTransparency.SelectedIndex = 0
seriesLineColorCheckBox.Checked = False
seriesBackgroundColorCheckBox.Checked = False
DropToFloor.Checked = False
Use3DCheckBox.Checked = False
' Series 2
surfaceType2.SelectedIndex = 0
numberContours2.Text = "10"
numberInterp2.SelectedIndex = 0
meshColor2.SelectedIndex = 136
meshTransparency2.SelectedIndex = 0
seriesLineColor2.SelectedIndex = 136
seriesLineTransparecy2.SelectedIndex = 0
seriesLineDashStyle2.SelectedIndex = 0
seriesLineWidth2.Text = "1"
defaultElementTransparency2.SelectedIndex = 0
seriesLineColorCheckBox2.Checked = False
seriesBackgroundColorCheckBox2.Checked = False
DropToFloor2.Checked = False
Use3DCheckBox2.Checked = False
' Series 3
surfaceType3.SelectedIndex = 0
numberContours3.Text = "10"
numberInterp3.SelectedIndex = 0
meshColor3.SelectedIndex = 136
meshTransparency3.SelectedIndex = 0
seriesLineColor3.SelectedIndex = 136
seriesLineTransparecy3.SelectedIndex = 0
seriesLineDashStyle3.SelectedIndex = 0
seriesLineWidth3.Text = "1"
defaultElementTransparency3.SelectedIndex = 0
seriesLineColorCheckBox3.Checked = False
seriesBackgroundColorCheckBox3.Checked = False
DropToFloor3.Checked = False
Use3DCheckBox3.Checked = False
' Series 4
surfaceType4.SelectedIndex = 0
numberContours4.Text = "10"
numberInterp4.SelectedIndex = 0
meshColor4.SelectedIndex = 136
meshTransparency4.SelectedIndex = 0
seriesLineColor4.SelectedIndex = 136
seriesLineTransparecy4.SelectedIndex = 0
seriesLineDashStyle4.SelectedIndex = 0
seriesLineWidth4.Text = "1"
defaultElementTransparency4.SelectedIndex = 0
seriesLineColorCheckBox4.Checked = False
seriesBackgroundColorCheckBox4.Checked = False
DropToFloor4.Checked = False
Use3DCheckBox4.Checked = False
updateChart()
End Sub
' Randomize
Protected Sub randomize(ByVal sender As Object, ByVal e As EventArgs)
Dim r As Random = New Random()
Dim ei As Integer = elevation.SelectedIndex
Dim ai As Integer = azimuth.SelectedIndex
For Each c As Control In form1.Controls
Dim ddl As DropDownList = TryCast(c, DropDownList)
If Not ddl Is Nothing Then
ddl.SelectedIndex = r.Next(ddl.Items.Count)
End If
Next c
elevation.SelectedIndex = ei
azimuth.SelectedIndex = ai
updateChart()
End Sub
Protected Sub OnValueChanged(ByVal sender As Object, ByVal e As EventArgs)
populateControls()
updateChart()
End Sub
Protected Sub surfaceType_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
closeUnusedSeries()
End Sub
Sub closeUnusedSeries()
If surfaceType2.SelectedIndex = 0 Then
Series2Table.Visible = False
Else
Series2Table.Visible = True
End If
If surfaceType3.SelectedIndex = 0 Then
Series3Table.Visible = False
Else
Series3Table.Visible = True
End If
If surfaceType4.SelectedIndex = 0 Then
Series4Table.Visible = False
Else
Series4Table.Visible = True
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<style type="text/css">
.RadioButtons
{
border: 1px solid #808080;
font-family: Arial, Helvetica, sans-serif;
font-size: x-small;
padding-right: 3px;
padding-top: 0px;
margin-right: 2px;
}
.LabelStyle
{
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: xx-small;
color: #333333;
font-weight: bold;
}
.DropDownStyle
{
font-family: Arial, Helvetica, sans-serif;
font-size: xx-small;
border: 1px solid #666666;
}
#form1
{
text-align: left;
}
.ButtonStyle
{
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: x-small;
background-color: #FFFFFF;
border: 1px solid #808080;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table style="width: 100%">
<tr>
<td>
<table style="width: 100%">
<tr class="LabelStyle">
<td style="background-color: #DADEEB" colspan="5">
Presets:
<asp:Button ID="preset1" runat="server" OnClick="presets1" Text="Surface" CssClass="ButtonStyle" />
<asp:Button ID="preset2" runat="server" OnClick="presets2" Text="Contour" CssClass="ButtonStyle" />
<asp:Button ID="preset3" runat="server" OnClick="presets3" Text="Waterfall"
CssClass="ButtonStyle" />
<asp:Button ID="preset4" runat="server" OnClick="presets4" Text="HeatMap" CssClass="ButtonStyle" />
<asp:Button ID="preset0" runat="server" OnClick="presets0" Text="[Reset]" CssClass="ButtonStyle" />
</td>
</tr>
<tr class="LabelStyle">
<td style="background-color: #DADEEB">
Lighting
</td>
<td style="background-color: #DADEEB">
Camera Angle
</td>
<td style="background-color: #DADEEB">
Camera Height Angle
</td>
<td style="background-color: #DAEBE9">
Data Set
</td>
<td style="background-color: #DAEBE9">
Color Scheme
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="EnableLighting" Text="Enabled" runat="server" Checked="true" AutoPostBack="true"
CssClass="LabelStyle" />
</td>
<td>
<asp:DropDownList ID="azimuth" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="elevation" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="dataSet" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="colorType" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 1 Type
<asp:DropDownList ID="surfaceType" runat="server" CssClass="DropDownStyle" AutoPostBack="true">
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem Selected="True">Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series1Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 2 Type
<asp:DropDownList ID="surfaceType2" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<table id="Series2Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
<asp:DropDownList ID="meshColor2" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
<asp:DropDownList ID="seriesLineColor2" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle2" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth2" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours2" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp2" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox2" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor2" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 3 Type
<asp:DropDownList ID="surfaceType3" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series3Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor3" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor3" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle3" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth3" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours3" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp3" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox3" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor3" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr>
<td class="LabelStyle" style="background-color: #AEB6D2">
Series 4 Type
<asp:DropDownList ID="surfaceType4" runat="server" CssClass="DropDownStyle" AutoPostBack="true"
OnSelectedIndexChanged="surfaceType_SelectedIndexChanged">
<asp:ListItem Selected="True">None</asp:ListItem>
<asp:ListItem>Surface</asp:ListItem>
<asp:ListItem>Contour</asp:ListItem>
<asp:ListItem>SurfaceX</asp:ListItem>
<asp:ListItem>SurfaceY</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<!-- START -->
<tr>
<td>
<table id="Series4Table" style="width: 100%" runat="server">
<tr>
<td style="background-color: #DADEEB">
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Color
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Transparency
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Dash Style
</td>
<td class="LabelStyle" style="background-color: #DADEEB">
Width
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Background
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesBackgroundColorCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="meshColor4" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="meshTransparency4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.Line (Contour)
</td>
<td class="LabelStyle">
<asp:CheckBox ID="seriesLineColorCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
<asp:DropDownList ID="seriesLineColor4" runat="server" AutoPostBack="true">
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="seriesLineTransparecy4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
<asp:DropDownList ID="seriesLineDashStyle4" runat="server" AutoPostBack="true">
<asp:ListItem Selected="True">Solid</asp:ListItem>
<asp:ListItem>Dash</asp:ListItem>
<asp:ListItem>Dot</asp:ListItem>
<asp:ListItem>DashDot</asp:ListItem>
<asp:ListItem>DashDotDot</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="seriesLineWidth4" runat="server" Width="38px">1</asp:TextBox>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
Series.DefaultElement
</td>
<td>
</td>
<td>
<asp:DropDownList ID="defaultElementTransparency4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<span class="LabelStyle" style="font-weight: normal"> %</span>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td class="LabelStyle" style="background-color: #DADEEB">
</td>
<td class="LabelStyle">
NumberContours
<asp:TextBox ID="numberContours4" runat="server" Width="38px">10</asp:TextBox>
</td>
<td class="LabelStyle">
Number Interp
<asp:DropDownList ID="numberInterp4" runat="server" AutoPostBack="true">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
</asp:DropDownList>
</td>
<td class="LabelStyle">
Use 3D<asp:CheckBox ID="Use3DCheckBox4" Text="Enabled" runat="server" Checked="false"
AutoPostBack="true" />
</td>
<td>
<asp:CheckBox ID="DropToFloor4" Text="DropToFloor" runat="server" Checked="false"
AutoPostBack="true" CssClass="LabelStyle" />
</td>
</tr>
</table>
</td>
</tr>
<!-- End -->
</table>
</td>
</tr>
<tr>
<td>
<br>
</td>
</tr>
<tr>
<td style="text-align: center">
<asp:Image ID="chartImage" runat="server" />
<br>
<br>
<asp:Button ID="submitButton" runat="server" Text="Refresh" CssClass="ButtonStyle" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td valign="top" class="LabelStyle">
<br />
</td>
<td style="text-align: left">
</td>
</tr>
<tr>
<td class="LabelStyle">
Code
</td>
<td style="text-align: left">
<asp:TextBox ID="codeBox" TextMode="MultiLine" runat="server" Height="249px" Width="714px" />
</td>
</tr>
</table>
</form>
</body>
</html>
- Sample FilenameSurfaceDesigner.aspx
- Version6.2
- Uses DatabaseNo