Click here to Skip to main content
15,885,244 members
Articles / Programming Languages / C#

High Speed, Feature Rich, and Easy-To-Use Graphs and Charts

Rate me:
Please Sign up or sign in to vote.
4.92/5 (75 votes)
29 Nov 20066 min read 223.6K   17K   263  
High speed graphs and charts that are also very easy to configure and use. As easy as inserting a simple chart in MS Excel!
#region copyright info
//
// Written by Anup. V (anupshubha@yahoo.com)
// Copyright (c) 2006.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed by any means PROVIDING it is not sold for
// for profit without the authors written consent, and providing that 
// this notice and the authors name is included. If the source code in
// this file is used in any commercial application then acknowledgement 
// must be made to the author of this file (in whatever form you wish).
//
// This file is provided "as is" with no expressed or implied warranty.
//
// Please use and enjoy. Please let me know of any bugs/mods/improvements 
// that you have found/implemented and I will fix/incorporate them into 
// this file. 
#endregion copyright info

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using GraphComponents;

namespace GraphUsageDemo
{
	/// <summary>
	/// Summary description for VerticalStackedBarGraphFeatures.
	/// </summary>
	public class HorizontalStackedBarGraphFeatures : System.Windows.Forms.Form
	{
		private GraphComponents.StackedBarGraph stackedBarGraph1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		System.Timers.Timer updatePreviewTimer = new System.Timers.Timer ();
		private System.Windows.Forms.ComboBox comboBarAlignment;
		private System.Windows.Forms.Label label23;
		private System.Windows.Forms.ComboBox comboShowRangeValues;
		private System.Windows.Forms.ComboBox comboShowRangeLines;
		private System.Windows.Forms.Label label21;
		private System.Windows.Forms.Label label20;
		private System.Windows.Forms.NumericUpDown transparencyUpDown;
		private System.Windows.Forms.Label label19;
		private System.Windows.Forms.Button buttonBackColor;
		private System.Windows.Forms.Button buttonTextColor;
		private System.Windows.Forms.Label label15;
		private System.Windows.Forms.Label label16;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.ColorDialog colorSelectorDialog;
		private System.Windows.Forms.FontDialog fontSelectorDialog;

		ArrayList signList1 = new ArrayList ();
		private int baseTime = 10000;
		private System.Windows.Forms.NumericUpDown gridlineXUpDown;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.NumericUpDown gridlineYUpDown;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.ComboBox comboGridlineStyle;
		private System.Windows.Forms.Button buttonGridlineColor;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label26;
		private System.Windows.Forms.Label label27;
		private System.Windows.Forms.Label label28;
		private System.Windows.Forms.Label label29;
		private System.Windows.Forms.NumericUpDown aboveRangeValueUpDown;
		private System.Windows.Forms.NumericUpDown belowRangeValueUpDown;
		private System.Windows.Forms.NumericUpDown maxValueUpDown;
		private System.Windows.Forms.NumericUpDown minValueUpDown;
		private System.Windows.Forms.NumericUpDown barWidthToSpacingUpDown;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.NumericUpDown barCountUpDown;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.NumericUpDown stepSizeUpDown;
		private System.Windows.Forms.NumericUpDown speedUpDown;
		private System.Windows.Forms.Label label30;
		private System.Windows.Forms.Label label31;
		private System.Windows.Forms.Button buttonAboveRangeColor;
		private System.Windows.Forms.Button buttonBelowRangeColor;
		private System.Windows.Forms.Button buttonBorderColor;
		private System.Windows.Forms.Button buttonBarColor;
		private System.Windows.Forms.Label label13;
		private System.Windows.Forms.Label label14;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.ComboBox comboValueFormat;
		private System.Windows.Forms.Button buttonSelectFont;
		private System.Windows.Forms.Label labelTextFont;
		private System.Windows.Forms.Label label25;
		private System.Windows.Forms.Label label24;
		private System.Windows.Forms.Button buttonGraduationYColor;
		private System.Windows.Forms.Label label18;
		private System.Windows.Forms.Button buttonGraduationXColor;
		private System.Windows.Forms.Label label17;
		private System.Windows.Forms.Panel panelSettings;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.Button buttonNoBackImage;
		private System.Windows.Forms.Button buttonSelectImage;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.OpenFileDialog openImageFileDialog;
		private float stepSize = 5F;
		private bool busy;

		public HorizontalStackedBarGraphFeatures()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			updatePreviewTimer.Interval = baseTime / Math.Pow (10, (double) speedUpDown.Value - 1);;
			updatePreviewTimer.AutoReset = true;
			updatePreviewTimer.Enabled = true;
			updatePreviewTimer.Elapsed += new System.Timers.ElapsedEventHandler(updatePreviewTimer_Elapsed);

			#region random signs so that some bars go up and some down
			RandomizeSignList (signList1);
			#endregion random signs so that some bars go up and some down
			
			#region fill up the values of the stacked bar graphs
			stackedBarGraph1.BarCount = (int) barCountUpDown.Value;

			for (int i = 1; i <= stackedBarGraph1.Bars.Count; i ++)
			{
				stackedBarGraph1.Bars[i - 1].BarValue = (i * 10);
				
				if (stackedBarGraph1.Bars[i - 1].BarValue > stackedBarGraph1.MaximumValue)
					stackedBarGraph1.Bars[i - 1].BarValue -= stackedBarGraph1.MaximumValue;

				stackedBarGraph1.Bars[i - 1].Name = i.ToString ();
			}
			#endregion fill up the values of the stacked bar graphs

			#region set the initial properties
			stackedBarGraph1.BarColor = buttonBarColor.BackColor;
			stackedBarGraph1.BelowRangeColor = buttonBelowRangeColor.BackColor;
			stackedBarGraph1.AboveRangeColor = buttonAboveRangeColor.BackColor;
			stackedBarGraph1.ForeColor = buttonTextColor.BackColor;
			stackedBarGraph1.GraphAreaColor = buttonBackColor.BackColor;
			stackedBarGraph1.Font = labelTextFont.Font;

			if (comboShowRangeLines.Text == "Yes")			
				stackedBarGraph1.ShowRangeLines = true;
			else
				stackedBarGraph1.ShowRangeLines = false;

			if (comboShowRangeValues.Text == "Yes")
				stackedBarGraph1.ShowRangeValues = true;
			else
				stackedBarGraph1.ShowRangeValues = false;		

			stackedBarGraph1.ValueFormat = comboValueFormat.Text;

