Example #1
0
		/// <summary> 
		/// Indexer to access the specified <see c_ref="PointPair"/> object by 
		/// its ordinal position in the list. 
		/// </summary> 
		/// <param name="index">The ordinal position (zero-based) of the 
		/// <see c_ref="PointPair"/> object to be accessed.</param> 
		/// <value>A <see c_ref="PointPair"/> object reference.</value> 
		public PointPair this[int index]
		{
			get
			{
				if ( index < 0 || index >= _bindingSource.Count )
					throw new ArgumentOutOfRangeException( "Error: Index out of range" );

				object row = _bindingSource[index];

				double x = GetDouble( row, _xDataMember, index );
				double y = GetDouble( row, _yDataMember, index );
				double z = GetDouble( row, _zDataMember, index );
				object tag = GetObject( row, _tagDataMember );

				PointPair pt = new PointPair( x, y, z );
				pt.Tag = tag;
				return pt;
			}
		}
Example #2
0
		/// <summary>
		/// Add a set of values onto the head of the queue,
		/// overwriting old values if the buffer is full.
		/// </summary>
		/// <remarks>
		/// This method is much more efficient that the <see c_ref="Add(PointPair)">Add(PointPair)</see>
		/// method, since it does not require that a new PointPair instance be provided.
		/// If the buffer already contains a <see c_ref="PointPair"/> at the head position,
		/// then the x, y, z, and tag values will be copied into the existing PointPair.
		/// Otherwise, a new PointPair instance must be created.
		/// In this way, each PointPair position in the rolling list will only be allocated one time.
		/// To truly be memory efficient, the <see c_ref="Remove" />, <see c_ref="RemoveAt" />,
		/// and <see c_ref="Pop" /> methods should be avoided.  Also, the <paramref name="tag"/> property
		/// for this method should be null, since it is a reference type.
		/// </remarks>
		/// <param name="x">The X value</param>
		/// <param name="y">The Y value</param>
		/// <param name="z">The Z value</param>
		/// <param name="tag">The Tag value for the PointPair</param>
		public void Add( double x, double y, double z, object tag )
		{
			// advance the rolling list
			GetNextIndex();

			if ( _mBuffer[_headIdx] == null )
				_mBuffer[_headIdx] = new PointPair( x, y, z, tag );
			else
			{
				_mBuffer[_headIdx].X = x;
				_mBuffer[_headIdx].Y = y;
				_mBuffer[_headIdx].Z = z;
				_mBuffer[_headIdx].Tag = tag;
			}
		}
Example #3
0
		/// <summary>
		/// Add a <see c_ref="PointPair"/> onto the head of the queue,
		/// overwriting old values if the buffer is full.
		/// </summary>
		/// <param name="item">The <see c_ref="PointPair" /> to be added.</param>
		public void Add( PointPair item )
		{
			_mBuffer[ GetNextIndex() ] = item;
		}
Example #4
0
		/// <summary>
		/// Draw the <see c_ref="Symbol"/> to the specified <see c_ref="Graphics"/> device
		/// at the specified location.  This routine draws a single symbol.
		/// </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 c_ref="ZedGraph.GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="x">The x position of the center of the symbol in
        /// pixel units</param>
		/// <param name="y">The y position of the center of the symbol in
		/// pixel units</param>
		/// <param name="scaleFactor">
		/// The scaling factor for the features of the graph based on the <see c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="PaneBase.CalcScaleFactor"/> method.  The scale factor
		/// represents a linear multiple to be applied to font sizes, symbol sizes, etc.
		/// </param>
		/// <param name="dataValue">The data value to be used for a value-based
		/// color gradient.  This is only applicable for <see c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/> or <see c_ref="FillType.GradientByZ"/>.</param>
		/// <param name="isSelected">Indicates that the <see c_ref="Symbol" /> should be drawn
		/// with attributes from the <see c_ref="Selection" /> class.
		/// </param>
		public void DrawSymbol( Graphics g, GraphPane pane, int x, int y,
							float scaleFactor, bool isSelected, PointPair dataValue )
		{
			Symbol source = this;
			if ( isSelected )
				source = Selection.Symbol;

			// Only draw if the symbol is visible
			if (	_isVisible &&
					Type != SymbolType.None &&
					x < 100000 && x > -100000 &&
					y < 100000 && y > -100000 )
			{
				SmoothingMode sModeSave = g.SmoothingMode;
				if ( _isAntiAlias )
					g.SmoothingMode = SmoothingMode.HighQuality;

				using ( Pen pen = _border.GetPen( pane, scaleFactor, dataValue ) )
				using ( GraphicsPath path = MakePath( g, scaleFactor ) )
				using ( Brush brush = Fill.MakeBrush( path.GetBounds(), dataValue ) )
				{
					DrawSymbol( g, x, y, path, pen, brush );
				}

				g.SmoothingMode = sModeSave;
			}
		}
Example #5
0
File: Bar.cs Project: CareyGit/jx
		/// <summary>
		/// Draw the <see c_ref="Bar"/> to the specified <see c_ref="Graphics"/> device
		/// at the specified location.  This routine draws a single bar.
		/// </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 c_ref="ZedGraph.GraphPane"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="left">The x position of the left side of the bar in
		/// pixel units</param>
		/// <param name="right">The x position of the right side of the bar in
		/// pixel units</param>
		/// <param name="top">The y position of the top of the bar in
		/// pixel units</param>
		/// <param name="bottom">The y position of the bottom of the bar in
		/// pixel units</param>
		/// <param name="scaleFactor">
		/// The scaling factor for the features of the graph based on the <see c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="PaneBase.CalcScaleFactor"/> method.  The scale factor
		/// represents a linear multiple to be applied to font sizes, symbol sizes, etc.
		/// </param>
		/// <param name="fullFrame">true to draw the bottom portion of the border around the
		/// bar (this is for legend entries)</param> 
		/// <param name="dataValue">The data value to be used for a value-based
		/// color gradient.  This is only applicable for <see c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/> or <see c_ref="FillType.GradientByZ"/>.</param>
		/// <param name="isSelected">Indicates that the <see c_ref="Bar" /> should be drawn
		/// with attributes from the <see c_ref="Selection" /> class.
		/// </param>
		public void Draw( Graphics g, GraphPane pane, float left, float right, float top,
							float bottom, float scaleFactor, bool fullFrame, bool isSelected,
							PointPair dataValue )
		{
			// Do a sanity check to make sure the top < bottom.  If not, reverse them
			if ( top > bottom )
			{
				float junk = top;
				top = bottom;
				bottom = junk;
			}

			// Do a sanity check to make sure the left < right.  If not, reverse them
			if ( left > right )
			{
				float junk = right;
				right = left;
				left = junk;
			}

			if ( top < -10000 )
				top = -10000;
			else if ( top > 10000 )
				top = 10000;
			if ( left < -10000 )
				left = -10000;
			else if ( left > 10000 )
				left = 10000;
			if ( right < -10000 )
				right = -10000;
			else if ( right > 10000 )
				right = 10000;
			if ( bottom < -10000 )
				bottom = -10000;
			else if ( bottom > 10000 )
				bottom = 10000;

			// Make a rectangle for the bar and draw it
			RectangleF rect = new RectangleF( left, top, right - left, bottom - top );

			Draw( g, pane, rect, scaleFactor, fullFrame, isSelected, dataValue );      
		}
Example #6
0
File: Line.cs Project: CareyGit/jx
		/// <summary>
		/// This method just handles the case where one or more of the coordinates are outrageous,
		/// or GDI+ threw an exception.  This method attempts to correct the outrageous coordinates by
		/// interpolating them to a point (along the original line) that lies at the edge of the ChartRect
		/// so that GDI+ will handle it properly.  GDI+ will throw an exception, or just plot the data
		/// incorrectly if the coordinates are too large (empirically, this appears to be when the
		/// coordinate value is greater than 5,000,000 or less than -5,000,000).  Although you typically
		/// would not see coordinates like this, if you repeatedly zoom in on a ZedGraphControl, eventually
		/// all your points will be way outside the bounds of the plot.
		/// </summary>
		private void InterpolatePoint( Graphics g, GraphPane pane, CurveItem curve, PointPair lastPt,
						float scaleFactor, Pen pen, float lastX, float lastY, float tmpX, float tmpY )
		{
			try
			{
				RectangleF chartRect = pane.Chart._rect;
				// try to interpolate values
				bool lastIn = chartRect.Contains( lastX, lastY );
				bool curIn = chartRect.Contains( tmpX, tmpY );

				// If both points are outside the ChartRect, make a new point that is on the LastX/Y
				// side of the ChartRect, and fall through to the code that handles lastIn == true
				if ( !lastIn )
				{
					float newX, newY;

					if ( Math.Abs( lastX ) > Math.Abs( lastY ) )
					{
						newX = lastX < 0 ? chartRect.Left : chartRect.Right;
						newY = lastY + ( tmpY - lastY ) * ( newX - lastX ) / ( tmpX - lastX );
					}
					else
					{
						newY = lastY < 0 ? chartRect.Top : chartRect.Bottom;
						newX = lastX + ( tmpX - lastX ) * ( newY - lastY ) / ( tmpY - lastY );
					}

					lastX = newX;
					lastY = newY;
				}

				if ( !curIn )
				{
					float newX, newY;

					if ( Math.Abs( tmpX ) > Math.Abs( tmpY ) )
					{
						newX = tmpX < 0 ? chartRect.Left : chartRect.Right;
						newY = tmpY + ( lastY - tmpY ) * ( newX - tmpX ) / ( lastX - tmpX );
					}
					else
					{
						newY = tmpY < 0 ? chartRect.Top : chartRect.Bottom;
						newX = tmpX + ( lastX - tmpX ) * ( newY - tmpY ) / ( lastY - tmpY );
					}

					tmpX = newX;
					tmpY = newY;
				}

				/*
				if ( this.StepType == StepType.ForwardStep )
				{
					g.DrawLine( pen, lastX, lastY, tmpX, lastY );
					g.DrawLine( pen, tmpX, lastY, tmpX, tmpY );
				}
				else if ( this.StepType == StepType.RearwardStep )
				{
					g.DrawLine( pen, lastX, lastY, lastX, tmpY );
					g.DrawLine( pen, lastX, tmpY, tmpX, tmpY );
				}
				else 		// non-step
					g.DrawLine( pen, lastX, lastY, tmpX, tmpY );
				*/
				if ( !curve.IsSelected && _gradientFill.IsGradientValueType )
				{
					using ( Pen tPen = GetPen( pane, scaleFactor, lastPt ) )
					{
						if ( StepType == StepType.NonStep )
						{
							g.DrawLine( tPen, lastX, lastY, tmpX, tmpY );
						}
						else if ( StepType == StepType.ForwardStep )
						{
							g.DrawLine( tPen, lastX, lastY, tmpX, lastY );
							g.DrawLine( tPen, tmpX, lastY, tmpX, tmpY );
						}
						else if ( StepType == StepType.RearwardStep )
						{
							g.DrawLine( tPen, lastX, lastY, lastX, tmpY );
							g.DrawLine( tPen, lastX, tmpY, tmpX, tmpY );
						}
						else if ( StepType == StepType.ForwardSegment )
						{
							g.DrawLine( tPen, lastX, lastY, tmpX, lastY );
						}
						else
						{
							g.DrawLine( tPen, lastX, tmpY, tmpX, tmpY );
						}
					}
				}
				else
				{
					if ( StepType == StepType.NonStep )
					{
						g.DrawLine( pen, lastX, lastY, tmpX, tmpY );
					}
					else if ( StepType == StepType.ForwardStep )
					{
						g.DrawLine( pen, lastX, lastY, tmpX, lastY );
						g.DrawLine( pen, tmpX, lastY, tmpX, tmpY );
					}
					else if ( StepType == StepType.RearwardStep )
					{
						g.DrawLine( pen, lastX, lastY, lastX, tmpY );
						g.DrawLine( pen, lastX, tmpY, tmpX, tmpY );
					}
					else if ( StepType == StepType.ForwardSegment )
					{
						g.DrawLine( pen, lastX, lastY, tmpX, lastY );
					}
					else if ( StepType == StepType.RearwardSegment )
					{
						g.DrawLine( pen, lastX, tmpY, tmpX, tmpY );
					}
				}

			}

			catch { }
		}
