Exemplo n.º 1
0
        /// <summary>
        /// Sets the axes to default locations proportional to the size of the graph panel
        /// </summary>
        public void SetupAxes(int raceLaps)
        {
            horizontalAxis.startLocation = 50;

            //Get the available graph area
            graphArea = SetGraphArea();

            horizontalAxis.baseOffset       = 0;
            horizontalAxis.scaleFactor      = (float)(graphArea.Width) / (float)(raceLaps + 1);
            horizontalAxis.axisLabelSpacing = (int)((25 * raceLaps) / (graphArea.Width));
            verticalAxis.baseOffset         = 0;
            verticalAxis.scaleFactor        = (float)((graphArea.Height) / 100);
            verticalAxis.startLocation      = (graphArea.Height / 2) + 10;
            verticalAxis.axisLabelSpacing   = (int)(50 / verticalAxis.scaleFactor);

            MyEvents.OnAxesModified(horizontalAxis, verticalAxis, graphNormalisationType, false);
        }