Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class. 
 /// Copy constructor
 /// </summary>
 /// <param name="rhs">
 /// The source <see cref="Chart"/> to be copied.
 /// </param>
 public Chart(Chart rhs)
 {
     this._border = rhs._border.Clone();
     this._fill = rhs._fill.Clone();
     this._rect = rhs._rect;
     this._isRectAuto = rhs._isRectAuto;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JapaneseCandleStick"/> class. 
        /// Default constructor that sets all <see cref="JapaneseCandleStick"/> properties to default values as defined in the <see cref="Default"/>
        /// class.
        /// </summary>
        public JapaneseCandleStick()
        {
            this._risingFill = new Fill(Default.RisingColor);
            this._fallingFill = new Fill(Default.FallingColor);

            this._risingBorder = new Border(Default.RisingBorder, LineBase.Default.Width);
            this._fallingBorder = new Border(Default.FallingBorder, LineBase.Default.Width);

            this._fallingColor = Default.FallingColor;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Fill"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The Fill object from which to copy
        /// </param>
        public Fill(Fill rhs)
        {
            this._color = rhs._color;
            this._secondaryValueGradientColor = rhs._color;

            if (rhs._brush != null)
            {
                this._brush = (Brush)rhs._brush.Clone();
            }
            else
            {
                this._brush = null;
            }

            this._type = rhs._type;
            this._alignH = rhs.AlignH;
            this._alignV = rhs.AlignV;
            this._isScaled = rhs.IsScaled;
            this._rangeMin = rhs._rangeMin;
            this._rangeMax = rhs._rangeMax;
            this._rangeDefault = rhs._rangeDefault;
            this._gradientBM = null;

            if (rhs._colorList != null)
            {
                this._colorList = (Color[])rhs._colorList.Clone();
            }
            else
            {
                this._colorList = null;
            }

            if (rhs._positionList != null)
            {
                this._positionList = (float[])rhs._positionList.Clone();
            }
            else
            {
                this._positionList = null;
            }

            if (rhs._image != null)
            {
                this._image = (Image)rhs._image.Clone();
            }
            else
            {
                this._image = null;
            }

            this._angle = rhs._angle;
            this._wrapMode = rhs._wrapMode;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// 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
            this._isFontsScaled = rhs._isFontsScaled;
            this._isPenWidthScaled = rhs._isPenWidthScaled;

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

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

            this._legend = rhs.Legend.Clone();
            this._title = rhs._title.Clone();
            this._graphObjList = rhs._graphObjList.Clone();

            if (rhs._tag is ICloneable)
            {
                this._tag = ((ICloneable)rhs._tag).Clone();
            }
            else
            {
                this._tag = rhs._tag;
            }
        }
Example #5
0
        /// <summary>
        /// Create a fill brush using current properties.  This method will construct a brush based on the settings of <see cref="Fill.Type"/>,
        /// <see cref="Fill.Color"/>
        /// and <see cref="Fill.Brush"/>.  If
        /// <see cref="Fill.Type"/> is set to <see cref="FillType.Brush"/> and
        /// <see cref="Fill.Brush"/>
        /// is null, then a <see cref="LinearGradientBrush"/> will be created between the colors of
        /// <see cref="System.Drawing.Color.White"/> and <see cref="Fill.Color"/>.
        /// </summary>
        /// <param name="rect">
        /// A rectangle that bounds the object to be filled.  This determines the start and end of the gradient fill.
        /// </param>
        /// <param name="dataValue">
        /// The data value to be used for a value-based color gradient.  This is only applicable for <see cref="FillType.GradientByX"/>,
        /// <see cref="FillType.GradientByY"/> or <see cref="FillType.GradientByZ"/>.
        /// </param>
        /// <returns>
        /// A <see cref="System.Drawing.Brush"/> class representing the fill brush
        /// </returns>
        public Brush MakeBrush(RectangleF rect, PointPair dataValue)
        {
            // get a brush
            if (this.IsVisible && (!this._color.IsEmpty || this._brush != null))
            {
                if (rect.Height < 1.0F)
                {
                    rect.Height = 1.0F;
                }

                if (rect.Width < 1.0F)
                {
                    rect.Width = 1.0F;
                }

                // Brush	brush;
                if (this._type == FillType.Brush)
                {
                    return this.ScaleBrush(rect, this._brush, this._isScaled);
                }

                if (this.IsGradientValueType)
                {
                    if (dataValue != null)
                    {
                        if (!this._secondaryValueGradientColor.IsEmpty)
                        {
                            // Go ahead and create a new Fill so we can do all the scaling, etc.,
                            // that is associated with a gradient
                            Fill tmpFill = new Fill(this._secondaryValueGradientColor, this.GetGradientColor(dataValue), this._angle);
                            return tmpFill.MakeBrush(rect);
                        }

                        return new SolidBrush(this.GetGradientColor(dataValue));
                    }

                    if (this._rangeDefault != double.MaxValue)
                    {
                        if (!this._secondaryValueGradientColor.IsEmpty)
                        {
                            // Go ahead and create a new Fill so we can do all the scaling, etc.,
                            // that is associated with a gradient
                            Fill tmpFill = new Fill(this._secondaryValueGradientColor, this.GetGradientColor(this._rangeDefault), this._angle);
                            return tmpFill.MakeBrush(rect);
                        }

                        return new SolidBrush(this.GetGradientColor(this._rangeDefault));
                    }

                    return this.ScaleBrush(rect, this._brush, true);
                }

                return new SolidBrush(this._color);
            }

            // Always return a suitable default
            return new SolidBrush(Color.White);
        }
Example #6
0
        /// <summary>
        /// The init.
        /// </summary>
        /// <param name="family">
        /// The family.
        /// </param>
        /// <param name="size">
        /// The size.
        /// </param>
        /// <param name="color">
        /// The color.
        /// </param>
        /// <param name="isBold">
        /// The is bold.
        /// </param>
        /// <param name="isItalic">
        /// The is italic.
        /// </param>
        /// <param name="isUnderline">
        /// The is underline.
        /// </param>
        /// <param name="fillColor">
        /// The fill color.
        /// </param>
        /// <param name="fillBrush">
        /// The fill brush.
        /// </param>
        /// <param name="fillType">
        /// The fill type.
        /// </param>
        private void Init(
            string family, 
            float size, 
            Color color, 
            bool isBold, 
            bool isItalic, 
            bool isUnderline, 
            Color fillColor, 
            Brush fillBrush, 
            FillType fillType)
        {
            this._fontColor = color;
            this._family = family;
            this._isBold = isBold;
            this._isItalic = isItalic;
            this._isUnderline = isUnderline;
            this._size = size;
            this._angle = 0F;

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

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

            this._scaledSize = -1;
            this.Remake(1.0F, this._size, ref this._scaledSize, ref this._font);
        }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The XAxis object from which to copy
        /// </param>
        public Legend(Legend rhs)
        {
            this._rect = rhs.Rect;
            this._position = rhs.Position;
            this._isHStack = rhs.IsHStack;
            this._isVisible = rhs.IsVisible;

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

            this._fontSpec = rhs.FontSpec.Clone();

            this._gap = rhs._gap;

            this._isReverse = rhs._isReverse;

            this._isShowLegendSymbols = rhs._isShowLegendSymbols;
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Symbol"/> class. 
        /// 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");

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

            if (sch >= 11)
            {
                this._userSymbol = (GraphicsPath)info.GetValue("userSymbol", typeof(GraphicsPath));
            }
            else
            {
                this._userSymbol = null;
            }
        }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Bar"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The Bar object from which to copy
 /// </param>
 public Bar(Bar rhs)
 {
     this._border = rhs.Border.Clone();
     this._fill = rhs.Fill.Clone();
 }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PieItem"/> class. 
        /// 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");

            this._displacement = info.GetDouble("displacement");
            this._labelDetail = (TextObj)info.GetValue("labelDetail", typeof(TextObj));
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
            this._pieValue = info.GetDouble("pieValue");
            this._labelType = (PieLabelType)info.GetValue("labelType", typeof(PieLabelType));
            this._intersectionPoint = (PointF)info.GetValue("intersectionPoint", typeof(PointF));
            this._boundingRectangle = (RectangleF)info.GetValue("boundingRectangle", typeof(RectangleF));
            this._pivotPoint = (PointF)info.GetValue("pivotPoint", typeof(PointF));
            this._endPoint = (PointF)info.GetValue("endPoint", typeof(PointF));

            // _slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) );
            this._startAngle = (float)info.GetDouble("startAngle");
            this._sweepAngle = (float)info.GetDouble("sweepAngle");
            this._midAngle = (float)info.GetDouble("midAngle");
            this._labelStr = info.GetString("labelStr");
            this._valueDecimalDigits = info.GetInt32("valueDecimalDigits");
            this._percentDecimalDigits = info.GetInt32("percentDecimalDigits");
        }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JapaneseCandleStick"/> class. 
        /// 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 JapaneseCandleStick(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");

            this._risingFill = (Fill)info.GetValue("risingFill", typeof(Fill));
            this._fallingFill = (Fill)info.GetValue("fallingFill", typeof(Fill));
            this._risingBorder = (Border)info.GetValue("risingBorder", typeof(Border));
            this._fallingBorder = (Border)info.GetValue("fallingBorder", typeof(Border));

            if (schema2 >= 11)
            {
                this._fallingColor = (Color)info.GetValue("fallingColor", typeof(Color));
            }
        }
Example #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PieItem"/> class. 
 /// 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)
 {
     this._pieValue = pieValue;
     this._fill = new Fill(color.IsEmpty ? _rotator.NextColor : color);
     this._displacement = displacement;
     this._border = new Border(Default.BorderColor, Default.BorderWidth);
     this._labelDetail = new TextObj();
     this._labelDetail.FontSpec.Size = Default.FontSize;
     this._labelType = Default.LabelType;
     this._valueDecimalDigits = Default.ValueDecimalDigits;
     this._percentDecimalDigits = Default.PercentDecimalDigits;
     this._slicePath = null;
 }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PieItem"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The <see cref="PieItem"/> object from which to copy
 /// </param>
 public PieItem(PieItem rhs)
     : base(rhs)
 {
     this._pieValue = rhs._pieValue;
     this._fill = rhs._fill.Clone();
     this.Border = rhs._border.Clone();
     this._displacement = rhs._displacement;
     this._labelDetail = rhs._labelDetail.Clone();
     this._labelType = rhs._labelType;
     this._valueDecimalDigits = rhs._valueDecimalDigits;
     this._percentDecimalDigits = rhs._percentDecimalDigits;
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PieItem"/> class. 
 /// Create a new <see cref="PieItem"/>, providing a gradient fill for the pie color.
 /// </summary>
 /// <param name="pieValue">
 /// The value associated with this <see cref="PieItem"/> instance.
 /// </param>
 /// <param name="color1">
 /// The starting display color for the gradient <see cref="Fill"/> for this
 /// <see cref="PieItem"/> instance.
 /// </param>
 /// <param name="color2">
 /// The ending display color for the gradient <see cref="Fill"/> for this
 /// <see cref="PieItem"/> instance.
 /// </param>
 /// <param name="fillAngle">
 /// The angle for the gradient <see cref="Fill"/>.
 /// </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 color1, Color color2, float fillAngle, double displacement, string label)
     : this(pieValue, color1, displacement, label)
 {
     if (!color1.IsEmpty && !color2.IsEmpty)
     {
         this._fill = new Fill(color1, color2, fillAngle);
     }
 }
Example #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FontSpec"/> class. 
        /// 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");

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

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

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

            this._scaledSize = -1;
            this.Remake(1.0F, this._size, ref this._scaledSize, ref this._font);
        }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FontSpec"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The FontSpec object from which to copy
        /// </param>
        public FontSpec(FontSpec rhs)
        {
            this._fontColor = rhs.FontColor;
            this._family = rhs.Family;
            this._isBold = rhs.IsBold;
            this._isItalic = rhs.IsItalic;
            this._isUnderline = rhs.IsUnderline;
            this._fill = rhs.Fill.Clone();
            this._border = rhs.Border.Clone();
            this._isAntiAlias = rhs._isAntiAlias;

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

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

            this._scaledSize = rhs._scaledSize;
            this.Remake(1.0F, this._size, ref this._scaledSize, ref this._font);
        }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Symbol"/> class. 
 /// 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)
 {
     this._size = Default.Size;
     this._type = type;
     this._isAntiAlias = Default.IsAntiAlias;
     this._isVisible = Default.IsVisible;
     this._border = new Border(Default.IsBorderVisible, color, Default.PenWidth);
     this._fill = new Fill(color, Default.FillBrush, Default.FillType);
     this._userSymbol = null;
 }