Example #7
0
		/// <summary>
		/// Draw the <see c_ref="JapaneseCandleStick"/> to the specified <see c_ref="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 c_ref="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 c_ref="JapaneseCandleStick"/> is the X axis.  True for an <see c_ref="XAxis"/> base,
		/// false for a <see c_ref="YAxis"/> or <see c_ref="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 c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="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 c_ref="Color"/> attribute for this
		/// <see c_ref="JapaneseCandleStick"/></param>
		/// <param name="fill">
		/// The <see c_ref="Fill" /> instance to be used for filling this
		/// <see c_ref="JapaneseCandleStick" />
		/// </param>
		/// <param name="border">The <see c_ref="Border" /> instance to be used for drawing the
		/// border around the <see c_ref="JapaneseCandleStick" /> filled box</param>
		/// <param name="pt">The <see c_ref="PointPair" /> to be used for determining the
		/// <see c_ref="Fill" />, just in case it's a <see c_ref="FillType.GradientByX" />,
		/// <see c_ref="FillType.GradientByY" />, or
		/// <see c_ref="FillType.GradientByZ" /> <see c_ref="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 != PointPair.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 ( _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 #8
0
		/// <summary>
		/// The StockPt copy constructor.
		/// </summary>
		/// <param name="rhs">The basis for the copy.</param>
		public StockPt( PointPair rhs )
			: base( rhs )
		{
			if ( rhs is StockPt )
			{
				StockPt pt = rhs as StockPt;
				Open = pt.Open;
				Close = pt.Close;
				Vol = pt.Vol;
				ColorValue = rhs.ColorValue;
			}
			else
			{
				Open = Missing;
				Close = Missing;
				Vol = Missing;
				ColorValue = Missing;
			}
		}
Example #9
0
        /// <summary>
        /// Compare two <see c_ref="PointPair"/> objects for equality.  To be equal, X, Y, and Z
        /// must be exactly the same between the two objects.
        /// </summary>
        /// <param name="obj">The <see c_ref="PointPair"/> object to be compared with.</param>
        /// <returns>true if the <see c_ref="PointPair"/> objects are equal, false otherwise</returns>
        public override bool Equals(object obj)
        {
            PointPair rhs = obj as PointPair;

            return(X == rhs.X && Y == rhs.Y && Z == rhs.Z);
        }
Example #10
0
		/// <summary>
		/// Create a <see c_ref="Pen" /> object based on the properties of this
		/// <see c_ref="LineBase" />.
		/// </summary>
		/// <param name="pane">The owner <see c_ref="GraphPane" /> of this
		/// <see c_ref="LineBase" />.
		/// </param>
		/// <param name="scaleFactor">
		/// The scaling factor to be used for rendering objects.  This is calculated and
		/// passed down by the parent <see c_ref="GraphPane"/> object using the
		/// <see c_ref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
		/// font sizes, etc. according to the actual size of the graph.
		/// </param>
		/// <param name="dataValue">The data value to be used for a value-based
		/// color gradient.  This is only applicable if <see c_ref="Fill.Type">GradientFill.Type</see>
		/// is one of <see c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/>, <see c_ref="FillType.GradientByZ"/>,
		/// or <see c_ref="FillType.GradientByColorValue" />.
		/// </param>
		/// <returns>A <see c_ref="Pen" /> object with the properties of this <see c_ref="LineBase" />
		/// </returns>
		public Pen GetPen( PaneBase pane, float scaleFactor, PointPair dataValue )
		{
			Color color = _color;
			if ( _gradientFill.IsGradientValueType )
				color = _gradientFill.GetGradientColor( dataValue );

			Pen pen = new Pen( color,
						pane.ScaledPenWidth( _width, scaleFactor ) );

			pen.DashStyle = _style;

			if ( _style == DashStyle.Custom )
			{
				if ( _dashOff > 1e-10 && _dashOn > 1e-10 )
				{
					pen.DashStyle = DashStyle.Custom;
					float[] pattern = new float[2];
					pattern[0] = _dashOn;
					pattern[1] = _dashOff;
					pen.DashPattern = pattern;
				}
				else
					pen.DashStyle = DashStyle.Solid;
			}

			return pen;
		}
Example #11
0
        /// <summary>
        /// Draw all the <see c_ref="JapaneseCandleStick"/>'s to the specified <see c_ref="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 c_ref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="curve">A <see c_ref="JapaneseCandleStickItem"/> object representing the
        /// <see c_ref="JapaneseCandleStick"/>'s to be drawn.</param>
        /// <param name="baseAxis">The <see c_ref="Axis"/> class instance that defines the base (independent)
        /// axis for the <see c_ref="JapaneseCandleStick"/></param>
        /// <param name="valueAxis">The <see c_ref="Axis"/> class instance that defines the value (dependent)
        /// axis for the <see c_ref="JapaneseCandleStick"/></param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see c_ref="GraphPane"/> object using the
        /// <see c_ref="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 && _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);
                                }
                            }
                        }
                    }
            }
        }
Example #12
0
File: Fill.cs Project: CareyGit/jx
		internal Color GetGradientColor( PointPair dataValue )
		{
			double val;

			if ( dataValue == null )
				val = _rangeDefault;
			else if ( _type == FillType.GradientByColorValue )
				val = dataValue.ColorValue;
			else if ( _type == FillType.GradientByZ )
				val = dataValue.Z;
			else if ( _type == FillType.GradientByY )
				val = dataValue.Y;
			else
				val = dataValue.X;

			return GetGradientColor( val );
		}
Example #13
0
File: Fill.cs Project: CareyGit/jx
		/// <summary>
		/// Create a fill brush using current properties.  This method will construct a brush based on the
		/// settings of <see c_ref="ZedGraph.Fill.Type"/>, <see c_ref="ZedGraph.Fill.Color"/>
		/// and <see c_ref="ZedGraph.Fill.Brush"/>.  If
		/// <see c_ref="ZedGraph.Fill.Type"/> is set to <see c_ref="ZedGraph.FillType.Brush"/> and
		/// <see c_ref="ZedGraph.Fill.Brush"/>
		/// is null, then a <see c_ref="LinearGradientBrush"/> will be created between the colors of
		/// <see c_ref="System.Drawing.Color.White"/> and <see c_ref="ZedGraph.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 c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/> or <see c_ref="FillType.GradientByZ"/>.</param>
		/// <returns>A <see c_ref="System.Drawing.Brush"/> class representing the fill brush</returns>
		public Brush MakeBrush( RectangleF rect, PointPair dataValue )
		{
			// get a brush
			if ( IsVisible && ( !_color.IsEmpty || _brush != null ) )
			{
				if ( rect.Height < 1.0F )
					rect.Height = 1.0F;
				if ( rect.Width < 1.0F )
					rect.Width = 1.0F;
					
				//Brush	brush;
				if ( _type == FillType.Brush )
				{
					return ScaleBrush( rect, _brush, _isScaled );
				}
			    if ( IsGradientValueType )
			    {
			        if ( dataValue != null )
			        {
			            if ( !_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( _secondaryValueGradientColor,
			                    GetGradientColor( dataValue ), _angle );
			                return tmpFill.MakeBrush( rect );
			            }
			            return new SolidBrush( GetGradientColor( dataValue ) );
			        }
			        if ( _rangeDefault != double.MaxValue )
			        {
			            if ( !_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( _secondaryValueGradientColor,
			                    GetGradientColor( _rangeDefault ), _angle );
			                return tmpFill.MakeBrush( rect );
			            }
			            return new SolidBrush( GetGradientColor( _rangeDefault ) );
			        }
			        return ScaleBrush( rect, _brush, true );
			    }
			    return new SolidBrush( _color );
			}

			// Always return a suitable default
			return new SolidBrush( Color.White );
		}