			if (comboBarAlignment.Text == "Bar Value Center")
				stackedBarGraph1.ValueAlignment = TextAlignment.BarValueCenter;
			else if (comboBarAlignment.Text == "Absolute Center")
				stackedBarGraph1.ValueAlignment = TextAlignment.AbsoluteCenter;
			else if (comboBarAlignment.Text == "Smart")
				stackedBarGraph1.ValueAlignment = TextAlignment.Smart;
			else
				stackedBarGraph1.ValueAlignment = TextAlignment.None;

			if (comboGridlineStyle.Text == "Vertical")
				stackedBarGraph1.Gridlines = GridStyles.Vertical;
			else if (comboGridlineStyle.Text == "Horizontal")
				stackedBarGraph1.Gridlines = GridStyles.Horizontal;
			else if (comboGridlineStyle.Text == "Grid")
				stackedBarGraph1.Gridlines = GridStyles.Grid;
			else
				stackedBarGraph1.Gridlines = GridStyles.None;	
		
			stackedBarGraph1.GridlineColor = buttonGridlineColor.BackColor;
			stackedBarGraph1.Transparency = (byte) transparencyUpDown.Value;
			stackedBarGraph1.MinimumValue = (float) minValueUpDown.Value;
			stackedBarGraph1.MaximumValue = (float) maxValueUpDown.Value;
			stackedBarGraph1.BelowRangeValue = (float) belowRangeValueUpDown.Value;
			stackedBarGraph1.AboveRangeValue = (float) aboveRangeValueUpDown.Value;
			stepSize = (float) stepSizeUpDown.Value;
			#endregion set the initial properties

		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(HorizontalStackedBarGraphFeatures));
			this.stackedBarGraph1 = new GraphComponents.StackedBarGraph();
			this.buttonGridlineColor = new System.Windows.Forms.Button();
			this.label6 = new System.Windows.Forms.Label();
			this.comboGridlineStyle = new System.Windows.Forms.ComboBox();
			this.label5 = new System.Windows.Forms.Label();
			this.gridlineYUpDown = new System.Windows.Forms.NumericUpDown();
			this.label4 = new System.Windows.Forms.Label();
			this.gridlineXUpDown = new System.Windows.Forms.NumericUpDown();
			this.label3 = new System.Windows.Forms.Label();
			this.comboBarAlignment = new System.Windows.Forms.ComboBox();
			this.label23 = new System.Windows.Forms.Label();
			this.comboShowRangeValues = new System.Windows.Forms.ComboBox();
			this.comboShowRangeLines = new System.Windows.Forms.ComboBox();
			this.label21 = new System.Windows.Forms.Label();
			this.label20 = new System.Windows.Forms.Label();
			this.transparencyUpDown = new System.Windows.Forms.NumericUpDown();
			this.label19 = new System.Windows.Forms.Label();
			this.buttonBackColor = new System.Windows.Forms.Button();
			this.buttonTextColor = new System.Windows.Forms.Button();
			this.label15 = new System.Windows.Forms.Label();
			this.label16 = new System.Windows.Forms.Label();
			this.panel1 = new System.Windows.Forms.Panel();
			this.panelSettings = new System.Windows.Forms.Panel();
			this.label8 = new System.Windows.Forms.Label();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.buttonNoBackImage = new System.Windows.Forms.Button();
			this.buttonSelectImage = new System.Windows.Forms.Button();
			this.label7 = new System.Windows.Forms.Label();
			this.comboValueFormat = new System.Windows.Forms.ComboBox();
			this.label25 = new System.Windows.Forms.Label();
			this.label24 = new System.Windows.Forms.Label();
			this.labelTextFont = new System.Windows.Forms.Label();
			this.buttonSelectFont = new System.Windows.Forms.Button();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.buttonAboveRangeColor = new System.Windows.Forms.Button();
			this.buttonBelowRangeColor = new System.Windows.Forms.Button();
			this.buttonBorderColor = new System.Windows.Forms.Button();
			this.buttonBarColor = new System.Windows.Forms.Button();
			this.label13 = new System.Windows.Forms.Label();
			this.label14 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.buttonGraduationXColor = new System.Windows.Forms.Button();
			this.label17 = new System.Windows.Forms.Label();
			this.buttonGraduationYColor = new System.Windows.Forms.Button();
			this.label18 = new System.Windows.Forms.Label();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.label26 = new System.Windows.Forms.Label();
			this.label27 = new System.Windows.Forms.Label();
			this.label28 = new System.Windows.Forms.Label();
			this.label29 = new System.Windows.Forms.Label();
			this.aboveRangeValueUpDown = new System.Windows.Forms.NumericUpDown();
			this.belowRangeValueUpDown = new System.Windows.Forms.NumericUpDown();
			this.maxValueUpDown = new System.Windows.Forms.NumericUpDown();
			this.minValueUpDown = new System.Windows.Forms.NumericUpDown();
			this.barCountUpDown = new System.Windows.Forms.NumericUpDown();
			this.speedUpDown = new System.Windows.Forms.NumericUpDown();
			this.label2 = new System.Windows.Forms.Label();
			this.barWidthToSpacingUpDown = new System.Windows.Forms.NumericUpDown();
			this.stepSizeUpDown = new System.Windows.Forms.NumericUpDown();
			this.label1 = new System.Windows.Forms.Label();
			this.label30 = new System.Windows.Forms.Label();
			this.label31 = new System.Windows.Forms.Label();
			this.colorSelectorDialog = new System.Windows.Forms.ColorDialog();
			this.fontSelectorDialog = new System.Windows.Forms.FontDialog();
			this.openImageFileDialog = new System.Windows.Forms.OpenFileDialog();
			((System.ComponentModel.ISupportInitialize)(this.gridlineYUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.gridlineXUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.transparencyUpDown)).BeginInit();
			this.panel1.SuspendLayout();
			this.panelSettings.SuspendLayout();
			this.groupBox3.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.groupBox1.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.aboveRangeValueUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.belowRangeValueUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.maxValueUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.minValueUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.barCountUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.speedUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.barWidthToSpacingUpDown)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.stepSizeUpDown)).BeginInit();
			this.SuspendLayout();
			// 
			// stackedBarGraph1
			// 
			this.stackedBarGraph1.AboveRangeColor = System.Drawing.Color.Salmon;
			this.stackedBarGraph1.AboveRangeValue = 70F;
			this.stackedBarGraph1.BarColor = System.Drawing.Color.Lime;
			this.stackedBarGraph1.BarCount = 6;
			this.stackedBarGraph1.BarOrientation = GraphComponents.Orientation.Horizontal;
			this.stackedBarGraph1.BarWidthToSpacingRatio = 1F;
			this.stackedBarGraph1.BelowRangeColor = System.Drawing.Color.Thistle;
			this.stackedBarGraph1.BelowRangeValue = 30F;
			this.stackedBarGraph1.Dock = System.Windows.Forms.DockStyle.Left;
			this.stackedBarGraph1.GraduationsX = 5;
			this.stackedBarGraph1.GraduationsY = 5;
			this.stackedBarGraph1.GraphArea = new System.Drawing.Rectangle(50, 20, 514, 702);
			this.stackedBarGraph1.GraphAreaColor = System.Drawing.Color.White;
			this.stackedBarGraph1.GraphMarginBottom = 20;
			this.stackedBarGraph1.GraphMarginLeft = 50;
			this.stackedBarGraph1.GraphMarginRight = 20;
			this.stackedBarGraph1.GraphMarginTop = 20;
			this.stackedBarGraph1.GridlineColor = System.Drawing.Color.LightGray;
			this.stackedBarGraph1.Gridlines = GraphComponents.GridStyles.Grid;
			this.stackedBarGraph1.Location = new System.Drawing.Point(0, 0);
			this.stackedBarGraph1.MaximumValue = 100F;
			this.stackedBarGraph1.MinimumValue = 0F;
			this.stackedBarGraph1.Name = "stackedBarGraph1";
			this.stackedBarGraph1.ShowRangeLines = true;
			this.stackedBarGraph1.ShowRangeValues = false;
			this.stackedBarGraph1.Size = new System.Drawing.Size(584, 742);
			this.stackedBarGraph1.TabIndex = 0;
			this.stackedBarGraph1.Transparency = ((System.Byte)(100));
			this.stackedBarGraph1.ValueAlignment = GraphComponents.TextAlignment.Smart;
			this.stackedBarGraph1.ValueFormat = "";
			this.stackedBarGraph1.XAxisColor = System.Drawing.Color.Black;
			this.stackedBarGraph1.YAxisColor = System.Drawing.Color.Blue;
			// 
			// buttonGridlineColor
			// 
			this.buttonGridlineColor.BackColor = System.Drawing.Color.Maroon;
			this.buttonGridlineColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonGridlineColor.Location = new System.Drawing.Point(96, 112);
			this.buttonGridlineColor.Name = "buttonGridlineColor";
			this.buttonGridlineColor.Size = new System.Drawing.Size(40, 23);
			this.buttonGridlineColor.TabIndex = 146;
			this.buttonGridlineColor.Click += new System.EventHandler(this.buttonGridlineColor_Click);
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(8, 112);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(80, 23);
			this.label6.TabIndex = 145;
			this.label6.Text = "Gridline Color";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// comboGridlineStyle
			// 
			this.comboGridlineStyle.Items.AddRange(new object[] {
																	"Horizontal",
																	"Vertical",
																	"Grid",
																	"None"});
			this.comboGridlineStyle.Location = new System.Drawing.Point(264, 64);
			this.comboGridlineStyle.Name = "comboGridlineStyle";
			this.comboGridlineStyle.Size = new System.Drawing.Size(80, 21);
			this.comboGridlineStyle.TabIndex = 144;
			this.comboGridlineStyle.Text = "Grid";
			this.comboGridlineStyle.SelectedIndexChanged += new System.EventHandler(this.comboGridlineStyle_SelectedIndexChanged);
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(180, 64);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(76, 23);
			this.label5.TabIndex = 143;
			this.label5.Text = "Gridline Style";
			this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// gridlineYUpDown
			// 
			this.gridlineYUpDown.Location = new System.Drawing.Point(295, 40);
			this.gridlineYUpDown.Maximum = new System.Decimal(new int[] {
																			20,
																			0,
																			0,
																			0});
			this.gridlineYUpDown.Minimum = new System.Decimal(new int[] {
																			1,
																			0,
																			0,
																			0});
			this.gridlineYUpDown.Name = "gridlineYUpDown";
			this.gridlineYUpDown.Size = new System.Drawing.Size(48, 20);
			this.gridlineYUpDown.TabIndex = 142;
			this.gridlineYUpDown.Value = new System.Decimal(new int[] {
																		  6,
																		  0,
																		  0,
																		  0});
			this.gridlineYUpDown.ValueChanged += new System.EventHandler(this.gridlineYUpDown_ValueChanged);
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(180, 40);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(88, 23);
			this.label4.TabIndex = 141;
			this.label4.Text = "Gridline Y (Vert)";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// gridlineXUpDown
			// 
			this.gridlineXUpDown.Location = new System.Drawing.Point(295, 16);
			this.gridlineXUpDown.Maximum = new System.Decimal(new int[] {
																			20,
																			0,
																			0,
																			0});
			this.gridlineXUpDown.Minimum = new System.Decimal(new int[] {
																			1,
																			0,
																			0,
																			0});
			this.gridlineXUpDown.Name = "gridlineXUpDown";
			this.gridlineXUpDown.Size = new System.Drawing.Size(48, 20);
			this.gridlineXUpDown.TabIndex = 140;
			this.gridlineXUpDown.Value = new System.Decimal(new int[] {
																		  6,
																		  0,
																		  0,
																		  0});
			this.gridlineXUpDown.ValueChanged += new System.EventHandler(this.gridlineXUpDown_ValueChanged);
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(180, 16);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(88, 23);
			this.label3.TabIndex = 139;
			this.label3.Text = "Gridline X (Horz)";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// comboBarAlignment
			// 
			this.comboBarAlignment.Items.AddRange(new object[] {
																   "Absolute Center",
																   "Bar Value Center",
																   "Smart",
																   "None"});
			this.comboBarAlignment.Location = new System.Drawing.Point(69, 88);
			this.comboBarAlignment.Name = "comboBarAlignment";
			this.comboBarAlignment.Size = new System.Drawing.Size(108, 21);
			this.comboBarAlignment.TabIndex = 129;
			this.comboBarAlignment.Text = "Bar Value Center";
			this.comboBarAlignment.SelectedIndexChanged += new System.EventHandler(this.comboBarAlignment_SelectedIndexChanged);
			// 
			// label23
			// 
			this.label23.Location = new System.Drawing.Point(11, 88);
			this.label23.Name = "label23";
			this.label23.Size = new System.Drawing.Size(59, 23);
			this.label23.TabIndex = 127;
			this.label23.Text = "Alignment";
			this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// comboShowRangeValues
			// 
			this.comboShowRangeValues.Items.AddRange(new object[] {
																	  "Yes",
																	  "No"});
			this.comboShowRangeValues.Location = new System.Drawing.Point(128, 40);
			this.comboShowRangeValues.Name = "comboShowRangeValues";
			this.comboShowRangeValues.Size = new System.Drawing.Size(48, 21);
			this.comboShowRangeValues.TabIndex = 125;
			this.comboShowRangeValues.Text = "Yes";
			this.comboShowRangeValues.SelectedIndexChanged += new System.EventHandler(this.comboShowRangeValues_SelectedIndexChanged);
			// 
			// comboShowRangeLines
			// 
			this.comboShowRangeLines.Items.AddRange(new object[] {
																	 "Yes",
																	 "No"});
			this.comboShowRangeLines.Location = new System.Drawing.Point(128, 16);
			this.comboShowRangeLines.Name = "comboShowRangeLines";
			this.comboShowRangeLines.Size = new System.Drawing.Size(48, 21);
			this.comboShowRangeLines.TabIndex = 124;
			this.comboShowRangeLines.Text = "Yes";
			this.comboShowRangeLines.SelectedIndexChanged += new System.EventHandler(this.comboShowRangeLines_SelectedIndexChanged);
			// 
			// label21
			// 
			this.label21.Location = new System.Drawing.Point(8, 40);
			this.label21.Name = "label21";
			this.label21.Size = new System.Drawing.Size(112, 23);
			this.label21.TabIndex = 123;
			this.label21.Text = "Show Range Values";
			this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label20
			// 
			this.label20.Location = new System.Drawing.Point(8, 16);
			this.label20.Name = "label20";
			this.label20.Size = new System.Drawing.Size(112, 23);
			this.label20.TabIndex = 122;
			this.label20.Text = "Show Range Lines";
			this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// transparencyUpDown
			// 
			this.transparencyUpDown.Location = new System.Drawing.Point(296, 88);
			this.transparencyUpDown.Maximum = new System.Decimal(new int[] {
																			   255,
																			   0,
																			   0,
																			   0});
			this.transparencyUpDown.Name = "transparencyUpDown";
			this.transparencyUpDown.Size = new System.Drawing.Size(48, 20);
			this.transparencyUpDown.TabIndex = 121;
			this.transparencyUpDown.Value = new System.Decimal(new int[] {
																			 99,
																			 0,
																			 0,
																			 0});
			this.transparencyUpDown.ValueChanged += new System.EventHandler(this.transparencyUpDown_ValueChanged);
			// 
			// label19
			// 
			this.label19.Location = new System.Drawing.Point(181, 88);
			this.label19.Name = "label19";
			this.label19.Size = new System.Drawing.Size(96, 23);
			this.label19.TabIndex = 120;
			this.label19.Text = "Bar Transparency";
			this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// buttonBackColor
			// 
			this.buttonBackColor.BackColor = System.Drawing.Color.White;
			this.buttonBackColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonBackColor.Location = new System.Drawing.Point(96, 88);
			this.buttonBackColor.Name = "buttonBackColor";
			this.buttonBackColor.Size = new System.Drawing.Size(40, 23);
			this.buttonBackColor.TabIndex = 115;
			this.buttonBackColor.Click += new System.EventHandler(this.buttonBackColor_Click);
			// 
			// buttonTextColor
			// 
			this.buttonTextColor.BackColor = System.Drawing.Color.Black;
			this.buttonTextColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonTextColor.Location = new System.Drawing.Point(96, 64);
			this.buttonTextColor.Name = "buttonTextColor";
			this.buttonTextColor.Size = new System.Drawing.Size(40, 23);
			this.buttonTextColor.TabIndex = 114;
			this.buttonTextColor.Click += new System.EventHandler(this.buttonTextColor_Click);
			// 
			// label15
			// 
			this.label15.Location = new System.Drawing.Point(8, 88);
			this.label15.Name = "label15";
			this.label15.Size = new System.Drawing.Size(71, 23);
			this.label15.TabIndex = 109;
			this.label15.Text = "Back Color";
			this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label16
			// 
			this.label16.Location = new System.Drawing.Point(8, 64);
			this.label16.Name = "label16";
			this.label16.Size = new System.Drawing.Size(71, 23);
			this.label16.TabIndex = 108;
			this.label16.Text = "Text Color";
			this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// panel1
			// 
			this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.panel1.Controls.Add(this.panelSettings);
			this.panel1.Controls.Add(this.stackedBarGraph1);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panel1.Location = new System.Drawing.Point(0, 0);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(960, 746);
			this.panel1.TabIndex = 2;
			// 
			// panelSettings
			// 
			this.panelSettings.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.panelSettings.Controls.Add(this.label8);
			this.panelSettings.Controls.Add(this.groupBox3);
			this.panelSettings.Controls.Add(this.groupBox2);
			this.panelSettings.Controls.Add(this.groupBox1);
			this.panelSettings.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panelSettings.Location = new System.Drawing.Point(584, 0);
			this.panelSettings.Name = "panelSettings";
			this.panelSettings.Size = new System.Drawing.Size(372, 742);
			this.panelSettings.TabIndex = 1;
			// 
			// label8
			// 
			this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.label8.Location = new System.Drawing.Point(8, 8);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(352, 24);
			this.label8.TabIndex = 150;
			this.label8.Text = "Adjust the properties of the graph and notice the updated changes";
			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// groupBox3
			// 
			this.groupBox3.Controls.Add(this.buttonNoBackImage);
			this.groupBox3.Controls.Add(this.buttonSelectImage);
			this.groupBox3.Controls.Add(this.label7);
			this.groupBox3.Controls.Add(this.comboShowRangeValues);
			this.groupBox3.Controls.Add(this.comboShowRangeLines);
			this.groupBox3.Controls.Add(this.label21);
			this.groupBox3.Controls.Add(this.label20);
			this.groupBox3.Controls.Add(this.comboValueFormat);
			this.groupBox3.Controls.Add(this.label25);
			this.groupBox3.Controls.Add(this.label4);
			this.groupBox3.Controls.Add(this.gridlineXUpDown);
			this.groupBox3.Controls.Add(this.label3);
			this.groupBox3.Controls.Add(this.gridlineYUpDown);
			this.groupBox3.Controls.Add(this.label5);
			this.groupBox3.Controls.Add(this.comboGridlineStyle);
			this.groupBox3.Controls.Add(this.comboBarAlignment);
			this.groupBox3.Controls.Add(this.label23);
			this.groupBox3.Controls.Add(this.transparencyUpDown);
			this.groupBox3.Controls.Add(this.label19);
			this.groupBox3.Controls.Add(this.label24);
			this.groupBox3.Controls.Add(this.labelTextFont);
			this.groupBox3.Controls.Add(this.buttonSelectFont);
			this.groupBox3.Location = new System.Drawing.Point(8, 320);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new System.Drawing.Size(352, 176);
			this.groupBox3.TabIndex = 149;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "Style settings";
			// 
			// buttonNoBackImage
			// 
			this.buttonNoBackImage.Location = new System.Drawing.Point(290, 135);
			this.buttonNoBackImage.Name = "buttonNoBackImage";
			this.buttonNoBackImage.Size = new System.Drawing.Size(53, 24);
			this.buttonNoBackImage.TabIndex = 147;
			this.buttonNoBackImage.Text = "None";
			this.buttonNoBackImage.Click += new System.EventHandler(this.buttonNoBackImage_Click);
			// 
			// buttonSelectImage
			// 
			this.buttonSelectImage.Location = new System.Drawing.Point(235, 135);
			this.buttonSelectImage.Name = "buttonSelectImage";
			this.buttonSelectImage.Size = new System.Drawing.Size(53, 24);
			this.buttonSelectImage.TabIndex = 146;
			this.buttonSelectImage.Text = "Browse";
			this.buttonSelectImage.Click += new System.EventHandler(this.buttonSelectImage_Click);
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(181, 112);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(104, 23);
			this.label7.TabIndex = 145;
			this.label7.Text = "Background Image";
			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// comboValueFormat
			// 
			this.comboValueFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.comboValueFormat.Items.AddRange(new object[] {
																  "",
																  "{0:F}",
																  "{0:E}",
																  "{0:G}",
																  "{0:C}"});
			this.comboValueFormat.Location = new System.Drawing.Point(120, 64);
			this.comboValueFormat.Name = "comboValueFormat";
			this.comboValueFormat.Size = new System.Drawing.Size(56, 21);
			this.comboValueFormat.TabIndex = 143;
			this.comboValueFormat.SelectedIndexChanged += new System.EventHandler(this.comboValueFormat_SelectedIndexChanged);
			// 
			// label25
			// 
			this.label25.Location = new System.Drawing.Point(10, 64);
			this.label25.Name = "label25";
			this.label25.Size = new System.Drawing.Size(102, 23);
			this.label25.TabIndex = 140;
			this.label25.Text = "Value Format";
			this.label25.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label24
			// 
			this.label24.Location = new System.Drawing.Point(9, 112);
			this.label24.Name = "label24";
			this.label24.Size = new System.Drawing.Size(55, 23);
			this.label24.TabIndex = 139;
			this.label24.Text = "Text Font";
			this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// labelTextFont
			// 
			this.labelTextFont.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.labelTextFont.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.labelTextFont.Location = new System.Drawing.Point(70, 113);
			this.labelTextFont.Name = "labelTextFont";
			this.labelTextFont.Size = new System.Drawing.Size(106, 48);
			this.labelTextFont.TabIndex = 141;
			this.labelTextFont.Text = "0123456789";
			this.labelTextFont.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// buttonSelectFont
			// 
			this.buttonSelectFont.Location = new System.Drawing.Point(11, 136);
			this.buttonSelectFont.Name = "buttonSelectFont";
			this.buttonSelectFont.Size = new System.Drawing.Size(53, 24);
			this.buttonSelectFont.TabIndex = 142;
			this.buttonSelectFont.Text = "Select...";
			this.buttonSelectFont.Click += new System.EventHandler(this.buttonSelectFont_Click);
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.buttonAboveRangeColor);
			this.groupBox2.Controls.Add(this.buttonBelowRangeColor);
			this.groupBox2.Controls.Add(this.buttonBorderColor);
			this.groupBox2.Controls.Add(this.buttonBarColor);
			this.groupBox2.Controls.Add(this.label13);
			this.groupBox2.Controls.Add(this.label14);
			this.groupBox2.Controls.Add(this.label12);
			this.groupBox2.Controls.Add(this.label11);
			this.groupBox2.Controls.Add(this.buttonBackColor);
			this.groupBox2.Controls.Add(this.buttonTextColor);
			this.groupBox2.Controls.Add(this.label15);
			this.groupBox2.Controls.Add(this.label16);
			this.groupBox2.Controls.Add(this.buttonGraduationXColor);
			this.groupBox2.Controls.Add(this.label17);
			this.groupBox2.Controls.Add(this.buttonGraduationYColor);
			this.groupBox2.Controls.Add(this.label18);
			this.groupBox2.Controls.Add(this.buttonGridlineColor);
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Location = new System.Drawing.Point(8, 168);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(352, 144);
			this.groupBox2.TabIndex = 148;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Color settings";
			// 
			// buttonAboveRangeColor
			// 
			this.buttonAboveRangeColor.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(192)));
			this.buttonAboveRangeColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonAboveRangeColor.Location = new System.Drawing.Point(296, 40);
			this.buttonAboveRangeColor.Name = "buttonAboveRangeColor";
			this.buttonAboveRangeColor.Size = new System.Drawing.Size(40, 23);
			this.buttonAboveRangeColor.TabIndex = 121;
			this.buttonAboveRangeColor.Click += new System.EventHandler(this.buttonAboveRangeColor_Click);
			// 
			// buttonBelowRangeColor
			// 
			this.buttonBelowRangeColor.BackColor = System.Drawing.Color.Yellow;
			this.buttonBelowRangeColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonBelowRangeColor.Location = new System.Drawing.Point(296, 16);
			this.buttonBelowRangeColor.Name = "buttonBelowRangeColor";
			this.buttonBelowRangeColor.Size = new System.Drawing.Size(40, 23);
			this.buttonBelowRangeColor.TabIndex = 120;
			this.buttonBelowRangeColor.Click += new System.EventHandler(this.buttonBelowRangeColor_Click);
			// 
			// buttonBorderColor
			// 
			this.buttonBorderColor.BackColor = System.Drawing.Color.Black;
			this.buttonBorderColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonBorderColor.Location = new System.Drawing.Point(96, 40);
			this.buttonBorderColor.Name = "buttonBorderColor";
			this.buttonBorderColor.Size = new System.Drawing.Size(40, 23);
			this.buttonBorderColor.TabIndex = 119;
			this.buttonBorderColor.Click += new System.EventHandler(this.buttonBorderColor_Click);
			// 
			// buttonBarColor
			// 
			this.buttonBarColor.BackColor = System.Drawing.Color.Red;
			this.buttonBarColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonBarColor.Location = new System.Drawing.Point(96, 16);
			this.buttonBarColor.Name = "buttonBarColor";
			this.buttonBarColor.Size = new System.Drawing.Size(40, 23);
			this.buttonBarColor.TabIndex = 118;
			this.buttonBarColor.Click += new System.EventHandler(this.buttonBarColor_Click);
			// 
			// label13
			// 
			this.label13.Location = new System.Drawing.Point(176, 40);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(104, 23);
			this.label13.TabIndex = 117;
			this.label13.Text = "Above Range Color";
			this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label14
			// 
			this.label14.Location = new System.Drawing.Point(176, 16);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(104, 23);
			this.label14.TabIndex = 116;
			this.label14.Text = "Below Range Color";
			this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label12
			// 
			this.label12.Location = new System.Drawing.Point(8, 40);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(72, 23);
			this.label12.TabIndex = 115;
			this.label12.Text = "Border Color";
			this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label11
			// 
			this.label11.Location = new System.Drawing.Point(8, 16);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(72, 23);
			this.label11.TabIndex = 114;
			this.label11.Text = "Bar Color";
			this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// buttonGraduationXColor
			// 
			this.buttonGraduationXColor.BackColor = System.Drawing.Color.Lime;
			this.buttonGraduationXColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonGraduationXColor.Location = new System.Drawing.Point(296, 64);
			this.buttonGraduationXColor.Name = "buttonGraduationXColor";
			this.buttonGraduationXColor.Size = new System.Drawing.Size(40, 23);
			this.buttonGraduationXColor.TabIndex = 136;
			this.buttonGraduationXColor.Click += new System.EventHandler(this.buttonGraduationXColor_Click);
			// 
			// label17
			// 
			this.label17.Location = new System.Drawing.Point(176, 64);
			this.label17.Name = "label17";
			this.label17.Size = new System.Drawing.Size(108, 23);
			this.label17.TabIndex = 135;
			this.label17.Text = "X (Horz) - axis Color";
			this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// buttonGraduationYColor
			// 
			this.buttonGraduationYColor.BackColor = System.Drawing.Color.Blue;
			this.buttonGraduationYColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.buttonGraduationYColor.Location = new System.Drawing.Point(296, 88);
			this.buttonGraduationYColor.Name = "buttonGraduationYColor";
			this.buttonGraduationYColor.Size = new System.Drawing.Size(40, 23);
			this.buttonGraduationYColor.TabIndex = 138;
			this.buttonGraduationYColor.Click += new System.EventHandler(this.buttonGraduationYColor_Click);
			// 
			// label18
			// 
			this.label18.Location = new System.Drawing.Point(176, 88);
			this.label18.Name = "label18";
			this.label18.Size = new System.Drawing.Size(108, 23);
			this.label18.TabIndex = 137;
			this.label18.Text = "Y (Vert) - axis Color";
			this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.label26);
			this.groupBox1.Controls.Add(this.label27);
			this.groupBox1.Controls.Add(this.label28);
			this.groupBox1.Controls.Add(this.label29);
			this.groupBox1.Controls.Add(this.aboveRangeValueUpDown);
			this.groupBox1.Controls.Add(this.belowRangeValueUpDown);
			this.groupBox1.Controls.Add(this.maxValueUpDown);
			this.groupBox1.Controls.Add(this.minValueUpDown);
			this.groupBox1.Controls.Add(this.barCountUpDown);
			this.groupBox1.Controls.Add(this.speedUpDown);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.barWidthToSpacingUpDown);
			this.groupBox1.Controls.Add(this.stepSizeUpDown);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.label30);
			this.groupBox1.Controls.Add(this.label31);
			this.groupBox1.Location = new System.Drawing.Point(8, 40);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(352, 120);
			this.groupBox1.TabIndex = 147;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Value settings";
			// 
			// label26
			// 
			this.label26.Location = new System.Drawing.Point(150, 16);
			this.label26.Name = "label26";
			this.label26.Size = new System.Drawing.Size(112, 23);
			this.label26.TabIndex = 105;
			this.label26.Text = "Below Range Value";
			this.label26.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label27
			// 
			this.label27.Location = new System.Drawing.Point(150, 40);
			this.label27.Name = "label27";
			this.label27.Size = new System.Drawing.Size(112, 23);
			this.label27.TabIndex = 104;
			this.label27.Text = "Above Range Value";
			this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label28
			// 
			this.label28.Location = new System.Drawing.Point(8, 40);
			this.label28.Name = "label28";
			this.label28.Size = new System.Drawing.Size(64, 23);
			this.label28.TabIndex = 103;
			this.label28.Text = "Max Value";
			this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label29
			// 
			this.label29.Location = new System.Drawing.Point(8, 16);
			this.label29.Name = "label29";
			this.label29.Size = new System.Drawing.Size(64, 23);
			this.label29.TabIndex = 102;
			this.label29.Text = "Min Value";
			this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// aboveRangeValueUpDown
			// 
			this.aboveRangeValueUpDown.Location = new System.Drawing.Point(294, 40);
			this.aboveRangeValueUpDown.Minimum = new System.Decimal(new int[] {
																				  60,
																				  0,
																				  0,
																				  0});
			this.aboveRangeValueUpDown.Name = "aboveRangeValueUpDown";
			this.aboveRangeValueUpDown.Size = new System.Drawing.Size(48, 20);
			this.aboveRangeValueUpDown.TabIndex = 109;
			this.aboveRangeValueUpDown.Value = new System.Decimal(new int[] {
																				60,
																				0,
																				0,
																				0});
			this.aboveRangeValueUpDown.ValueChanged += new System.EventHandler(this.aboveRangeValueUpDown_ValueChanged);
			// 
			// belowRangeValueUpDown
			// 
			this.belowRangeValueUpDown.Location = new System.Drawing.Point(294, 16);
			this.belowRangeValueUpDown.Maximum = new System.Decimal(new int[] {
																				  30,
																				  0,
																				  0,
																				  0});
			this.belowRangeValueUpDown.Name = "belowRangeValueUpDown";
			this.belowRangeValueUpDown.Size = new System.Drawing.Size(48, 20);
			this.belowRangeValueUpDown.TabIndex = 108;
			this.belowRangeValueUpDown.Value = new System.Decimal(new int[] {
																				28,
																				0,
																				0,
																				0});
			this.belowRangeValueUpDown.ValueChanged += new System.EventHandler(this.belowRangeValueUpDown_ValueChanged);
			// 
			// maxValueUpDown
			// 
			this.maxValueUpDown.Location = new System.Drawing.Point(80, 40);
			this.maxValueUpDown.Name = "maxValueUpDown";
			this.maxValueUpDown.Size = new System.Drawing.Size(48, 20);
			this.maxValueUpDown.TabIndex = 107;
			this.maxValueUpDown.Value = new System.Decimal(new int[] {
																		 100,
																		 0,
																		 0,
																		 0});
			this.maxValueUpDown.ValueChanged += new System.EventHandler(this.maxValueUpDown_ValueChanged);
			// 
			// minValueUpDown
			// 
			this.minValueUpDown.Location = new System.Drawing.Point(80, 16);
			this.minValueUpDown.Maximum = new System.Decimal(new int[] {
																		   30,
																		   0,
																		   0,
																		   0});
			this.minValueUpDown.Name = "minValueUpDown";
			this.minValueUpDown.Size = new System.Drawing.Size(48, 20);
			this.minValueUpDown.TabIndex = 106;
			this.minValueUpDown.ValueChanged += new System.EventHandler(this.minValueUpDown_ValueChanged);
			// 
			// barCountUpDown
			// 
			this.barCountUpDown.Location = new System.Drawing.Point(294, 64);
			this.barCountUpDown.Maximum = new System.Decimal(new int[] {
																		   12,
																		   0,
																		   0,
																		   0});
			this.barCountUpDown.Minimum = new System.Decimal(new int[] {
																		   1,
																		   0,
																		   0,
																		   0});
			this.barCountUpDown.Name = "barCountUpDown";
			this.barCountUpDown.Size = new System.Drawing.Size(48, 20);
			this.barCountUpDown.TabIndex = 136;
			this.barCountUpDown.Value = new System.Decimal(new int[] {
																		 6,
																		 0,
																		 0,
																		 0});
			this.barCountUpDown.ValueChanged += new System.EventHandler(this.barCountUpDown_ValueChanged);
			// 
			// speedUpDown
			// 
			this.speedUpDown.Location = new System.Drawing.Point(80, 64);
			this.speedUpDown.Maximum = new System.Decimal(new int[] {
																		5,
																		0,
																		0,
																		0});
			this.speedUpDown.Minimum = new System.Decimal(new int[] {
																		1,
																		0,
																		0,
																		0});
			this.speedUpDown.Name = "speedUpDown";
			this.speedUpDown.Size = new System.Drawing.Size(48, 20);
			this.speedUpDown.TabIndex = 102;
			this.speedUpDown.Value = new System.Decimal(new int[] {
																	  3,
																	  0,
																	  0,
																	  0});
			this.speedUpDown.ValueChanged += new System.EventHandler(this.speedUpDown_ValueChanged);
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(150, 88);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(144, 23);
			this.label2.TabIndex = 137;
			this.label2.Text = "Bar Width To Spacing Ratio";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// barWidthToSpacingUpDown
			// 
			this.barWidthToSpacingUpDown.DecimalPlaces = 1;
			this.barWidthToSpacingUpDown.Increment = new System.Decimal(new int[] {
																					  1,
																					  0,
																					  0,
																					  65536});
			this.barWidthToSpacingUpDown.Location = new System.Drawing.Point(294, 88);
			this.barWidthToSpacingUpDown.Maximum = new System.Decimal(new int[] {
																					10,
																					0,
																					0,
																					0});
			this.barWidthToSpacingUpDown.Minimum = new System.Decimal(new int[] {
																					1,
																					0,
																					0,
																					65536});
			this.barWidthToSpacingUpDown.Name = "barWidthToSpacingUpDown";
			this.barWidthToSpacingUpDown.Size = new System.Drawing.Size(48, 20);
			this.barWidthToSpacingUpDown.TabIndex = 138;
			this.barWidthToSpacingUpDown.Value = new System.Decimal(new int[] {
																				  6,
																				  0,
																				  0,
																				  0});
			this.barWidthToSpacingUpDown.ValueChanged += new System.EventHandler(this.barWidthToSpacingUpDown_ValueChanged);
			// 
			// stepSizeUpDown
			// 
			this.stepSizeUpDown.Location = new System.Drawing.Point(80, 88);
			this.stepSizeUpDown.Maximum = new System.Decimal(new int[] {
																		   20,
																		   0,
																		   0,
																		   0});
			this.stepSizeUpDown.Minimum = new System.Decimal(new int[] {
																		   1,
																		   0,
																		   0,
																		   0});
			this.stepSizeUpDown.Name = "stepSizeUpDown";
			this.stepSizeUpDown.Size = new System.Drawing.Size(48, 20);
			this.stepSizeUpDown.TabIndex = 103;
			this.stepSizeUpDown.Value = new System.Decimal(new int[] {
																		 5,
																		 0,
																		 0,
																		 0});
			this.stepSizeUpDown.ValueChanged += new System.EventHandler(this.stepSizeUpDown_ValueChanged);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(150, 64);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 23);
			this.label1.TabIndex = 135;
			this.label1.Text = "Bar Count";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label30
			// 
			this.label30.Location = new System.Drawing.Point(8, 88);
			this.label30.Name = "label30";
			this.label30.Size = new System.Drawing.Size(56, 23);
			this.label30.TabIndex = 97;
			this.label30.Text = "Step Size";
			this.label30.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// label31
			// 
			this.label31.Location = new System.Drawing.Point(8, 64);
			this.label31.Name = "label31";
			this.label31.Size = new System.Drawing.Size(56, 23);
			this.label31.TabIndex = 96;
			this.label31.Text = "Speed";
			this.label31.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
			// 
			// colorSelectorDialog
			// 
			this.colorSelectorDialog.AnyColor = true;
			this.colorSelectorDialog.FullOpen = true;
			// 
			// HorizontalStackedBarGraphFeatures
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(960, 746);
			this.Controls.Add(this.panel1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "HorizontalStackedBarGraphFeatures";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Features of the horizntal stacked bar graph";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			((System.ComponentModel.ISupportInitialize)(this.gridlineYUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.gridlineXUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.transparencyUpDown)).EndInit();
			this.panel1.ResumeLayout(false);
			this.panelSettings.ResumeLayout(false);
			this.groupBox3.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.aboveRangeValueUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.belowRangeValueUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.maxValueUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.minValueUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.barCountUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.speedUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.barWidthToSpacingUpDown)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.stepSizeUpDown)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void updatePreviewTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
		{
			if (! Visible)
				return;

			UpdateStackedBarGraph (stackedBarGraph1, signList1);
		}

		private void UpdateStackedBarGraph (StackedBarGraph sbg, ArrayList signList)
		{		
			if (busy)
				return;

			busy = true;

			for (int i = 0; i < sbg.Bars.Count; i ++)
			{
				Bar bar = sbg.Bars[i];
									
				bar.BarValue += ((int) signList[i] * (float) stepSize);				
				
				// invert the sign so that the bar goes the other way
				if (bar.BarValue <= sbg.MinimumValue || bar.BarValue >= sbg.MaximumValue)
				{
					int sign = (int) signList[i];
					sign *= -1;
					signList[i] = sign;
				}
			}

			sbg.UpdateDisplay ();

			busy = false;
		}

		private void RandomizeSignList (ArrayList signList)
		{
			Random r = new Random ( (int) DateTime.Now.Ticks);
			for (int i = 0; i < 20; i ++)
			{
				int sign = r.Next (0, 1);
				if (sign == 0)
					sign = -1;
				else
					sign = 1;

				signList.Add (sign);
			}
		}

		private void buttonBarColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonBarColor.BackColor  = colorSelectorDialog.Color;
			stackedBarGraph1.BarColor = colorSelectorDialog.Color;
		}

		private void buttonBorderColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonBorderColor.BackColor = colorSelectorDialog.Color;
		}

		private void buttonBelowRangeColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonBelowRangeColor.BackColor  = colorSelectorDialog.Color;
			stackedBarGraph1.BelowRangeColor = colorSelectorDialog.Color;
		
		}

		private void buttonAboveRangeColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonAboveRangeColor.BackColor  = colorSelectorDialog.Color;
			stackedBarGraph1.AboveRangeColor = colorSelectorDialog.Color;
		
		}

		private void buttonTextColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonTextColor.BackColor  = colorSelectorDialog.Color;
			stackedBarGraph1.ForeColor = colorSelectorDialog.Color;
		
		}

		private void buttonBackColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			buttonBackColor.BackColor       = colorSelectorDialog.Color;
			stackedBarGraph1.GraphAreaColor = colorSelectorDialog.Color;
		
		}

		private void buttonGraduationXColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			stackedBarGraph1.XAxisColor = colorSelectorDialog.Color;
		
		}

		private void buttonGraduationYColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			stackedBarGraph1.YAxisColor  = colorSelectorDialog.Color;
		}

		private void buttonSelectFont_Click(object sender, System.EventArgs e)
		{
			DialogResult result = fontSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			labelTextFont.Font    = fontSelectorDialog.Font;
			stackedBarGraph1.Font = fontSelectorDialog.Font;
		}

		private void minValueUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.MinimumValue = (float) minValueUpDown.Value;
		}

		private void maxValueUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.MaximumValue = (float) maxValueUpDown.Value;
		}

		private void belowRangeValueUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.BelowRangeValue = (float) belowRangeValueUpDown.Value;
		}

		private void aboveRangeValueUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.AboveRangeValue = (float) aboveRangeValueUpDown.Value;
		}

		private void speedUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			updatePreviewTimer.Interval = baseTime / Math.Pow (10, (double) speedUpDown.Value - 1);			
		}

		private void stepSizeUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stepSize = (float) stepSizeUpDown.Value;
		}

		private void comboShowRangeLines_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if (comboShowRangeLines.Text == "Yes")			
				stackedBarGraph1.ShowRangeLines = true;
			else
				stackedBarGraph1.ShowRangeLines = false;
		}

		private void comboShowRangeValues_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if (comboShowRangeValues.Text == "Yes")
				stackedBarGraph1.ShowRangeValues = true;
			else
				stackedBarGraph1.ShowRangeValues = false;		
		}

		private void comboValueFormat_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.ValueFormat = comboValueFormat.Text;
		}

		private void comboBarAlignment_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if (comboBarAlignment.Text == "Bar Value Center")
				stackedBarGraph1.ValueAlignment = TextAlignment.BarValueCenter;
			else if (comboBarAlignment.Text == "Absolute Center")
				stackedBarGraph1.ValueAlignment = TextAlignment.AbsoluteCenter;
			else if (comboBarAlignment.Text == "Smart")
				stackedBarGraph1.ValueAlignment = TextAlignment.Smart;
			else
				stackedBarGraph1.ValueAlignment = TextAlignment.None;

		}

		private void transparencyUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.Transparency = (byte) transparencyUpDown.Value;
		}

		private void barCountUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			updatePreviewTimer.Stop ();

			stackedBarGraph1.BarCount = (int) barCountUpDown.Value;

			updatePreviewTimer.Start ();
		}

		private void barWidthToSpacingUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.BarWidthToSpacingRatio = (float) barWidthToSpacingUpDown.Value;
		}

		private void gridlineXUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.GraduationsX = (int) gridlineXUpDown.Value;
		}

		private void gridlineYUpDown_ValueChanged(object sender, System.EventArgs e)
		{
			stackedBarGraph1.GraduationsY = (int) gridlineYUpDown.Value;
		}

		private void comboGridlineStyle_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if (comboGridlineStyle.Text == "Vertical")
				stackedBarGraph1.Gridlines = GridStyles.Vertical;
			else if (comboGridlineStyle.Text == "Horizontal")
				stackedBarGraph1.Gridlines = GridStyles.Horizontal;
			else if (comboGridlineStyle.Text == "Grid")
				stackedBarGraph1.Gridlines = GridStyles.Grid;
			else
				stackedBarGraph1.Gridlines = GridStyles.None;			
		}

		private void buttonGridlineColor_Click(object sender, System.EventArgs e)
		{
			DialogResult result = colorSelectorDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			stackedBarGraph1.GridlineColor = colorSelectorDialog.Color;
		
		}

		private void buttonSelectImage_Click(object sender, System.EventArgs e)
		{
			updatePreviewTimer.Stop ();

			openImageFileDialog.InitialDirectory = Environment.GetFolderPath (Environment.SpecialFolder.DesktopDirectory);
			openImageFileDialog.Filter           = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*";
			openImageFileDialog.FilterIndex      = 1;
			openImageFileDialog.RestoreDirectory = true ;
			openImageFileDialog.Multiselect      = false;
			openImageFileDialog.CheckFileExists  = true;
			openImageFileDialog.CheckPathExists  = true;

			DialogResult result = openImageFileDialog.ShowDialog (this);
			if (result != DialogResult.OK)
				return;

			Image image = null;
			try
			{
				image = Image.FromFile (openImageFileDialog.FileName);				

			}
			catch (OutOfMemoryException)
			{
				MessageBox.Show (this, "Sorry!, File cannot be opened", "GraphUsageDemo", MessageBoxButtons.OK, MessageBoxIcon.Error);
				return;
			}

			if (image == null)
				return;

			Image imageDestn1 = null;

			imageDestn1 = new Bitmap (image, stackedBarGraph1.ClientRectangle.Width, stackedBarGraph1.ClientRectangle.Height);
			
			stackedBarGraph1.BackgroundImage = imageDestn1;
				
			Color graphAreaColor = Color.FromArgb (0, stackedBarGraph1.GraphAreaColor);
			stackedBarGraph1.GraphAreaColor = graphAreaColor;
			updatePreviewTimer.Start ();

		}

		private void buttonNoBackImage_Click(object sender, System.EventArgs e)
		{
			updatePreviewTimer.Stop ();
			stackedBarGraph1.BackgroundImage = null;
			updatePreviewTimer.Start ();
		}

	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions