void DrawLegendBox(Graphics g, Brush b, ChartMarkerEnum marker, int x, int y, int boxSize) { Pen p = null; int mSize = boxSize / 2; // Marker size is 1/2 of box size try { if (marker != ChartMarkerEnum.None) { p = new Pen(b, 1); g.DrawLine(p, new Point(x, y + (boxSize + 1) / 2), new Point(x + boxSize, y + (boxSize + 1) / 2)); x = x + (boxSize - mSize) / 2; y = y + (boxSize - mSize) / 2; if (mSize % 2 == 0) { mSize++; } } if (marker == ChartMarkerEnum.None) { g.FillRectangle(b, x, y, boxSize, boxSize); } else { DrawLegendMarker(g, b, p, marker, x, y, mSize); } } finally { if (p != null) { p.Dispose(); } } }
protected ChartMarkerEnum[] GetSeriesMarkers() { ChartMarkerEnum[] m = new ChartMarkerEnum[SeriesCount]; for (int i = 0; i < SeriesCount; i++) { m[i] = (ChartMarkerEnum)(i % (int)ChartMarkerEnum.Count); } return(m); }
internal void DrawLegendLineMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { if (b.GetType() == typeof(System.Drawing.Drawing2D.HatchBrush)) { System.Drawing.Drawing2D.HatchBrush hb = (System.Drawing.Drawing2D.HatchBrush)b; b = new SolidBrush(hb.ForegroundColor); } Pen p2; Point[] points; switch (marker) { case ChartMarkerEnum.Bubble: case ChartMarkerEnum.Circle: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Plus: p2 = new Pen(b, 2.0f); g.DrawLine(p2, new Point(x + (mSize + 1) / 2, y), new Point(x + (mSize + 1) / 2, y + mSize)); //g.DrawLine(p2, new Point(x + (mSize + 1) / 2, y + (mSize + 1) / 2), new Point(x + mSize, y + (mSize + 1) / 2)); break; case ChartMarkerEnum.Diamond: points = new Point[5]; points[0] = points[4] = new Point(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new Point(x, y + (mSize + 1) / 2); points[2] = new Point(x + (mSize + 1) / 2, y + mSize); points[3] = new Point(x + mSize, y + (mSize + 1) / 2); g.FillPolygon(b, points); break; case ChartMarkerEnum.Triangle: points = new Point[4]; points[0] = points[3] = new Point(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new Point(x, y + mSize); points[2] = new Point(x + mSize, y + mSize); g.FillPolygon(b, points); break; case ChartMarkerEnum.X: p2 = new Pen(b, 2.0f); g.DrawLine(p2, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p2, new Point(x, y + mSize), new Point(x + mSize, y)); break; } return; }
internal void DrawLegendMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { Point[] points; switch (marker) { case ChartMarkerEnum.Circle: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Plus: g.DrawLine(p, new Point(x + (mSize + 1) / 2, y), new Point(x + (mSize + 1) / 2, y + mSize)); g.DrawLine(p, new Point(x + (mSize + 1) / 2, y + (mSize + 1) / 2), new Point(x + mSize, y + (mSize + 1) / 2)); break; case ChartMarkerEnum.Diamond: points = new Point[5]; points[0] = points[4] = new Point(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new Point(x, y + (mSize + 1) / 2); points[2] = new Point(x + (mSize + 1) / 2, y + mSize); points[3] = new Point(x + mSize, y + (mSize + 1) / 2); g.FillPolygon(b, points); break; case ChartMarkerEnum.Triangle: points = new Point[4]; points[0] = points[3] = new Point(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new Point(x, y + mSize); points[2] = new Point(x + mSize, y + mSize); g.FillPolygon(b, points); break; case ChartMarkerEnum.X: g.DrawLine(p, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p, new Point(x + mSize, y + mSize), new Point(x + mSize, y)); break; } return; }
void DrawLinePoint(Report rpt, Graphics g, Brush brush, ChartMarkerEnum marker, Point p, int iRow, int iCol) { Pen pen = null; try { pen = new Pen(brush); DrawLegendMarker(g, brush, pen, marker, p.X - 3, p.Y - 3, 7); DrawDataPoint(rpt, g, new Point(p.X - 3, p.Y + 3), iRow, iCol); } finally { if (pen != null) { pen.Dispose(); } } return; }
void DrawLinePoint(Report rpt, Graphics g, Brush brush, ChartMarkerEnum marker, Point p, int iRow, int iCol) { Pen pen = null; try { pen = new Pen(brush); // 20022008 AJM GJL - Added bigger points DrawLegendMarker(g, brush, pen, marker, p.X - 5, p.Y - 5, 10); DrawDataPoint(rpt, g, new Point(p.X - 5, p.Y + 5), iRow, iCol); } finally { if (pen != null) { pen.Dispose(); } } return; }
void DrawLegendBox(Graphics g, Brush b, ChartMarkerEnum marker, int x, int y, int boxSize) { DrawLegendBox(g, b, marker, x, y, boxSize, 2); }
protected ChartMarkerEnum[] GetSeriesMarkers() { ChartMarkerEnum[] m = new ChartMarkerEnum[SeriesCount]; for (int i=0; i < SeriesCount; i++) { m[i] = (ChartMarkerEnum) ( i % (int) ChartMarkerEnum.Count); } return m; }
void DrawLinePoint(Report rpt, Graphics g, Brush brush, ChartMarkerEnum marker, Point p, int iRow, int iCol) { Pen pen=null; try { pen = new Pen(brush); // 20022008 AJM GJL - Added bigger points DrawLegendMarker(g, brush, pen, marker, p.X-5, p.Y-5, 10); DrawDataPoint(rpt, g, new Point(p.X-5, p.Y+5), iRow, iCol); } finally { if (pen != null) pen.Dispose(); } return; }
void DrawLinePoint(Report rpt, Graphics g, Brush brush, ChartMarkerEnum marker, Point p, int iRow, int iCol) { Pen pen=null; try { pen = new Pen(brush); DrawLegendMarker(g, brush, pen, marker, p.X-3, p.Y-3, 7); DrawDataPoint(rpt, g, new Point(p.X-3, p.Y+3), iRow, iCol); } finally { if (pen != null) pen.Dispose(); } return; }
internal void DrawLegendMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { Point[] points; switch (marker) { case ChartMarkerEnum.Circle: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Plus: g.DrawLine(p, new Point(x + (mSize + 1)/2, y), new Point(x + (mSize + 1)/2, y + mSize)); g.DrawLine(p, new Point(x + (mSize + 1)/2, y + (mSize+1)/2), new Point(x + mSize, y + (mSize+1)/2)); break; case ChartMarkerEnum.Diamond: points = new Point[5]; points[0] = points[4] = new Point(x + (mSize + 1)/2, y); // starting and ending point points[1] = new Point(x, y + (mSize+1)/2); points[2] = new Point(x + (mSize+1)/2, y+mSize); points[3] = new Point(x + mSize, y + (mSize+1)/2); g.FillPolygon(b, points); break; case ChartMarkerEnum.Triangle: points = new Point[4]; points[0] = points[3] = new Point(x + (mSize + 1)/2, y); // starting and ending point points[1] = new Point(x, y + mSize); points[2] = new Point(x + mSize, y + mSize); g.FillPolygon(b, points); break; case ChartMarkerEnum.X: g.DrawLine(p, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p, new Point(x + mSize, y + mSize), new Point(x + mSize, y)); break; } return; }
void DrawLegendBox(Graphics g, Brush b, ChartMarkerEnum marker, int x, int y, int boxSize) { Pen p=null; int mSize= boxSize / 2; // Marker size is 1/2 of box size try { if (marker != ChartMarkerEnum.None) { p = new Pen(b, 1); g.DrawLine(p, new Point(x, y + (boxSize + 1)/2), new Point(x + boxSize, y + (boxSize + 1)/2)); x = x + (boxSize - mSize)/2; y = y + (boxSize - mSize)/2; if (mSize % 2 == 0) mSize++; } if (marker == ChartMarkerEnum.None) { g.FillRectangle(b, x, y, boxSize, boxSize); } else { DrawLegendMarker(g, b, p, marker, x, y, mSize); } } finally { if (p != null) p.Dispose(); } }
internal void DrawLegendMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { PointF[] tfArray; switch (marker) { case ChartMarkerEnum.Circle: case ChartMarkerEnum.Bubble: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Triangle: tfArray = new PointF[4]; tfArray[0] = tfArray[3] = new PointF((float)(x + ((mSize + 1) / 2)), (float)y); tfArray[1] = new PointF((float)x, (float)(y + mSize)); tfArray[2] = new PointF((float)(x + mSize), (float)(y + mSize)); g.FillPolygon(b, tfArray); break; case ChartMarkerEnum.Plus: p = new Pen(p.Brush, 2f); g.DrawLine(p, new Point(x + ((mSize + 1) / 2), y), new Point(x + ((mSize + 1) / 2), y + mSize)); break; case ChartMarkerEnum.X: p = new Pen(p.Brush, 2f); g.DrawLine(p, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p, new Point(x, y + mSize), new Point(x + mSize, y)); break; case ChartMarkerEnum.Diamond: tfArray = new PointF[5]; tfArray[0] = tfArray[4] = (PointF)new Point(x + ((mSize + 1) / 2), y); tfArray[1] = new PointF((float)x, (float)(y + ((mSize + 1) / 2))); tfArray[2] = new PointF((float)(x + ((mSize + 1) / 2)), (float)(y + mSize)); tfArray[3] = new PointF((float)(x + mSize), (float)(y + ((mSize + 1) / 2))); g.FillPolygon(b, tfArray); break; } }
private void DrawLegendBox(Graphics g, Brush b, ChartMarkerEnum marker, int x, int y, int boxSize, int intLineSize) { Pen pen = null; int mSize = boxSize / 2; try { if (marker < ChartMarkerEnum.Count) { pen = new Pen(b, (float)intLineSize); if (this.ChartDefn.Type != ChartTypeEnum.Scatter) { g.DrawLine(pen, new Point(x, y + ((boxSize + 1) / 2)), new Point(x + boxSize, y + ((boxSize + 1) / 2))); } x += (boxSize - mSize) / 2; y += (boxSize - mSize) / 2; if ((mSize % 2) == 0) { mSize++; } } if (marker == ChartMarkerEnum.None) { g.FillRectangle(b, x, y, boxSize, boxSize); } else if (marker == ChartMarkerEnum.Bubble) { g.FillEllipse(b, x, y, boxSize, boxSize); } else if (marker == ChartMarkerEnum.Line) { pen = new Pen(b, (float)intLineSize); g.DrawLine(pen, new Point(x, y + ((boxSize + 1) / 2)), new Point(x + boxSize, y + ((boxSize + 1) / 2))); } else { this.DrawLegendMarker(g, b, pen, marker, x, y, mSize); } } finally { if (pen != null) { pen.Dispose(); } } }
protected ChartMarkerEnum[] GetSeriesMarkers() { ChartMarkerEnum[] enumArray = new ChartMarkerEnum[this.SeriesCount]; for (int i = 0; i < this.SeriesCount; i++) { enumArray[i] = (ChartMarkerEnum)(i % 6); } return enumArray; }
void DrawLegendBox(Graphics g, Brush b, ChartMarkerEnum marker, int x, int y, int boxSize, int intLineSize) { Pen p=null; int mSize= boxSize / 2; // Marker size is 1/2 of box size try { if (marker < ChartMarkerEnum.Count) { p = new Pen(b,intLineSize); if (this.ChartDefn.Type != ChartTypeEnum.Scatter) { g.DrawLine(p, new Point(x, y + (boxSize + 1)/2), new Point(x + boxSize, y + (boxSize + 1)/2)); } x = x + (boxSize - mSize)/2; y = y + (boxSize - mSize)/2; if (mSize % 2 == 0) mSize++; } if (marker == ChartMarkerEnum.None) { g.FillRectangle(b, x, y, boxSize, boxSize); } else if (marker == ChartMarkerEnum.Bubble) { g.FillEllipse(b, x, y, boxSize, boxSize); } else if (marker == ChartMarkerEnum.Line) { // this is only to draw lines for line plot types on scatter charts p = new Pen(b, intLineSize); g.DrawLine(p, new Point(x, y + (boxSize + 1) / 2), new Point(x + boxSize, y + (boxSize + 1) / 2)); } else { DrawLegendMarker(g, b, p, marker, x, y, mSize); } } finally { if (p != null) p.Dispose(); } }
internal void DrawLegendMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { PointF[] points; switch (marker) { case ChartMarkerEnum.Bubble: case ChartMarkerEnum.Circle: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Plus: // 20022008 AJM GJL - Changed to line - plus is hard to see p = new Pen(p.Brush, 2); g.DrawLine(p, new Point(x + (mSize + 1)/2, y), new Point(x + (mSize + 1)/2, y + mSize)); //g.DrawLine(p, new Point(x + (mSize + 1)/2, y + (mSize+1)/2), new Point(x + mSize, y + (mSize+1)/2)); break; case ChartMarkerEnum.Diamond: points = new PointF[5]; points[0] = points[4] = new Point(x + (mSize + 1)/2, y); // starting and ending point points[1] = new PointF(x, y + (mSize+1)/2); points[2] = new PointF(x + (mSize+1)/2, y+mSize); points[3] = new PointF(x + mSize, y + (mSize+1)/2); g.FillPolygon(b, points); break; case ChartMarkerEnum.Triangle: points = new PointF[4]; points[0] = points[3] = new PointF(x + (mSize + 1)/2, y); // starting and ending point points[1] = new PointF(x, y + mSize); points[2] = new PointF(x + mSize, y + mSize); g.FillPolygon(b, points); break; case ChartMarkerEnum.X: p = new Pen(p.Brush, 2);// 20022008 AJM GJL g.DrawLine(p, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p, new Point(x, y + mSize), new Point(x + mSize, y));// 20022008 AJM GJL break; } return; }
internal void DrawLegendLineMarker(Graphics g, Brush b, Pen p, ChartMarkerEnum marker, int x, int y, int mSize) { if (b.GetType() == typeof(System.Drawing.Drawing2D.HatchBrush)) { System.Drawing.Drawing2D.HatchBrush hb = ( System.Drawing.Drawing2D.HatchBrush) b; b = new SolidBrush(hb.ForegroundColor); } Pen p2; PointF[] points; switch (marker) { case ChartMarkerEnum.Bubble: case ChartMarkerEnum.Circle: g.FillEllipse(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Square: g.FillRectangle(b, x, y, mSize, mSize); break; case ChartMarkerEnum.Plus: p2 = new Pen(b, 2.0f); g.DrawLine(p2, new Point(x + (mSize + 1) / 2, y), new Point(x + (mSize + 1) / 2, y + mSize)); //g.DrawLine(p2, new Point(x + (mSize + 1) / 2, y + (mSize + 1) / 2), new Point(x + mSize, y + (mSize + 1) / 2)); break; case ChartMarkerEnum.Diamond: points = new PointF[5]; points[0] = points[4] = new PointF(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new PointF(x, y + (mSize + 1) / 2); points[2] = new PointF(x + (mSize + 1) / 2, y + mSize); points[3] = new PointF(x + mSize, y + (mSize + 1) / 2); g.FillPolygon(b, points); break; case ChartMarkerEnum.Triangle: points = new PointF[4]; points[0] = points[3] = new PointF(x + (mSize + 1) / 2, y); // starting and ending point points[1] = new PointF(x, y + mSize); points[2] = new PointF(x + mSize, y + mSize); g.FillPolygon(b, points); break; case ChartMarkerEnum.X: p2 = new Pen(b, 2.0f); g.DrawLine(p2, new Point(x, y), new Point(x + mSize, y + mSize)); g.DrawLine(p2, new Point(x, y + mSize), new Point(x + mSize, y)); break; } return; }