Esempio n. 1
0
		/// <summary>
		/// Copy constructor
		/// </summary>
		/// <param name="rhs">The source <see cref="Chart" /> to be copied.</param>
		public Chart( Chart rhs )
		{
			_border = rhs._border.Clone();
			_fill = rhs._fill.Clone();
			_rect = rhs._rect;
			_isRectAuto = rhs._isRectAuto;
		}
        //-------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------
        private static void SetDefaultGraphPaneSettings(GraphPane graphPane)
        {
            graphPane.XAxis.Cross = 0.0;
            graphPane.YAxis.Cross = 0.0;

            int fontSize = 8;

            graphPane.XAxis.Title.FontSpec.Size = fontSize;
            graphPane.YAxis.Title.FontSpec.Size = fontSize;

            bool isVisibleBorder = false;

            System.Drawing.Color borderColor     = System.Drawing.Color.Black;
            ZedGraph.Border      axisTitleBorder = new ZedGraph.Border(isVisibleBorder, borderColor, 1);
            graphPane.YAxis.Title.FontSpec.Border = axisTitleBorder;
        }
Esempio n. 3
0
		/// <summary>
		/// A constructor that allows the position, border color, and two-color
		/// gradient fill colors
		/// of the <see cref="BoxObj"/> to be pre-specified.
		/// </summary>
		/// <param name="borderColor">An arbitrary <see cref="System.Drawing.Color"/> specification
		/// for the box border</param>
		/// <param name="fillColor1">An arbitrary <see cref="System.Drawing.Color"/> specification
		/// for the start of the box gradient fill</param>
		/// <param name="fillColor2">An arbitrary <see cref="System.Drawing.Color"/> specification
		/// for the end of the box gradient fill</param>
		/// <param name="x">The x location for this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="y">The y location for this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="width">The width of this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="height">The height of this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		public BoxObj( double x, double y, double width, double height, Color borderColor,
							Color fillColor1, Color fillColor2 ) :
				base( x, y, width, height )
		{
			this.Border = new Border( borderColor, Default.PenWidth );
			this.Fill = new Fill( fillColor1, fillColor2 );
		}
Esempio n. 4
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected BoxObj( 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( "schema2" );

			_fill = (Fill) info.GetValue( "fill", typeof(Fill) );
			_border = (Border) info.GetValue( "border", typeof(Border) );
		}
Esempio n. 5
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected PaneBase( SerializationInfo info, StreamingContext 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( "schema" );

			_rect = (RectangleF) info.GetValue( "rect", typeof(RectangleF) );
			_legend = (Legend) info.GetValue( "legend", typeof(Legend) );
			_title = (GapLabel) info.GetValue( "title", typeof(GapLabel) );
			//this.isShowTitle = info.GetBoolean( "isShowTitle" );
			_isFontsScaled = info.GetBoolean( "isFontsScaled" );
			_isPenWidthScaled = info.GetBoolean( "isPenWidthScaled" );
			//this.fontSpec = (FontSpec) info.GetValue( "fontSpec" , typeof(FontSpec) );
			_titleGap = info.GetSingle( "titleGap" );
			_fill = (Fill) info.GetValue( "fill", typeof(Fill) );
			_border = (Border) info.GetValue( "border", typeof(Border) );
			_baseDimension = info.GetSingle( "baseDimension" );
			_margin = (Margin)info.GetValue( "margin", typeof( Margin ) );
			_graphObjList = (GraphObjList) info.GetValue( "graphObjList", typeof(GraphObjList) );

			_tag = info.GetValue( "tag", typeof(object) );

		}
Esempio n. 6
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected PieItem( 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( "schema2" );

            _displacement = info.GetDouble( "displacement" );
            _labelDetail = (TextObj)info.GetValue( "labelDetail", typeof( TextObj ) );
            _fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
            _border = (Border)info.GetValue( "border", typeof( Border ) );
            _pieValue = info.GetDouble( "pieValue" );
            _labelType = (PieLabelType)info.GetValue( "labelType", typeof( PieLabelType ) );
            _intersectionPoint = (PointF)info.GetValue( "intersectionPoint", typeof( PointF ) );
            _boundingRectangle = (RectangleF)info.GetValue( "boundingRectangle", typeof( RectangleF ) );
            _pivotPoint = (PointF)info.GetValue( "pivotPoint", typeof( PointF ) );
            _endPoint = (PointF)info.GetValue( "endPoint", typeof( PointF ) );
            // _slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) );
            _startAngle = (float)info.GetDouble( "startAngle" );
            _sweepAngle = (float)info.GetDouble( "sweepAngle" );
            _midAngle = (float)info.GetDouble( "midAngle" );
            _labelStr = info.GetString( "labelStr" );
            _valueDecimalDigits = info.GetInt32( "valueDecimalDigits" );
            _percentDecimalDigits = info.GetInt32( "percentDecimalDigits" );
        }
Esempio n. 7
0
 /// <summary>
 /// Create a new <see cref="GasGaugeRegion"/>
 /// </summary>
 /// <param name="label">The value associated with this <see cref="GasGaugeRegion"/> instance.</param>
 /// <param name="color">The display color for this <see cref="GasGaugeRegion"/> instance.</param>
 /// <param name="minVal">The minimum value of this <see cref="GasGaugeNeedle"/>.</param>
 /// <param name="maxVal">The maximum value of this <see cref="GasGaugeNeedle"/>.</param>
 public GasGaugeRegion(string label, double minVal, double maxVal, Color color)
     : base(label)
 {
     MinValue = minVal;
     MaxValue = maxVal;
     RegionColor = color;
     StartAngle = 0f;
     SweepAngle = 0f;
     _border = new Border(Default.BorderColor, Default.BorderWidth);
     _labelDetail = new TextObj();
     _labelDetail.FontSpec.Size = Default.FontSize;
     _slicePath = null;
 }
Esempio n. 8
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Bar object from which to copy</param>
 public Bar(Bar rhs)
 {
     _border = rhs.Border.Clone();
     _fill   = rhs.Fill.Clone();
 }
Esempio n. 9
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="BoxObj"/> object from which to copy</param>
 public BoxObj(BoxObj rhs) : base(rhs)
 {
     this.Border = rhs.Border.Clone();
     this.Fill   = rhs.Fill.Clone();
 }
Esempio n. 10
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected Legend( SerializationInfo info, StreamingContext 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( "schema" );

			_position = (LegendPos)info.GetValue( "position", typeof( LegendPos ) );
			_isHStack = info.GetBoolean( "isHStack" );
			_isVisible = info.GetBoolean( "isVisible" );
			_fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
			_border = (Border)info.GetValue( "border", typeof( Border ) );
			_fontSpec = (FontSpec)info.GetValue( "fontSpec", typeof( FontSpec ) );
			_location = (Location)info.GetValue( "location", typeof( Location ) );

			_gap = info.GetSingle( "gap" );

			if ( schema >= 11 )
				_isReverse = info.GetBoolean( "isReverse" );

			if ( schema >= 12 )
				_isShowLegendSymbols = info.GetBoolean( "isShowLegendSymbols" );
		}
Esempio n. 11
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Border object from which to copy</param>
 public Border(Border rhs) : base(rhs)
 {
     _inflateFactor = rhs._inflateFactor;
 }
Esempio n. 12
0
 /// <overloads>Constructors for the <see cref="BoxObj"/> object</overloads>
 /// <summary>
 /// A constructor that allows the position, border color, and solid fill color
 /// of the <see cref="BoxObj"/> to be pre-specified.
 /// </summary>
 /// <param name="borderColor">An arbitrary <see cref="System.Drawing.Color"/> specification
 /// for the box border</param>
 /// <param name="fillColor">An arbitrary <see cref="System.Drawing.Color"/> specification
 /// for the box fill (will be a solid color fill)</param>
 /// <param name="x">The x location for this <see cref="BoxObj" />.  This will be in units determined by
 /// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
 /// <param name="y">The y location for this <see cref="BoxObj" />.  This will be in units determined by
 /// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
 /// <param name="width">The width of this <see cref="BoxObj" />.  This will be in units determined by
 /// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
 /// <param name="height">The height of this <see cref="BoxObj" />.  This will be in units determined by
 /// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
 public BoxObj(double x, double y, double width, double height, Color borderColor, Color fillColor)
     : base(x, y, width, height)
 {
     this.Border = new Border(borderColor, Default.PenWidth);
     this.Fill   = new Fill(fillColor);
 }
