Ejemplo n.º 1
0
        public void Update(SKRect plotRect)
        {
            this.plotRect = plotRect;

            titleRect = new SKRect(plotRect.Left, plotRect.Top, plotRect.Right, plotRect.Top + titleHeight);

            yLabelRect = new SKRect(plotRect.Left, plotRect.Top, plotRect.Left + yLabelWidth, plotRect.Bottom);
            yScaleRect = new SKRect(yLabelRect.Right, plotRect.Top, yLabelRect.Right + yScaleWidth, plotRect.Bottom);

            y2LabelRect = new SKRect(plotRect.Right - y2LabelWidth, plotRect.Top, plotRect.Right, plotRect.Bottom);
            y2ScaleRect = new SKRect(y2LabelRect.Left - y2ScaleWidth, plotRect.Top, y2LabelRect.Left, plotRect.Bottom);

            xLabelRect = new SKRect(plotRect.Left, plotRect.Bottom - xLabelHeight, plotRect.Right, plotRect.Bottom);
            xScaleRect = new SKRect(plotRect.Left, xLabelRect.Top - xScaleHeight, plotRect.Right, xLabelRect.Top);

            // shrink dataRect to its final size
            dataRect = plotRect;
            dataRect = dataRect.ShrinkBy(
                left: yLabelRect.Width + yScaleRect.Width,
                right: y2LabelRect.Width + y2ScaleRect.Width,
                bottom: xLabelRect.Height + xScaleRect.Height,
                top: titleRect.Height
                );

            // shrink labels and scales to match dataRect
            yLabelRect  = yLabelRect.MatchVert(dataRect);
            yScaleRect  = yScaleRect.MatchVert(dataRect);
            y2LabelRect = y2LabelRect.MatchVert(dataRect);
            y2ScaleRect = y2ScaleRect.MatchVert(dataRect);
            xLabelRect  = xLabelRect.MatchHoriz(dataRect);
            xScaleRect  = xScaleRect.MatchHoriz(dataRect);
        }