Example #18
0
        /// <summary>
        /// Draw the <see cref="JapaneseCandleStick"/> to the specified <see cref="Graphics"/>
        /// device at the specified location.
        /// </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="isXBase">
        /// boolean value that indicates if the "base" axis for this
        /// <see cref="JapaneseCandleStick"/> is the X axis.  True for an <see cref="XAxis"/> base, false for a <see cref="YAxis"/> or <see cref="Y2Axis"/>
        /// base.
        /// </param>
        /// <param name="pixBase">
        /// The independent axis position of the center of the candlestick in pixel units
        /// </param>
        /// <param name="pixHigh">
        /// The high value position of the candlestick in pixel units
        /// </param>
        /// <param name="pixLow">
        /// The low value position of the candlestick in pixel units
        /// </param>
        /// <param name="pixOpen">
        /// The opening value position of the candlestick in pixel units
        /// </param>
        /// <param name="pixClose">
        /// The closing value position of the candlestick in pixel units
        /// </param>
        /// <param name="halfSize">
        /// The scaled width of one-half of a bar, in pixels
        /// </param>
        /// <param name="scaleFactor">
        /// The scaling factor for the features of the graph based on the <see cref="PaneBase.BaseDimension"/>.  This scaling factor is calculated by the
        /// <see cref="PaneBase.CalcScaleFactor"/> method.  The scale factor represents a linear multiple to be applied to font sizes, symbol sizes, etc.
        /// </param>
        /// <param name="pen">
        /// A pen with the <see cref="Color"/> attribute for this
        /// <see cref="JapaneseCandleStick"/>
        /// </param>
        /// <param name="fill">
        /// The <see cref="Fill"/> instance to be used for filling this
        /// <see cref="JapaneseCandleStick"/>
        /// </param>
        /// <param name="border">
        /// The <see cref="Border"/> instance to be used for drawing the border around the <see cref="JapaneseCandleStick"/> filled box
        /// </param>
        /// <param name="pt">
        /// The <see cref="PointPair"/> to be used for determining the
        /// <see cref="Fill"/>, just in case it's a <see cref="FillType.GradientByX"/>,
        /// <see cref="FillType.GradientByY"/>, or
        /// <see cref="FillType.GradientByZ"/> <see cref="FillType"/>
        /// </param>
        public void Draw(
            Graphics g, 
            GraphPane pane, 
            bool isXBase, 
            float pixBase, 
            float pixHigh, 
            float pixLow, 
            float pixOpen, 
            float pixClose, 
            float halfSize, 
            float scaleFactor, 
            Pen pen, 
            Fill fill, 
            Border border, 
            PointPair pt)
        {
            // float halfSize = (int) ( _size * scaleFactor / 2.0f + 0.5f );
            if (pixBase != PointPairBase.Missing && Math.Abs(pixLow) < 1000000 && Math.Abs(pixHigh) < 1000000)
            {
                RectangleF rect;
                if (isXBase)
                {
                    rect = new RectangleF(pixBase - halfSize, Math.Min(pixOpen, pixClose), halfSize * 2.0f, Math.Abs(pixOpen - pixClose));

                    g.DrawLine(pen, pixBase, pixHigh, pixBase, pixLow);
                }
                else
                {
                    rect = new RectangleF(Math.Min(pixOpen, pixClose), pixBase - halfSize, Math.Abs(pixOpen - pixClose), halfSize * 2.0f);

                    g.DrawLine(pen, pixHigh, pixBase, pixLow, pixBase);
                }

                if (this._isOpenCloseVisible && Math.Abs(pixOpen) < 1000000 && Math.Abs(pixClose) < 1000000)
                {
                    if (rect.Width == 0)
                    {
                        rect.Width = 1;
                    }

                    if (rect.Height == 0)
                    {
                        rect.Height = 1;
                    }

                    fill.Draw(g, rect, pt);
                    border.Draw(g, pane, scaleFactor, rect);
                }
            }
        }