Esempio n. 13
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Bar object from which to copy</param>
 public Bar(Bar rhs)
 {
     _border = (Border)rhs.Border.Clone();
     _fill   = (Fill)rhs.Fill.Clone();
 }
Esempio n. 14
0
 /// <summary>
 /// Default constructor that sets the
 /// <see cref="Color"/> as specified, and the remaining
 /// <see cref="Bar"/> properties to default
 /// values as defined in the <see cref="Default"/> class.
 /// The specified color is only applied to the
 /// <see cref="ZedGraph.Fill.Color"/>, and the <see cref="ZedGraph.LineBase.Color"/>
 /// will be defaulted.
 /// </summary>
 /// <param name="color">A <see cref="Color"/> value indicating
 /// the <see cref="ZedGraph.Fill.Color"/>
 /// of the Bar.
 /// </param>
 public Bar(Color color)
 {
     _border = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth);
     _fill   = new Fill(color.IsEmpty ? Default.FillColor : color,
                        Default.FillBrush, Default.FillType);
 }
Esempio n. 15
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public Chart()
 {
     _isRectAuto = true;
     _border     = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth);
     _fill       = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);
 }
Esempio n. 16
0
 /// <summary>
 /// Default constructor that sets the 
 /// <see cref="Color"/> as specified, and the remaining
 /// <see cref="Bar"/> properties to default
 /// values as defined in the <see cref="Default"/> class.
 /// The specified color is only applied to the
 /// <see cref="ZedGraph.Fill.Color"/>, and the <see cref="ZedGraph.Border.Color"/>
 /// will be defaulted.
 /// </summary>
 /// <param name="color">A <see cref="Color"/> value indicating
 /// the <see cref="ZedGraph.Fill.Color"/>
 /// of the Bar.
 /// </param>
 public Bar( Color color )
 {
     this.border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth );
      this.fill = new Fill( color.IsEmpty ? Default.FillColor : color,
           Default.FillBrush, Default.FillType );
 }
Esempio n. 17
0
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Chart()
		{
			_isRectAuto = true;
			_border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth );
			_fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType );
		}
Esempio n. 18
0
		/// <summary>
		/// Default constructor that sets all <see cref="Legend"/> properties to default
		/// values as defined in the <see cref="Default"/> class.
		/// </summary>
		public Legend()
		{
			_position = Default.Position;
			_isHStack = Default.IsHStack;
			_isVisible = Default.IsVisible;
			this.Location = new Location( 0, 0, CoordType.PaneFraction );

			_fontSpec = new FontSpec( Default.FontFamily, Default.FontSize,
				Default.FontColor, Default.FontBold,
				Default.FontItalic, Default.FontUnderline,
				Default.FontFillColor, Default.FontFillBrush,
				Default.FontFillType );
			_fontSpec.Border.IsVisible = false;

			_border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth );
			_fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType );

			_gap = Default.Gap;

			_isReverse = Default.IsReverse;

			_isShowLegendSymbols = Default.IsShowLegendSymbols;
		}
Esempio n. 19
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected GasGaugeRegion(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("schema2");

            _labelDetail = (TextObj) info.GetValue("labelDetail", typeof (TextObj));
            _fill = (Fill) info.GetValue("fill", typeof (Fill));
            _border = (Border) info.GetValue("border", typeof (Border));
            _color = (Color) info.GetValue("color", typeof (Color));
            _minValue = info.GetDouble("minValue");
            _maxValue = info.GetDouble("maxValue");
            _startAngle = (float) info.GetDouble("startAngle");
            _sweepAngle = (float) info.GetDouble("sweepAngle");
            _boundingRectangle = (RectangleF) info.GetValue("boundingRectangle", typeof (RectangleF));
            _slicePath = (GraphicsPath) info.GetValue("slicePath", typeof (GraphicsPath));
        }
Esempio n. 20
0
 /// <summary>
 /// A constructor that allows the position
 /// of the <see cref="BoxItem"/> to be pre-specified.  Other properties are defaulted.
 /// </summary>
 /// <param name="rect">The <see cref="RectangleF"/> struct that defines
 /// the box.  This will be in units determined by
 /// <see cref="ZedGraph.Location.CoordinateFrame"/>.
 /// </param>
 public BoxItem(RectangleF rect) :
     base(rect.Left, rect.Top, rect.Width, rect.Height)
 {
     this.Border = new Border(Default.BorderColor, Default.PenWidth);
     this.Fill   = new Fill(Default.FillColor);
 }
Esempio n. 21
0
		/// <summary>
		/// Default constructor for the <see cref="PaneBase"/> class.  Specifies the <see cref="Title"/> of
		/// the <see cref="PaneBase"/>, and the size of the <see cref="Rect"/>.
		/// </summary>
		public PaneBase( string title, RectangleF paneRect )
		{
			_rect = paneRect;

			_legend = new Legend();
				
			_baseDimension = Default.BaseDimension;
			_margin = new Margin();
			_titleGap = Default.TitleGap;

			_isFontsScaled = Default.IsFontsScaled;
			_isPenWidthScaled = Default.IsPenWidthScaled;
			_fill = new Fill( Default.FillColor );
			_border = new Border( Default.IsBorderVisible, Default.BorderColor,
				Default.BorderPenWidth );

			_title = new GapLabel( title, Default.FontFamily,
				Default.FontSize, Default.FontColor, Default.FontBold,
				Default.FontItalic, Default.FontUnderline );
			_title._fontSpec.Fill.IsVisible = false;
			_title._fontSpec.Border.IsVisible = false;

			_graphObjList = new GraphObjList();
			
			_tag = null;
		}
Esempio n. 22
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="ggr">The <see cref="GasGaugeRegion"/> object from which to copy</param>
 public GasGaugeRegion(GasGaugeRegion ggr)
     : base(ggr)
 {
     _minValue = ggr._minValue;
     _maxValue = ggr._maxValue;
     _color = ggr._color;
     _startAngle = ggr._startAngle;
     _sweepAngle = ggr._sweepAngle;
     _border = ggr._border.Clone();
     _labelDetail = ggr._labelDetail.Clone();
 }
Esempio n. 23
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="BoxItem"/> object from which to copy</param>
 public BoxItem(BoxItem rhs) : base(rhs)
 {
     this.Border = (Border)rhs.Border.Clone();
     this.Fill   = (Fill)rhs.Fill.Clone();
 }
Esempio n. 24
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Bar object from which to copy</param>
 public Bar(Bar rhs)
 {
     _border = rhs.Border.Clone();
     _fill = rhs.Fill.Clone();
 }
Esempio n. 25
0
		/// <summary>
		/// Create a new <see cref="GasGaugeNeedle"/>
		/// </summary>
		/// <param name="label">The value associated with this <see cref="GasGaugeNeedle"/>
		/// instance.</param>
		/// <param name="color">The display color for this <see cref="GasGaugeNeedle"/>
		/// instance.</param>
		/// <param name="val">The value of this <see cref="GasGaugeNeedle"/>.</param>
		public GasGaugeNeedle(string label, double val, Color color)
			: base(label)
		{
			NeedleValue = val;
			NeedleColor = color;
			NeedleWidth = Default.NeedleWidth;
			SweepAngle = 0f;
			_border = new Border(Default.BorderColor, Default.BorderWidth);
			_labelDetail = new TextObj();
			_labelDetail.FontSpec.Size = Default.FontSize;
			_slicePath = null;
		}
