Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Cristi Potlog's Chart Control for .NET

, 24 Jul 2005
This article introduces a sample chart control for Windows Forms.
#region Copyright �2005, Cristi Potlog - All Rights Reserved
/* -------------------------------------------------------------- *
 *      Copyright �2005, Cristi Potlog - All Rights reserved      *
 *                                                                *
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY *
 * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT    *
 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR    *
 * FITNESS FOR A PARTICULAR PURPOSE.                              *
 *                                                                *
 * THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE.       *
 * -------------------------------------------------------------- */
#endregion Copyright �2005, Cristi Potlog - All Rights Reserved

#region References
using System;
using System.ComponentModel;
using System.Windows.Forms;
#endregion

namespace CristiPotlog.ChartControl
{
	/// <summary>
	/// Represents the setting for the time series of the chart control.
	/// </summary>
	[TypeConverter(typeof(ExpandableObjectConverter))]
	public class ChartSeriesSettings
	{
		#region Fields
		private ChartLineSettings line = null;
		private ChartLabelsSettings labels = null;
		private ChartMarkSettings mark = null;
		private ChartProjectionsSettings projections = null;
		private ChartSeriesValueCollection values = null;
		private ChartTitleSettings title = null;
		private Control owner = null;
		#endregion

		#region Constructor
		/// <summary>
		/// Creates a new instance of class ChartSeriesSettings.
		/// </summary>
		/// <param name="owner">A Control object representing the owner chart.</param>
		internal ChartSeriesSettings(Control owner)
		{
			this.owner = owner;
			// init fields
			this.line = new ChartLineSettings(owner);
			this.labels = new ChartLabelsSettings(owner);
			this.mark = new ChartMarkSettings(owner);
			this.projections = new ChartProjectionsSettings(owner);
			this.values = new ChartSeriesValueCollection();
			this.title = new ChartTitleSettings(owner);
		}
		#endregion

		#region Properties
		/// <summary>
		/// Determines the display settings of the line for the chart series.
		/// </summary>
		[Description("Determines the display settings of the line for the chart series.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartLineSettings Line
		{
			get
			{
				return this.line;
			}
		}

		/// <summary>
		/// Determines the display settings of the labels for the chart series.
		/// </summary>
		[Description("Determines the display settings of the labels for the chart series.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartLabelsSettings Labels
		{
			get
			{
				return this.labels;
			}
		}

		/// <summary>
		/// Determines the display settings of the marks for the chart series.
		/// </summary>
		[Description("Determines the display settings of the marks for the chart series.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartMarkSettings Mark
		{
			get
			{
				return this.mark;
			}
		}

		/// <summary>
		/// Determines the display settings of the projections for the chart series.
		/// </summary>
		[Description("Determines the display settings of the projections for the chart series.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartProjectionsSettings Projections
		{
			get
			{
				return this.projections;
			}
		}

		/// <summary>
		/// Represents a colletion of values to be displayed in the chart.
		/// </summary>
		[Description("Represents a colletion of values to be displayed in the chart.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartSeriesValueCollection Values
		{
			get
			{
				return this.values;
			}
		}

		/// <summary>
		/// Determines the display settings for the title of the chart series.
		/// </summary>
		[Description("Determines the display settings for the title of chart series.")]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
		public ChartTitleSettings Title
		{
			get
			{
				return this.title;
			}
		}

		#endregion

		#region Methods
		/// <summary>
		/// Returns a string that represents the current object.  
		/// </summary>
		/// <returns>A string that represents the current object.</returns>
		public override string ToString()
		{
			return "(" + this.GetType().Name + ")";
		}
		#endregion
	}
}

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, along with any associated source code and files, is licensed under The MIT License

About the Author

Cristi Potlog
Software Developer
Romania Romania
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 25 Jul 2005
Article Copyright 2005 by Cristi Potlog
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid