public void DrawAxis(CJumboGraphics graph) { Pen pen = new Pen(Color.Red); // // Vertical Axis graph.DrawLine(pen, 0, 0, 0, (int)(75.0 * yscale)); // // // double mxx = ComputeMaxValue(); graph.DrawLine(pen, 0, 0, (int)(xscale * mxx), 0); }
public void DrawAxisText(CJumboGraphics g) { Pen pen = new Pen(Color.Green); Font fl = new Font("Verdana", 9, System.Drawing.FontStyle.Regular); SolidBrush brs = new SolidBrush(Color.Black); //Matrix mt = new Matrix(); for (int i = 5; i <= 75; i += 5) { String str = Convert.ToString(i); // Matrix m = g.Transform; // Point[] fr = new Point[1]; // fr[0] = new Point(-15,(int)(i*yscale)); // g.TransformPoints(CoordinateSpace.Device ,CoordinateSpace.World , fr ); // g.Transform = mt; // g.DrawString(str,fl,brs,fr[0].X ,fr[0].Y ); g.DrawString(str, fl, brs, -15, (int)(i * yscale)); // g.Transform = m; g.DrawLine(pen, -5, (int)(i * yscale), 5, (int)(i * yscale)); } int mx = (int)ComputeMaxValue(); int addendum = mx / 10; for (int i = 0; i < mx; i += addendum) { String str = Convert.ToString(i); // Matrix m = g.Transform; // Point[] fr = new Point[1]; // fr[0] = new Point((int)(i*xscale),-2); // g.TransformPoints(CoordinateSpace.Device ,CoordinateSpace.World , fr ); // g.Transform = mt; //g.DrawString(str,fl,brs,fr[0].X ,fr[0].Y ); g.DrawString(str, fl, brs, (int)(i * xscale), -2); //g.Transform = m; if (i != 0) { g.DrawLine(pen, (int)(i * xscale), 10, (int)(i * xscale), 0); } } }
public void PlotData(CJumboGraphics g) { Pen pen = new Pen(Color.Brown); // g.DrawLine(pen,(float)_xaxis[0]*xscale,(float)_yaxis[0]*yscale,(float)_xaxis[0]*xscale ,(float) _yaxis[0]*yscale); float oldx = (float)_xaxis[0] * xscale; float oldy = (float)_yaxis[0] * yscale; for (int i = 1; i < 180; ++i) { g.DrawLine(pen, (int)oldx, (int)oldy, (int)(_xaxis[i] * xscale), (int)(_yaxis[i] * yscale)); oldx = (float)_xaxis[i] * xscale; oldy = (float)_yaxis[i] * yscale; } }