Esempio n. 26
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see cref="PaneBase"/> object from which to copy</param>
		public PaneBase( PaneBase rhs )
		{
			// copy over all the value types
			_isFontsScaled = rhs._isFontsScaled;
			_isPenWidthScaled = rhs._isPenWidthScaled;

			_titleGap = rhs._titleGap;
			_baseDimension = rhs._baseDimension;
			_margin = rhs._margin.Clone();
			_rect = rhs._rect;

			// Copy the reference types by cloning
			_fill = rhs._fill.Clone();
			_border = rhs._border.Clone();
			_title = rhs._title.Clone();

			_legend = rhs.Legend.Clone();
			_title = rhs._title.Clone();
			_graphObjList = rhs._graphObjList.Clone();
			
			if ( rhs._tag is ICloneable )
				_tag = ((ICloneable) rhs._tag).Clone();
			else
				_tag = rhs._tag;
		}
Esempio n. 27
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="ggn">The <see cref="GasGaugeNeedle"/> object from which to copy</param>
		public GasGaugeNeedle(GasGaugeNeedle ggn)
			: base(ggn)
		{
			NeedleValue = ggn.NeedleValue;
			NeedleColor = ggn.NeedleColor;
			NeedleWidth = ggn.NeedleWidth;
			SweepAngle = ggn.SweepAngle;
			_border = ggn.Border.Clone();
			_labelDetail = ggn.LabelDetail.Clone();
			_labelDetail.FontSpec.Size = ggn.LabelDetail.FontSpec.Size;
		}
Esempio n. 28
0
 /// <summary>
 /// Create a new <see cref="PieItem"/>.
 /// </summary>
 /// <param name="pieValue">The value associated with this <see cref="PieItem"/> instance.</param>
 /// <param name="color">The display color for this <see cref="PieItem"/> instance.</param>
 /// <param name="displacement">The amount this <see cref="PieItem"/>  instance will be 
 /// displaced from the center point.</param>
 /// <param name="label">Text label for this <see cref="PieItem"/> instance.</param>
 public PieItem( double pieValue, Color color, double displacement, string label )
     : base(label)
 {
     _pieValue = pieValue;
     _fill = new Fill( color.IsEmpty ? _rotator.NextColor : color );
     _displacement = displacement;
     _border = new Border( Default.BorderColor, Default.BorderWidth );
     _labelDetail = new TextObj();
     _labelDetail.FontSpec.Size = Default.FontSize;
     _labelType = Default.LabelType;
     _valueDecimalDigits = Default.ValueDecimalDigits;
     _percentDecimalDigits = Default.PercentDecimalDigits;
     _slicePath = null;
 }
Esempio n. 29
0
        private void CreateGraph_Clone( ZedGraphControl z1 )
        {
            MasterPane master = z1.MasterPane;

            Border myBorder = new Border();
            myBorder.IsVisible = false;
            master.Border = myBorder;
            master.PaneList.Clear();
            master.Title.Text = "First try";
            master.Margin.All = 10;
            master.InnerPaneGap = 10;
            // Enable the master pane legend
            master.Legend.IsVisible = true;
            master.Legend.Position = ZedGraph.LegendPos.TopCenter;
            GraphPane[] myPane = new GraphPane[3];
            for ( int j = 0; j < 3; j++ )
            {
                if ( j < 2 )
                    myPane[j] = new GraphPane( new RectangleF( 40, 40, 150, 100 ), "", "", "" );
                else
                    myPane[j] = new GraphPane( new RectangleF( 40, 40, 300, 100 ), "", "", "" );

                myPane[j].Fill = new Fill( Color.BlanchedAlmond );

                // myPane(j).AxisFill = New ZedGraph.Fill(Color.SeaGreen)
                myPane[j].BaseDimension = 6.0F;
                myPane[j].XAxis.Title.IsVisible = true;
                myPane[j].XAxis.Scale.IsVisible = true;
                myPane[j].Legend.IsVisible = false;
                myPane[j].Border.IsVisible = false;
                myPane[j].Title.IsVisible = true;
                myPane[j].Margin.All = 0;

                // This sets the minimum amount of space for the left and right side, respectively
                // The reason for this is so that the AxisRects all end up being the same size.

                myPane[j].YAxis.MinSpace = 50;
                myPane[j].Y2Axis.MinSpace = 20;
                master.Add( myPane[j] );
            }

            using ( Graphics g = CreateGraphics() )
                master.SetLayout( g, PaneLayout.ExplicitCol21 );
            //Call GetMonthlist()
            //myPane[0] = zgHistogram.GraphPane.Clone;
            //myPane[1] = zgProbability.GraphPane.Clone;
            //myPane[2] = zgTimeSeries.GraphPane.Clone;

            // instead of

            // Call CreateGraph_TimeSeries(zgM, myPane(2))
            // Call CreateGraph_Probability(zgM, myPane(1))
            // Call CreateGraph_Histogram(zgM, myPane(0))
            z1.AxisChange();
            z1.Refresh();
        }
