Пример #1
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");
            }
        }
Пример #2
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;
            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)
            {
                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;
        }
Пример #3
0
 private void radioButton14_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButton14.Checked)
     {
         Legend = LegendPos.InsideBotRight;
         RadiobuttonsCheck();
     }
 }
Пример #4
0
 private void radioButton9_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButton9.Checked)
     {
         Legend = LegendPos.InsideTopLeft;
         RadiobuttonsCheck();
     }
 }
Пример #5
0
 private void radioButton13_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButton13.Checked)
     {
         Legend = LegendPos.BottomCenter;
         RadiobuttonsCheck();
     }
 }
Пример #6
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;

            this.location = (Location)rhs.Location;
            this.border   = (Border)rhs.Border.Clone();
            this.fill     = (Fill)rhs.Fill.Clone();

            fontSpec = (FontSpec)rhs.FontSpec.Clone();
        }
        /// <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;
        }
Пример #8
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()
        {
            this.position  = Default.Position;
            this.isHStack  = Default.IsHStack;
            this.isVisible = Default.IsVisible;
            this.Location  = new Location(0, 0, CoordType.PaneFraction);

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

            this.border = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth);
            this.fill   = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);
        }
Пример #9
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;
        }
Пример #10
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;
		}
Пример #11
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;

            this.location = (Location) rhs.Location;
            this.border = (Border) rhs.Border.Clone();
            this.fill = (Fill) rhs.Fill.Clone();

            fontSpec = (FontSpec) rhs.FontSpec.Clone();
        }
Пример #12
0
        private void DrawGraph2(bool number, Color firstLine, Color secondLine, SymbolType symbolType, bool lineShow, LegendPos legendPos)
        {
            GraphPane mainPane = zedGraphControl1.GraphPane;
            LineItem  secondFunction;

            secondFunction = mainPane.AddCurve("y = sin(x)*cos(x)", function2, secondLine, symbolType);
            if (!lineShow)
            {
                secondFunction.Line.IsVisible = false;
            }
        }
Пример #13
0
        private void DrawGraph1(bool number, Color firstLine, Color secondLine, SymbolType symbolType, bool lineShow, LegendPos legendPos)
        {
            GraphPane mainPane = zedGraphControl1.GraphPane;
            LineItem  firstFunction;

            firstFunction = mainPane.AddCurve("y = (e^(x^2))+(e^(x^2))/2e^(2(x^2))", function1, firstLine, symbolType);
            if (!lineShow)
            {
                firstFunction.Line.IsVisible = false;
            }
        }
Пример #14
0
        private void DrawGraphs(bool number, Color firstLine, Color secondLine, SymbolType symbolType, bool lineShow, LegendPos legendPos)
        {
            GraphPane mainPane = zedGraphControl1.GraphPane;

            if (number)
            {
                if (radioButton1.Checked)
                {
                    DrawGraph1(true, color1, color2, SymbolType.Circle, false, Legend);
                }
                if (radioButton2.Checked)
                {
                    DrawGraph1(true, color1, color2, SymbolType.None, true, Legend);
                }
                if (radioButton3.Checked)
                {
                    DrawGraph1(true, color1, color2, SymbolType.Diamond, true, Legend);
                }
                if (radioButton4.Checked)
                {
                    DrawGraph1(true, color1, color2, SymbolType.Plus, true, Legend);
                }
            }
            if (!number)
            {
                if (radioButton5.Checked)
                {
                    DrawGraph2(false, color1, color2, SymbolType.Circle, false, Legend);
                }
                if (radioButton6.Checked)
                {
                    DrawGraph2(false, color1, color2, SymbolType.None, true, Legend);
                }
                if (radioButton7.Checked)
                {
                    DrawGraph2(false, color1, color2, SymbolType.Diamond, true, Legend);
                }
                if (radioButton8.Checked)
                {
                    DrawGraph2(false, color1, color2, SymbolType.Plus, true, Legend);
                }
            }
            if (legendPos != Legend)
            {
                legendPos = Legend;
            }
            mainPane.Legend.Position    = legendPos;
            mainPane.Border.Color       = Color.White;
            mainPane.Chart.Border.Color = Color.Red;
            mainPane.Chart.Fill.Type    = FillType.Solid;
            mainPane.Chart.Fill.Color   = Color.FromArgb(207, 125, 19);
            mainPane.XAxis.Title.Text   = TitleX;
            mainPane.YAxis.Title.Text   = TitleY;
            mainPane.Title.Text         = "Лабораторная работа 9-10";
            zedGraphControl1.AxisChange();
            zedGraphControl1.Invalidate();
        }
Пример #15
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;
		}
Пример #16
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" );
		}
Пример #17
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()
        {
            this.position = Default.Position;
            this.isHStack = Default.IsHStack;
            this.isVisible = Default.IsVisible;
            this.Location = new Location( 0, 0, CoordType.PaneFraction );

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

            this.border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth );
            this.fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType );
        }