Example #14
0
File: Fill.cs Project: CareyGit/jx
		/// <summary>
		/// Fill the background of the <see c_ref="RectangleF"/> area, using the
		/// fill type from this <see c_ref="Fill"/>.
		/// </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="rect">The <see c_ref="RectangleF"/> struct specifying the area
		/// to be filled</param>
		/// <param name="pt">The data value to be used in case it's a
		/// <see c_ref="FillType.GradientByX" />, <see c_ref="FillType.GradientByY" />, or
		/// <see c_ref="FillType.GradientByZ" /> <see c_ref="FillType" />.</param>
		public void Draw( Graphics g, RectangleF rect, PointPair pt )
		{
			if ( IsVisible )
			{
				using ( Brush brush = MakeBrush( rect, pt ) )
				{
					g.FillRectangle( brush, rect );
				}
			}
		}
Example #15
0
		/// <summary>
		/// Add a set of points to the <see c_ref="RollingPointPairList"/> from
		/// three arrays of type double.
		/// If the X or Y array is null, then a set of ordinal values is automatically
		/// generated in its place (see <see c_ref="AxisType.Ordinal"/>.
		/// If the <see paramref="z"/> value
		/// is null, then it is set to zero.
		/// If the arrays are of different size, then the larger array prevails and the
		/// smaller array is padded with <see c_ref="PointPairBase.Missing"/> values.
		/// </summary>
		/// <param name="x">A double[] array of X values</param>
		/// <param name="y">A double[] array of Y values</param>
		/// <param name="z">A double[] array of Z values</param>
		public void Add( double[] x, double[] y, double[] z )
		{
			int len = 0;

			if ( x != null )
				len = x.Length;
			if ( y != null && y.Length > len )
				len = y.Length;
			if ( z != null && z.Length > len )
				len = z.Length;

			for ( int i = 0; i < len; i++ )
			{
				PointPair point = new PointPair();

				if ( x == null )
					point.X = i + 1.0;
				else if ( i < x.Length )
					point.X = x[i];
				else
					point.X = PointPair.Missing;

				if ( y == null )
					point.Y = i + 1.0;
				else if ( i < y.Length )
					point.Y = y[i];
				else
					point.Y = PointPair.Missing;

				if ( z == null )
					point.Z = i + 1.0;
				else if ( i < z.Length )
					point.Z = z[i];
				else
					point.Z = PointPair.Missing;

				Add( point );
			}
		}
Example #16
0
 /// <summary>
 /// Add a <see c_ref="PointPair"/> onto the head of the queue,
 /// overwriting old values if the buffer is full.
 /// </summary>
 /// <param name="item">The <see c_ref="PointPair" /> to be added.</param>
 public void Add(PointPair item)
 {
     _mBuffer[GetNextIndex()] = item;
 }
Example #17
0
		/// <summary>
		/// Constructs an empty buffer with the specified capacity.  Pre-allocates space
		/// for all PointPair's in the list if <paramref name="preLoad"/> is true.
		/// </summary>
		/// <param name="capacity">Number of elements in the rolling list.  This number
		/// cannot be changed once the RollingPointPairList is constructed.</param>
		/// <param name="preLoad">true to pre-allocate all PointPair instances in
		/// the list, false otherwise.  Note that in order to be memory efficient,
		/// the <see c_ref="Add(double,double,double)"/> method should be used to add
		/// data.  Avoid the <see c_ref="Add(PointPair)"/> method.
		/// </param>
		/// <seealso c_ref="Add(double,double,double)"/>
		public RollingPointPairList( int capacity, bool preLoad )
		{
			_mBuffer = new PointPair[capacity];
			_headIdx = _tailIdx = -1;

			if ( preLoad )
				for ( int i = 0; i < capacity; i++ )
					_mBuffer[i] = new PointPair();
		}
Example #18
0
        /// <summary>
        /// Add a set of points to the <see c_ref="RollingPointPairList"/> from
        /// three arrays of type double.
        /// If the X or Y array is null, then a set of ordinal values is automatically
        /// generated in its place (see <see c_ref="AxisType.Ordinal"/>.
        /// If the <see paramref="z"/> value
        /// is null, then it is set to zero.
        /// If the arrays are of different size, then the larger array prevails and the
        /// smaller array is padded with <see c_ref="PointPairBase.Missing"/> values.
        /// </summary>
        /// <param name="x">A double[] array of X values</param>
        /// <param name="y">A double[] array of Y values</param>
        /// <param name="z">A double[] array of Z values</param>
        public void Add(double[] x, double[] y, double[] z)
        {
            int len = 0;

            if (x != null)
            {
                len = x.Length;
            }
            if (y != null && y.Length > len)
            {
                len = y.Length;
            }
            if (z != null && z.Length > len)
            {
                len = z.Length;
            }

            for (int i = 0; i < len; i++)
            {
                PointPair point = new PointPair();

                if (x == null)
                {
                    point.X = i + 1.0;
                }
                else if (i < x.Length)
                {
                    point.X = x[i];
                }
                else
                {
                    point.X = PointPair.Missing;
                }

                if (y == null)
                {
                    point.Y = i + 1.0;
                }
                else if (i < y.Length)
                {
                    point.Y = y[i];
                }
                else
                {
                    point.Y = PointPair.Missing;
                }

                if (z == null)
                {
                    point.Z = i + 1.0;
                }
                else if (i < z.Length)
                {
                    point.Z = z[i];
                }
                else
                {
                    point.Z = PointPair.Missing;
                }

                Add(point);
            }
        }
