Exemplo n.º 1
0
        private void SetYAxisStrokes(ViewArgs args)
        {
            int   yAxisStrokeCount = 0;
            float actualPixelHeight, valueHeight, valueDistanceBetweenStrokes, min, max;

            actualPixelHeight           = args.PixelSize.ActualHeight;
            valueHeight                 = args.ValueDimensions.Height;
            valueDistanceBetweenStrokes = GetValueDistanceBetweenStrokes(actualPixelHeight, valueHeight);

            min = args.ValueDimensions.Bottom -
                  (ViewArgs.BufferFactor - 1) / 2F * args.ValueDimensions.Height;
            max = args.ValueDimensions.Top +
                  (ViewArgs.BufferFactor - 1) / 2F * args.ValueDimensions.Height;

            foreach (float value in GetMultipleFromValuesInView(valueDistanceBetweenStrokes, min, max))
            {
                float x1, x2, y;

                x1 = yAxisLine.X - strokeLength / 2;
                x2 = yAxisLine.X + strokeLength / 2;
                y  = args.ToViewY(value);

                SetYAxisStroke(yAxisStrokeCount, x1, x2, y, value);

                yAxisStrokeCount++;
            }

            while (yAxisStrokes.Count > yAxisStrokeCount)
            {
                yAxisStrokes.RemoveAt(yAxisStrokeCount);
            }
        }
Exemplo n.º 2
0
        private void SetAxesLines(ViewArgs args)
        {
            xAxisLine.Y = GetBetween(args.ToViewY(0), 0, args.PixelSize.ActualHeight);
            yAxisLine.X = GetBetween(args.ToViewX(0), 0, args.PixelSize.ActualWidth);

            xAxisLine.X2 = args.PixelSize.ActualPixelSize.X;
            yAxisLine.Y2 = args.PixelSize.ActualHeight;
        }