Example #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Symbol"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The Symbol object from which to copy
        /// </param>
        public Symbol(Symbol rhs)
        {
            this._size = rhs.Size;
            this._type = rhs.Type;
            this._isAntiAlias = rhs._isAntiAlias;
            this._isVisible = rhs.IsVisible;
            this._fill = rhs.Fill.Clone();
            this._border = rhs.Border.Clone();

            if (rhs.UserSymbol != null)
            {
                this._userSymbol = rhs.UserSymbol.Clone() as GraphicsPath;
            }
            else
            {
                this._userSymbol = null;
            }
        }
Example #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Line"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The Line object from which to copy
 /// </param>
 public Line(Line rhs)
     : base(rhs)
 {
     this._color = rhs._color;
     this._stepType = rhs._stepType;
     this._isSmooth = rhs._isSmooth;
     this._smoothTension = rhs._smoothTension;
     this._fill = rhs._fill.Clone();
     this._isOptimizedDraw = rhs._isOptimizedDraw;
 }
Example #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Bar"/> class. 
 /// 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="Graph.Fill.Color"/>, and the <see cref="LineBase.Color"/>
 /// will be defaulted.
 /// </summary>
 /// <param name="color">
 /// A <see cref="Color"/> value indicating the <see cref="Graph.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);
 }