Example #19
0
		private void HandleEditDrag( Point mousePt )
		{
			// get the scale values that correspond to the current point
			double curX, curY;
			_dragPane.ReverseTransform( mousePt, _dragCurve.IsX2Axis, _dragCurve.IsY2Axis,
					_dragCurve.YAxisIndex, out curX, out curY );
			double startX, startY;
			_dragPane.ReverseTransform( _dragStartPt, _dragCurve.IsX2Axis, _dragCurve.IsY2Axis,
					_dragCurve.YAxisIndex, out startX, out startY );

			// calculate the new scale values for the point
			PointPair newPt = new PointPair( _dragStartPair );

			Scale xScale = _dragCurve.GetXAxis( _dragPane )._scale;
			if ( _isEnableHEdit )
				newPt.X = xScale.DeLinearize( xScale.Linearize( newPt.X ) +
							xScale.Linearize( curX ) - xScale.Linearize( startX ) );

			Scale yScale = _dragCurve.GetYAxis( _dragPane )._scale;
			if ( _isEnableVEdit )
				newPt.Y = yScale.DeLinearize( yScale.Linearize( newPt.Y ) +
							yScale.Linearize( curY ) - yScale.Linearize( startY ) );

			// save the data back to the point list
			IPointListEdit list = _dragCurve.Points as IPointListEdit;
			if ( list != null )
				list[_dragIndex] = newPt;

			// force a redraw
			Refresh();
		}
Example #20
0
		/// <summary>
		/// The PointPair copy constructor.
		/// </summary>
		/// <param name="rhs">The basis for the copy.</param>
		public PointPair( PointPair rhs ) : base( rhs )
		{
			Z = rhs.Z;

			if ( rhs.Tag is ICloneable )
				Tag = ((ICloneable) rhs.Tag).Clone();
			else
				Tag = rhs.Tag;
		}
Example #21
0
		/// <summary>
		/// Add a <see c_ref="PointPair"/> object to the end of the points collection for this curve.
		/// </summary>
		/// <remarks>
		/// This method will only work if the <see c_ref="IPointList" /> instance reference
		/// at <see c_ref="Points" /> supports the <see c_ref="IPointListEdit" /> interface.
		/// Otherwise, it does nothing.
		/// </remarks>
		/// <param name="point">A reference to the <see c_ref="PointPair"/> object to
		/// be added</param>
		public void AddPoint( PointPair point )
		{
			if ( _points == null )
				Points = new PointPairList();

			if ( _points is IPointListEdit )
				( _points as IPointListEdit ).Add( point );
			else
				throw new NotImplementedException();
		}
Example #22
0
		/// <summary>
		/// Indexer: get the Sample instance at the specified ordinal position in the list
		/// </summary>
		/// <param name="index">The ordinal position in the list of samples</param>
		/// <returns>Returns a <see c_ref="PointPair" /> instance containing the
		/// data specified by <see c_ref="XType" /> and <see c_ref="YType" />
		/// </returns>
		public PointPair this[int index]
		{
			get
			{
				PointPair pt = new PointPair();
				Sample sample = (Sample) list[index];
				pt.X = GetValue( sample, XType );
				pt.Y = GetValue( sample, YType );
				return pt;
			}
		}
