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="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 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Border"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The Border object from which to copy
 /// </param>
 public Border(Border rhs)
     : base(rhs)
 {
     this._inflateFactor = rhs._inflateFactor;
 }
Example #5
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 #6
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 #7
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 #8
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 #9
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 #10
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 #11
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 #12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaneBase"/> class. 
        /// 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>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="paneRect">
        /// The pane Rect.
        /// </param>
        public PaneBase(string title, RectangleF paneRect)
        {
            this._rect = paneRect;

            this._legend = new Legend();

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

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

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

            this._graphObjList = new GraphObjList();

            this._tag = null;
        }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GasGaugeNeedle"/> class. 
 /// Create a new <see cref="GasGaugeNeedle"/>
 /// </summary>
 /// <param name="label">
 /// The value associated with this <see cref="GasGaugeNeedle"/>
 /// instance.
 /// </param>
 /// <param name="val">
 /// The value of this <see cref="GasGaugeNeedle"/>.
 /// </param>
 /// <param name="color">
 /// The display color for this <see cref="GasGaugeNeedle"/>
 /// instance.
 /// </param>
 public GasGaugeNeedle(string label, double val, Color color)
     : base(label)
 {
     this.NeedleValue = val;
     this.NeedleColor = color;
     this.NeedleWidth = Default.NeedleWidth;
     this.SweepAngle = 0f;
     this._border = new Border(Default.BorderColor, Default.BorderWidth);
     this._labelDetail = new TextObj();
     this._labelDetail.FontSpec.Size = Default.FontSize;
     this._slicePath = null;
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GasGaugeNeedle"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="ggn">
 /// The <see cref="GasGaugeNeedle"/> object from which to copy
 /// </param>
 public GasGaugeNeedle(GasGaugeNeedle ggn)
     : base(ggn)
 {
     this.NeedleValue = ggn.NeedleValue;
     this.NeedleColor = ggn.NeedleColor;
     this.NeedleWidth = ggn.NeedleWidth;
     this.SweepAngle = ggn.SweepAngle;
     this._border = ggn.Border.Clone();
     this._labelDetail = ggn.LabelDetail.Clone();
     this._labelDetail.FontSpec.Size = ggn.LabelDetail.FontSpec.Size;
 }
Example #15
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 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GasGaugeRegion"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="ggr">
 /// The <see cref="GasGaugeRegion"/> object from which to copy
 /// </param>
 public GasGaugeRegion(GasGaugeRegion ggr)
     : base(ggr)
 {
     this._minValue = ggr._minValue;
     this._maxValue = ggr._maxValue;
     this._color = ggr._color;
     this._startAngle = ggr._startAngle;
     this._sweepAngle = ggr._sweepAngle;
     this._border = ggr._border.Clone();
     this._labelDetail = ggr._labelDetail.Clone();
 }
Example #17
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 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GasGaugeRegion"/> class. 
 /// Create a new <see cref="GasGaugeRegion"/>
 /// </summary>
 /// <param name="label">
 /// The value associated with 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>
 /// <param name="color">
 /// The display color for this <see cref="GasGaugeRegion"/> instance.
 /// </param>
 public GasGaugeRegion(string label, double minVal, double maxVal, Color color)
     : base(label)
 {
     this.MinValue = minVal;
     this.MaxValue = maxVal;
     this.RegionColor = color;
     this.StartAngle = 0f;
     this.SweepAngle = 0f;
     this._border = new Border(Default.BorderColor, Default.BorderWidth);
     this._labelDetail = new TextObj();
     this._labelDetail.FontSpec.Size = Default.FontSize;
     this._slicePath = null;
 }
Example #19
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 #20
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 #21
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 #22
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 #23
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 #24
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 #25
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 #26
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 #27
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 #28
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 #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class. Default constructor.
 /// </summary>
 public Chart()
 {
     this._isRectAuto = true;
     this._border = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth);
     this._fill = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);
 }