Example #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Line"/> class. 
 /// Constructor that sets the color property to the specified value, and sets the remaining <see cref="Line"/> properties to default values as defined
 /// in the <see cref="Default"/> class.
 /// </summary>
 /// <param name="color">
 /// The color to assign to this new Line object
 /// </param>
 public Line(Color color)
 {
     this._color = color.IsEmpty ? Default.Color : color;
     this._stepType = Default.StepType;
     this._isSmooth = Default.IsSmooth;
     this._smoothTension = Default.SmoothTension;
     this._fill = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);
     this._isOptimizedDraw = Default.IsOptimizedDraw;
 }
Example #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Bar"/> class. 
        /// 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 Bar(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");

            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
        }
Example #24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// 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");

            this._rect = (RectangleF)info.GetValue("rect", typeof(RectangleF));
            this._legend = (Legend)info.GetValue("legend", typeof(Legend));
            this._title = (GapLabel)info.GetValue("title", typeof(GapLabel));

            // this.isShowTitle = info.GetBoolean( "isShowTitle" );
            this._isFontsScaled = info.GetBoolean("isFontsScaled");
            this._isPenWidthScaled = info.GetBoolean("isPenWidthScaled");

            // this.fontSpec = (FontSpec) info.GetValue( "fontSpec" , typeof(FontSpec) );
            this._titleGap = info.GetSingle("titleGap");
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
            this._baseDimension = info.GetSingle("baseDimension");
            this._margin = (Margin)info.GetValue("margin", typeof(Margin));
            this._graphObjList = (GraphObjList)info.GetValue("graphObjList", typeof(GraphObjList));

            this._tag = info.GetValue("tag", typeof(object));
        }