Esempio n. 30
0
		/// <summary>
		/// A constructor that allows the position
		/// of the <see cref="BoxObj"/> to be pre-specified.  Other properties are defaulted.
		/// </summary>
		/// <param name="x">The x location for this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="y">The y location for this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="width">The width of this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="height">The height of this <see cref="BoxObj" />.  This will be in units determined by
		/// <see cref="ZedGraph.Location.CoordinateFrame" />.</param>
		public BoxObj( double x, double y, double width, double height )
			:
			base( x, y, width, height )
		{
			this.Border = new Border( Default.BorderColor, Default.PenWidth );
			this.Fill = new Fill( Default.FillColor );
		}
Esempio n. 31
0
        private void Init( string family, float size, Color color, bool isBold,
			bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush,
			FillType fillType )
        {
            _fontColor = color;
            _family = family;
            _isBold = isBold;
            _isItalic = isItalic;
            _isUnderline = isUnderline;
            _size = size;
            _angle = 0F;

            _isAntiAlias = Default.IsAntiAlias;
            _stringAlignment = Default.StringAlignment;
            _isDropShadow = Default.IsDropShadow;
            _dropShadowColor = Default.DropShadowColor;
            _dropShadowAngle = Default.DropShadowAngle;
            _dropShadowOffset = Default.DropShadowOffset;
            _scaleFactor = Default.ScaleFactor;

            _fill = new Fill( fillColor, fillBrush, fillType );
            _border = new Border( true, Color.Black, 1.0F );

            _scaledSize = -1;
            Remake( 1.0F, _size, ref _scaledSize, ref _font );
        }
Esempio n. 32
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see cref="BoxObj"/> object from which to copy</param>
		public BoxObj( BoxObj rhs ) : base( rhs )
		{
			this.Border = rhs.Border.Clone();
			this.Fill = rhs.Fill.Clone();
		}
Esempio n. 33
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The FontSpec object from which to copy</param>
        public FontSpec( FontSpec rhs )
        {
            _fontColor = rhs.FontColor;
            _family = rhs.Family;
            _isBold = rhs.IsBold;
            _isItalic = rhs.IsItalic;
            _isUnderline = rhs.IsUnderline;
            _fill = rhs.Fill.Clone();
            _border = rhs.Border.Clone();
            _isAntiAlias = rhs._isAntiAlias;

            _stringAlignment = rhs.StringAlignment;
            _angle = rhs.Angle;
            _size = rhs.Size;

            _isDropShadow = rhs._isDropShadow;
            _dropShadowColor = rhs._dropShadowColor;
            _dropShadowAngle = rhs._dropShadowAngle;
            _dropShadowOffset = rhs._dropShadowOffset;
            _scaleFactor = rhs._scaleFactor;

            _scaledSize = rhs._scaledSize;
            Remake( 1.0F, _size, ref _scaledSize, ref _font );
        }
Esempio n. 34
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected FontSpec( SerializationInfo info, StreamingContext 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( "schema" );

            _fontColor = (Color)info.GetValue( "fontColor", typeof( Color ) );
            _family = info.GetString( "family" );
            _isBold = info.GetBoolean( "isBold" );
            _isItalic = info.GetBoolean( "isItalic" );
            _isUnderline = info.GetBoolean( "isUnderline" );
            _isAntiAlias = info.GetBoolean( "isAntiAlias" );

            _fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
            _border = (Border)info.GetValue( "border", typeof( Border ) );
            _angle = info.GetSingle( "angle" );
            _stringAlignment = (StringAlignment)info.GetValue( "stringAlignment", typeof( StringAlignment ) );
            _size = info.GetSingle( "size" );

            _isDropShadow = info.GetBoolean( "isDropShadow" );
            _dropShadowColor = (Color)info.GetValue( "dropShadowColor", typeof( Color ) );
            _dropShadowAngle = info.GetSingle( "dropShadowAngle" );
            _dropShadowOffset = info.GetSingle( "dropShadowOffset" );
            _scaleFactor = info.GetSingle("scaleFactor");

            _scaledSize = -1;
            Remake( 1.0F, _size, ref _scaledSize, ref _font );
        }