Example #23
0
File: Line.cs Project: CareyGit/jx
		/// <summary>
		/// Draw the this <see c_ref="CurveItem"/> to the specified <see c_ref="Graphics"/>
		/// device.  The format (stair-step or line) of the curve is
		/// defined by the <see c_ref="StepType"/> property.  The routine
		/// only draws the line segments; the symbols are drawn by the
		/// <see c_ref="Symbol.Draw"/> method.  This method
		/// is normally only called by the Draw method of the
		/// <see c_ref="CurveItem"/> object
		/// </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="scaleFactor">
		/// The scaling factor to be used for rendering objects.  This is calculated and
		/// passed down by the parent <see c_ref="GraphPane"/> object using the
		/// <see c_ref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
		/// font sizes, etc. according to the actual size of the graph.
		/// </param>
		/// <param name="pane">
		/// A reference to the <see c_ref="GraphPane"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="curve">A <see c_ref="LineItem"/> representing this
		/// curve.</param>
		public void DrawCurveOriginal( Graphics g, GraphPane pane,
										  CurveItem curve, float scaleFactor )
		{
			Line source = this;
			if ( curve.IsSelected )
				source = Selection.Line;

			float tmpX, tmpY,
					lastX = float.MaxValue,
					lastY = float.MaxValue;
			double curX, curY, lowVal;
			PointPair curPt, lastPt = new PointPair();

			bool lastBad = true;
			IPointList points = curve.Points;
			ValueHandler valueHandler = new ValueHandler( pane, false );
			Axis yAxis = curve.GetYAxis( pane );
			Axis xAxis = curve.GetXAxis( pane );

			bool xIsLog = xAxis._scale.IsLog;
			bool yIsLog = yAxis._scale.IsLog;

			float minX = pane.Chart.Rect.Left;
			float maxX = pane.Chart.Rect.Right;
			float minY = pane.Chart.Rect.Top;
			float maxY = pane.Chart.Rect.Bottom;

			using ( Pen pen = source.GetPen( pane, scaleFactor ) )
			{
				if ( points != null && !_color.IsEmpty && IsVisible )
				{
					//bool lastOut = false;
					bool isOut;

					// Loop over each point in the curve
					for ( int i = 0; i < points.Count; i++ )
					{
						curPt = points[i];
						if ( pane.LineType == LineType.Stack )
						{
							if ( !valueHandler.GetValues( curve, i, out curX, out lowVal, out curY ) )
							{
								curX = PointPair.Missing;
								curY = PointPair.Missing;
							}
						}
						else
						{
							curX = curPt.X;
							curY = curPt.Y;
						}

						// 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 ( curX == PointPair.Missing ||
								curY == PointPair.Missing ||
								Double.IsNaN( curX ) ||
								Double.IsNaN( curY ) ||
								Double.IsInfinity( curX ) ||
								Double.IsInfinity( curY ) ||
								( xIsLog && curX <= 0.0 ) ||
								( yIsLog && curY <= 0.0 ) )
						{
							// If the point is invalid, then make a linebreak only if IsIgnoreMissing is false
							// LastX and LastY are always the last valid point, so this works out
							lastBad = lastBad || !pane.IsIgnoreMissing;
							isOut = true;
						}
						else
						{
							// Transform the current point from user scale units to
							// screen coordinates
							tmpX = xAxis.Scale.Transform( curve.IsOverrideOrdinal, i, curX );
							tmpY = yAxis.Scale.Transform( curve.IsOverrideOrdinal, i, curY );
							isOut = ( tmpX < minX && lastX < minX ) || ( tmpX > maxX && lastX > maxX ) ||
								( tmpY < minY && lastY < minY ) || ( tmpY > maxY && lastY > maxY );

							if ( !lastBad )
							{
								try
								{
									// GDI+ plots the data wrong and/or throws an exception for
									// outrageous coordinates, so we do a sanity check here
									if ( lastX > 5000000 || lastX < -5000000 ||
											lastY > 5000000 || lastY < -5000000 ||
											tmpX > 5000000 || tmpX < -5000000 ||
											tmpY > 5000000 || tmpY < -5000000 )
										InterpolatePoint( g, pane, curve, lastPt, scaleFactor, pen,
														lastX, lastY, tmpX, tmpY );
									else if ( !isOut )
									{
										if ( !curve.IsSelected && _gradientFill.IsGradientValueType )
										{
											using ( Pen tPen = GetPen( pane, scaleFactor, lastPt ) )
											{
												if ( StepType == StepType.NonStep )
												{
													g.DrawLine( tPen, lastX, lastY, tmpX, tmpY );
												}
												else if ( StepType == StepType.ForwardStep )
												{
													g.DrawLine( tPen, lastX, lastY, tmpX, lastY );
													g.DrawLine( tPen, tmpX, lastY, tmpX, tmpY );
												}
												else if ( StepType == StepType.RearwardStep )
												{
													g.DrawLine( tPen, lastX, lastY, lastX, tmpY );
													g.DrawLine( tPen, lastX, tmpY, tmpX, tmpY );
												}
												else if ( StepType == StepType.ForwardSegment )
												{
													g.DrawLine( tPen, lastX, lastY, tmpX, lastY );
												}
												else
												{
													g.DrawLine( tPen, lastX, tmpY, tmpX, tmpY );
												}
											}
										}
										else
										{
											if ( StepType == StepType.NonStep )
											{
												g.DrawLine( pen, lastX, lastY, tmpX, tmpY );
											}
											else if ( StepType == StepType.ForwardStep )
											{
												g.DrawLine( pen, lastX, lastY, tmpX, lastY );
												g.DrawLine( pen, tmpX, lastY, tmpX, tmpY );
											}
											else if ( StepType == StepType.RearwardStep )
											{
												g.DrawLine( pen, lastX, lastY, lastX, tmpY );
												g.DrawLine( pen, lastX, tmpY, tmpX, tmpY );
											}
											else if ( StepType == StepType.ForwardSegment )
											{
												g.DrawLine( pen, lastX, lastY, tmpX, lastY );
											}
											else if ( StepType == StepType.RearwardSegment )
											{
												g.DrawLine( pen, lastX, tmpY, tmpX, tmpY );
											}
										}
									}

								}
								catch
								{
									InterpolatePoint( g, pane, curve, lastPt, scaleFactor, pen,
												lastX, lastY, tmpX, tmpY );
								}

							}

							lastPt = curPt;
							lastX = tmpX;
							lastY = tmpY;
							lastBad = false;
							//lastOut = isOut;
						}
					}
				}
			}
		}
