Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="P2Graph.AbstractAxis"/> class.
        /// </summary>
        /// <param name="axisName">Axis name.</param>
        /// <param name="gPanel">The panel on which to draw the axis.</param>
        protected AbstractAxis(string axisName, MasterGraphPanel gPanel)
        {
            this._name     = axisName;
            this._minRange = 0;
            this._maxRange = 1;
            this._MGP      = gPanel;

            this._beginsAt = new GraphPoint(0, 0, _MGP);
            this._endsAt   = new GraphPoint(0, 0, _MGP);

            CalculateAxisEnds();

            while (34 < TextRenderer.MeasureText("9999", new Font(toUse.FontFamily,
                                                                  toUse.Size, toUse.Style)).Width)
            {
                toUse = new Font(toUse.FontFamily, toUse.Size - 0.1f, toUse.Style);
            }
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="P2Graph.GraphPoint"/> struct with specified color.
        /// </summary>
        /// <param name="x">The x-coordinate.</param>
        /// <param name="y">The y-coordinate.</param>
        /// <param name="gPanel">The panel on which to draw the point.</param>
        /// <param name="col">Color of the point.</param>
        public GraphPoint(double x, double y, MasterGraphPanel gPanel, Color col)
        {
            if (gPanel == null)
            {
                throw new NullReferenceException("Could not create GraphPoint without reference to a panel");
            }
            else
            {
                this._MGP = gPanel;
            }
            this._xCoord = (float)x;
            this._yCoord = (float)y;
            //Same as method ConvertToPanelX(x);
            _panelX = _MGP.O.X + (float)(x * _MGP.xPixelScale);
            //Same as method ConvertToPanelY(y);
            _panelY = _MGP.O.Y - (float)(y * _MGP.yPixelScale);

            _color = col;
        }
Exemple #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="P2Graph.yAxis"/> class.
		/// </summary>
		/// <param name="AxisName">Name of the y-axis.</param>
		/// <param name="gPanel">The <see cref="P2Graph.MasterGraphPanel"/> on which to draw the axis.</param>
		public yAxis (string AxisName, MasterGraphPanel gPanel)
			: base (AxisName, gPanel)
		{
		}
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="P2Graph.GraphPoint"/> struct with default color DarkGray.
 /// </summary>
 /// <param name="x">The x coordinate.</param>
 /// <param name="y">The y coordinate.</param>
 /// <param name="gPanel">The panel on which to draw the point.</param>
 public GraphPoint(double x, double y, MasterGraphPanel gPanel)
     : this(x, y, gPanel, Color.DarkGray)
 {
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="P2Graph.GraphPoint"/> struct with default color DarkGray.
 /// </summary>
 /// <param name="PF">PointF struct to copy.</param>
 /// <param name="gPanel">The panel on which to draw the point.</param>
 public GraphPoint(PointF PF, MasterGraphPanel gPanel)
     : this(PF.X, PF.Y, gPanel)
 {
 }