Esempio n. 35
0
 /// <summary>
 /// Default constructor that sets the <see cref="SymbolType"/> and
 /// <see cref="Color"/> as specified, and the remaining
 /// <see cref="Symbol"/> properties to default
 /// values as defined in the <see cref="Default"/> class.
 /// </summary>
 /// <param name="type">A <see cref="SymbolType"/> enum value
 /// indicating the shape of the symbol</param>
 /// <param name="color">A <see cref="Color"/> value indicating
 /// the color of the symbol
 /// </param>
 public Symbol( SymbolType type, Color color )
 {
     _size = Default.Size;
     _type = type;
     _isAntiAlias = Default.IsAntiAlias;
     _isVisible = Default.IsVisible;
     _border = new Border( Default.IsBorderVisible, color, Default.PenWidth );
     _fill = new Fill( color, Default.FillBrush, Default.FillType );
     _userSymbol = null;
 }
Esempio n. 36
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Bar object from which to copy</param>
 public Bar( Bar rhs )
 {
     this.border = (Border) rhs.Border.Clone();
      this.fill = (Fill) rhs.Fill.Clone();
 }
Esempio n. 37
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The Symbol object from which to copy</param>
        public Symbol( Symbol rhs )
        {
            _size = rhs.Size;
            _type = rhs.Type;
            _isAntiAlias = rhs._isAntiAlias;
            _isVisible = rhs.IsVisible;
            _fill = rhs.Fill.Clone();
            _border = rhs.Border.Clone();

            if ( rhs.UserSymbol != null )
                _userSymbol = rhs.UserSymbol.Clone() as GraphicsPath;
            else
                _userSymbol = null;
        }
Esempio n. 38
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The XAxis object from which to copy</param>
		public Legend( Legend rhs )
		{
			_rect = rhs.Rect;
			_position = rhs.Position;
			_isHStack = rhs.IsHStack;
			_isVisible = rhs.IsVisible;

			_location = rhs.Location;
			_border = rhs.Border.Clone();
			_fill = rhs.Fill.Clone();

			_fontSpec = rhs.FontSpec.Clone();

			_gap = rhs._gap;

			_isReverse = rhs._isReverse;

			_isShowLegendSymbols = rhs._isShowLegendSymbols;
		}
Esempio n. 39
0
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected Symbol( SerializationInfo info, StreamingContext 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( "schema" );

            _size = info.GetSingle( "size" );
            _type = (SymbolType) info.GetValue( "type", typeof(SymbolType) );
            _isAntiAlias = info.GetBoolean( "isAntiAlias" );
            _isVisible = info.GetBoolean( "isVisible" );
            _fill = (Fill) info.GetValue( "fill", typeof(Fill) );
            _border = (Border) info.GetValue( "border", typeof(Border) );

            if ( sch >= 11 )
                _userSymbol = (GraphicsPath)info.GetValue( "userSymbol", typeof( GraphicsPath ) );
            else
                _userSymbol = null;
        }
Esempio n. 40
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Border object from which to copy</param>
 public Border( Border rhs )
     : base(rhs)
 {
     _inflateFactor = rhs._inflateFactor;
 }
