//============================================================================ //ZedGraph Class Library - A Flexible Line Graph/Bar Graph Library in C# //Copyright © 2004 John Champion // //This library is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public //License as published by the Free Software Foundation; either //version 2.1 of the License, or (at your option) any later version. // //This library is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //General Public License for more details. // //You should have received a copy of the GNU General Public //License along with this library; if not, write to the Free Software //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //============================================================================= #region Using directives using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.Serialization; using System.Security.Permissions; #endregion namespace ZedGraph { /// /// Encapsulates an "High-Low" Bar curve type that displays a bar in which both /// the bottom and the top of the bar are set by data valuesfrom the /// struct. /// /// The type is intended for displaying /// bars that cover a band of data, such as a confidence interval, "waterfall" /// chart, etc. The position of each bar is set /// according to the values. The independent axis /// is assigned with , and is a /// enum type. If /// is set to or , then /// the bars will actually be horizontal, since the X axis becomes the /// value axis and the Y or Y2 axis becomes the independent axis. /// John Champion /// $Revision: 3.18 $ $Date: 2007-11-03 04:41:28 $ [Serializable] public class HiLowBarItem : BarItem, ICloneable, ISerializable { #region Constructors /// /// Create a new using the specified properties. /// /// The label that will appear in the legend. /// An array of double precision values that define /// the independent (X axis) values for this curve /// An array of double precision values that define /// the dependent (Y axis) values for this curve /// An array of double precision values that define the /// base value (the bottom) of the bars for this curve. /// /// A value that will be applied to /// the and properties. /// public HiLowBarItem( string label, double[] x, double[] y, double[] baseVal, Color color ) : this( label, new PointPairList( x, y, baseVal ), color ) { } /// /// Create a new using the specified properties. /// /// The label that will appear in the legend. /// A of double precision value trio's that define /// the X, Y, and lower dependent values for this curve /// A value that will be applied to /// the and properties. /// public HiLowBarItem( string label, IPointList points, Color color ) : base( label, points, color ) { } /// /// The Copy Constructor /// /// The object from which to copy public HiLowBarItem( HiLowBarItem rhs ) : base( rhs ) { _bar = rhs._bar.Clone(); // new HiLowBar( rhs.Bar ); } /// /// Implement the interface in a typesafe manner by just /// calling the typed version of /// /// A deep copy of this object object ICloneable.Clone() { return this.Clone(); } /// /// Typesafe, deep-copy clone method. /// /// A new, independent copy of this class new public HiLowBarItem Clone() { return new HiLowBarItem( this ); } #endregion #region Serialization /// /// Current schema value that defines the version of the serialized file /// public const int schema3 = 11; /// /// Constructor for deserializing objects /// /// A instance that defines the serialized data /// /// A instance that contains the serialized data /// protected HiLowBarItem( SerializationInfo info, StreamingContext context ) : base( info, context ) { // The schema value is just a file version parameter. You can use it to make future versions // backwards compatible as new member variables are added to classes int sch = info.GetInt32( "schema3" ); } /// /// Populates a instance with the data needed to serialize the target object /// /// A instance that defines the serialized data /// A instance that contains the serialized data [SecurityPermissionAttribute(SecurityAction.Demand,SerializationFormatter=true)] public override void GetObjectData( SerializationInfo info, StreamingContext context ) { base.GetObjectData( info, context ); } #endregion } }