Example #24
0
		/// <summary>
		/// Constructs a buffer with a copy of the items within the provided
		/// <see c_ref="IPointList" />.
		/// The <see c_ref="Capacity" /> is set to the length of the provided list.
		/// </summary>
		/// <param name="rhs">The <see c_ref="IPointList" /> to be copied.</param>
		public RollingPointPairList( IPointList rhs )
		{
			_mBuffer = new PointPair[rhs.Count];

			for ( int i = 0; i < rhs.Count; i++ )
			{
				_mBuffer[i] = new PointPair( rhs[i] );
			}

			_headIdx = rhs.Count - 1;
			_tailIdx = 0;
		}
Example #25
0
File: Bar.cs Project: CareyGit/jx
		/// <summary>
		/// Draw the <see c_ref="Bar"/> to the specified <see c_ref="Graphics"/> device
		/// at the specified location.  This routine draws a single bar.
		/// </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 c_ref="ZedGraph.GraphPane"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="rect">The rectangle (pixels) to contain the bar</param>
		/// <param name="scaleFactor">
		/// The scaling factor for the features of the graph based on the <see c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="PaneBase.CalcScaleFactor"/> method.  The scale factor
		/// represents a linear multiple to be applied to font sizes, symbol sizes, etc.
		/// </param>
		/// <param name="fullFrame">true to draw the bottom portion of the border around the
		/// bar (this is for legend entries)</param> 
		/// <param name="dataValue">The data value to be used for a value-based
		/// color gradient.  This is only applicable for <see c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/> or <see c_ref="FillType.GradientByZ"/>.</param>
		/// <param name="isSelected">Indicates that the <see c_ref="Bar" /> should be drawn
		/// with attributes from the <see c_ref="Selection" /> class.
		/// </param>
		public void Draw( Graphics g, GraphPane pane, RectangleF rect, float scaleFactor,
							bool fullFrame, bool isSelected, PointPair dataValue )
		{
			if ( isSelected )
			{
				Selection.Fill.Draw( g, rect, dataValue );
				Selection.Border.Draw( g, pane, scaleFactor, rect );
			}
			else
			{
				_fill.Draw( g, rect, dataValue );
				_border.Draw( g, pane, scaleFactor, rect );
			}
		}
Example #26
0
		/// <summary>
		/// Draw the <see c_ref="ErrorBar"/> to the specified <see c_ref="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 c_ref="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 c_ref="ErrorBar"/> is the X axis.  True for an <see c_ref="XAxis"/> base,
		/// false for a <see c_ref="YAxis"/> or <see c_ref="Y2Axis"/> base.</param>
		/// <param name="pixBase">The independent axis position of the center of the error bar in
		/// pixel units</param>
		/// <param name="pixValue">The dependent axis position of the top of the error bar in
		/// pixel units</param>
		/// <param name="pixLowValue">The dependent axis position of the bottom of the error bar in
		/// pixel units</param>
		/// <param name="scaleFactor">
		/// The scaling factor for the features of the graph based on the <see c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="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 attributes of <see c_ref="Color"/> and
		/// <see c_ref="PenWidth"/> for this <see c_ref="ErrorBar"/></param>
		/// <param name="dataValue">The data value to be used for a value-based
		/// color gradient.  This is only applicable for <see c_ref="FillType.GradientByX"/>,
		/// <see c_ref="FillType.GradientByY"/> or <see c_ref="FillType.GradientByZ"/>.</param>
		/// <param name="isSelected">Indicates that the <see c_ref="ErrorBar" /> should be drawn
		/// with attributes from the <see c_ref="Selection" /> class.
		/// </param>
		public void Draw( Graphics g, GraphPane pane, bool isXBase,
								float pixBase, float pixValue,
								float pixLowValue, float scaleFactor, Pen pen, bool isSelected,
								PointPair dataValue )
		{
			if ( isXBase )
			{
				g.DrawLine( pen, pixBase, pixValue, pixBase, pixLowValue );
				_symbol.DrawSymbol( g, pane, (int)pixBase, (int)pixValue,
							scaleFactor, isSelected, dataValue );
				_symbol.DrawSymbol( g, pane, (int)pixBase, (int)pixLowValue,
							scaleFactor, isSelected, dataValue );
			}
			else
			{
				g.DrawLine( pen, pixValue, pixBase, pixLowValue, pixBase );
				_symbol.DrawSymbol( g, pane, (int)pixValue, (int)pixBase,
							scaleFactor, isSelected, dataValue );
				_symbol.DrawSymbol( g, pane, (int)pixLowValue, (int)pixBase,
							scaleFactor, isSelected, dataValue );
			}
		}