Esempio n. 41
0
        /// <summary>
        /// Draw all the <see cref="JapaneseCandleStick"/>'s to the specified <see cref="Graphics"/>
        /// device as a candlestick at each defined point.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see cref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="curve">A <see cref="JapaneseCandleStickItem"/> object representing the
        /// <see cref="JapaneseCandleStick"/>'s to be drawn.</param>
        /// <param name="baseAxis">The <see cref="Axis"/> class instance that defines the base (independent)
        /// axis for the <see cref="JapaneseCandleStick"/></param>
        /// <param name="valueAxis">The <see cref="Axis"/> class instance that defines the value (dependent)
        /// axis for the <see cref="JapaneseCandleStick"/></param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see cref="GraphPane"/> object using the
        /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        public void Draw(Graphics g, GraphPane pane, JapaneseCandleStickItem curve,
                         Axis baseAxis, Axis valueAxis, float scaleFactor)
        {
            //ValueHandler valueHandler = new ValueHandler( pane, false );

            float pixBase, pixHigh, pixLow, pixOpen, pixClose;

            if (curve.Points != null)
            {
                //float halfSize = _size * scaleFactor;
                float halfSize = GetBarWidth(pane, baseAxis, scaleFactor);

                Color  tColor         = _color;
                Color  tFallingColor  = _fallingColor;
                float  tPenWidth      = _width;
                Fill   tRisingFill    = _risingFill;
                Fill   tFallingFill   = _fallingFill;
                Border tRisingBorder  = _risingBorder;
                Border tFallingBorder = _fallingBorder;
                if (curve.IsSelected)
                {
                    tColor         = Selection.Border.Color;
                    tFallingColor  = Selection.Border.Color;
                    tPenWidth      = Selection.Border.Width;
                    tRisingFill    = Selection.Fill;
                    tFallingFill   = Selection.Fill;
                    tRisingBorder  = Selection.Border;
                    tFallingBorder = Selection.Border;
                }

                using (Pen risingPen = new Pen(tColor, tPenWidth))
                    using (Pen fallingPen = new Pen(tFallingColor, tPenWidth))
                    {
                        // Loop over each defined point
                        for (int i = 0; i < curve.Points.Count; i++)
                        {
                            PointPair pt    = curve.Points[i];
                            double    date  = pt.X;
                            double    high  = pt.Y;
                            double    low   = pt.Z;
                            double    open  = PointPair.Missing;
                            double    close = PointPair.Missing;
                            if (pt is StockPt)
                            {
                                open  = (pt as StockPt).Open;
                                close = (pt as StockPt).Close;
                            }

                            // Any value set to double max is invalid and should be skipped
                            // This is used for calculated values that are out of range, divide
                            //   by zero, etc.
                            // Also, any value <= zero on a log scale is invalid

                            if (!curve.Points[i].IsInvalid3D &&
                                (date > 0 || !baseAxis._scale.IsLog) &&
                                ((high > 0 && low > 0) || !valueAxis._scale.IsLog))
                            {
                                pixBase = (int)(baseAxis.Scale.Transform(curve.IsOverrideOrdinal, i, date) + 0.5);
                                //pixBase = baseAxis.Scale.Transform( curve.IsOverrideOrdinal, i, date );
                                pixHigh = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, high);
                                pixLow  = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, low);
                                if (PointPair.IsValueInvalid(open))
                                {
                                    pixOpen = Single.MaxValue;
                                }
                                else
                                {
                                    pixOpen = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, open);
                                }

                                if (PointPair.IsValueInvalid(close))
                                {
                                    pixClose = Single.MaxValue;
                                }
                                else
                                {
                                    pixClose = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, close);
                                }

                                if (!curve.IsSelected && this._gradientFill.IsGradientValueType)
                                {
                                    using (Pen tPen = GetPen(pane, scaleFactor, pt))
                                        Draw(g, pane, baseAxis is XAxis || baseAxis is X2Axis,
                                             pixBase, pixHigh, pixLow, pixOpen,
                                             pixClose, halfSize, scaleFactor,
                                             (tPen),
                                             (close > open ? tRisingFill : tFallingFill),
                                             (close > open ? tRisingBorder : tFallingBorder), pt);
                                }
                                else
                                {
                                    Draw(g, pane, baseAxis is XAxis || baseAxis is X2Axis,
                                         pixBase, pixHigh, pixLow, pixOpen,
                                         pixClose, halfSize, scaleFactor,
                                         (close > open ? risingPen : fallingPen),
                                         (close > open ? tRisingFill : tFallingFill),
                                         (close > open ? tRisingBorder : tFallingBorder), pt);
                                }
                            }
                        }
                    }
            }
        }