Example #25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Line"/> class. 
        /// 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 Line(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("schema");

            // if ( sch >= 14 )
            // 	_color = (Color) info.GetValue( "color", typeof( Color ) );
            this._stepType = (StepType)info.GetValue("stepType", typeof(StepType));
            this._isSmooth = info.GetBoolean("isSmooth");
            this._smoothTension = info.GetSingle("smoothTension");
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));

            if (sch >= 13)
            {
                this._isOptimizedDraw = info.GetBoolean("isOptimizedDraw");
            }
        }
Example #26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JapaneseCandleStick"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The <see cref="JapaneseCandleStick"/> object from which to copy
        /// </param>
        public JapaneseCandleStick(JapaneseCandleStick rhs)
            : base(rhs)
        {
            this._risingFill = rhs._risingFill.Clone();
            this._fallingFill = rhs._fallingFill.Clone();

            this._risingBorder = rhs._risingBorder.Clone();
            this._fallingBorder = rhs._fallingBorder.Clone();

            this._fallingColor = rhs._fallingColor;
        }
Example #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. 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);

            this._gap = Default.Gap;

            this._isReverse = Default.IsReverse;

            this._isShowLegendSymbols = Default.IsShowLegendSymbols;
        }
Example #28
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GasGaugeRegion"/> class. 
        /// 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");

            this._labelDetail = (TextObj)info.GetValue("labelDetail", typeof(TextObj));
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
            this._color = (Color)info.GetValue("color", typeof(Color));
            this._minValue = info.GetDouble("minValue");
            this._maxValue = info.GetDouble("maxValue");
            this._startAngle = (float)info.GetDouble("startAngle");
            this._sweepAngle = (float)info.GetDouble("sweepAngle");
            this._boundingRectangle = (RectangleF)info.GetValue("boundingRectangle", typeof(RectangleF));
            this._slicePath = (GraphicsPath)info.GetValue("slicePath", typeof(GraphicsPath));
        }
Example #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. 
        /// 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");

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

            this._gap = info.GetSingle("gap");

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

            if (schema >= 12)
            {
                this._isShowLegendSymbols = info.GetBoolean("isShowLegendSymbols");
            }
        }
Example #30
0
        /// <summary>
        /// Calculate the values needed to properly display this <see cref="GasGaugeRegion"/>.
        /// </summary>
        /// <param name="pane">
        /// A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method.
        /// </param>
        public static void CalculateGasGuageParameters(GraphPane pane)
        {
            // loop thru slices and get total value and maxDisplacement
            double minVal = double.MaxValue;
            double maxVal = double.MinValue;
            foreach (CurveItem curve in pane.CurveList)
            {
                if (curve is GasGaugeRegion)
                {
                    GasGaugeRegion ggr = (GasGaugeRegion)curve;
                    if (maxVal < ggr.MaxValue)
                    {
                        maxVal = ggr.MaxValue;
                    }

                    if (minVal > ggr.MinValue)
                    {
                        minVal = ggr.MinValue;
                    }
                }
            }

            // Calculate start and sweep angles for each of the GasGaugeRegion based on teh min and max value
            foreach (CurveItem curve in pane.CurveList)
            {
                if (curve is GasGaugeRegion)
                {
                    GasGaugeRegion ggr = (GasGaugeRegion)curve;
                    float start = ((float)ggr.MinValue - (float)minVal) / ((float)maxVal - (float)minVal) * 180.0f;
                    float sweep = ((float)ggr.MaxValue - (float)minVal) / ((float)maxVal - (float)minVal) * 180.0f;
                    sweep = sweep - start;

                    Fill f = new Fill(Color.White, ggr.RegionColor, -(sweep / 2f));
                    ggr.Fill = f;

                    ggr.StartAngle = start;
                    ggr.SweepAngle = sweep;
                }
            }
        }