External/OxyPlot/OxyPlot/PlotModel/PlotModel.Rendering.cs
changeset 411 9e208c26722f
parent 399 54048d90a678
     1.1 --- a/External/OxyPlot/OxyPlot/PlotModel/PlotModel.Rendering.cs	Sun Jul 14 13:57:13 2013 +0000
     1.2 +++ b/External/OxyPlot/OxyPlot/PlotModel/PlotModel.Rendering.cs	Sun Jul 14 14:04:44 2013 +0000
     1.3 @@ -302,37 +302,53 @@
     1.4              {
     1.5                  rc.DrawRectangleAsPolygon(this.PlotArea, null, this.PlotAreaBorderColor, this.PlotAreaBorderThickness);
     1.6  
     1.7 -                foreach (var axis in this.Axes) {
     1.8 -                  var actualMinimum = axis.Transform(axis.ActualMinimum);
     1.9 -                  var actualMaximum = axis.Transform(axis.ActualMaximum);
    1.10 +                foreach (var axis in this.Axes) 
    1.11 +                {
    1.12 +                    if (!axis.IsAxisVisible)
    1.13 +                        continue;
    1.14  
    1.15 -                  if (!axis.IsAxisVisible)
    1.16 -                    continue;
    1.17 +                    if (axis.IsHorizontal()) 
    1.18 +                    {
    1.19 +                        var start = this.PlotArea.Left + 
    1.20 +                            this.PlotArea.Width * axis.StartPosition;
    1.21 +                        if (axis.StartPosition < 1 && axis.StartPosition > 0)
    1.22 +                            rc.DrawLine(new[] {
    1.23 +                                new ScreenPoint(start, this.PlotArea.Top),
    1.24 +                                new ScreenPoint(start, this.PlotArea.Bottom) },
    1.25 +                                    this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.26 +                                null, OxyPenLineJoin.Miter, true);
    1.27  
    1.28 -                  if (axis.IsHorizontal()) {
    1.29 -                    rc.DrawLine(new[] {
    1.30 -                      new ScreenPoint(actualMinimum, this.PlotArea.Top),
    1.31 -                      new ScreenPoint(actualMinimum, this.PlotArea.Bottom) },
    1.32 -                      this.PlotAreaBorderColor, this.PlotAreaBorderThickness, 
    1.33 -                      null, OxyPenLineJoin.Miter, true);
    1.34 -                    rc.DrawLine(new[] { 
    1.35 -                      new ScreenPoint(actualMaximum, this.PlotArea.Top),
    1.36 -                      new ScreenPoint(actualMaximum, this.PlotArea.Bottom) },
    1.37 -                      this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.38 -                      null, OxyPenLineJoin.Miter, true);
    1.39 -                  } else {
    1.40 -                    rc.DrawLine(new[] { 
    1.41 -                      new ScreenPoint(this.PlotArea.Left, actualMinimum),
    1.42 -                      new ScreenPoint(this.PlotArea.Right, actualMinimum) },
    1.43 -                        this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.44 -                      null, OxyPenLineJoin.Miter, true);
    1.45 -                    rc.DrawLine(new[] { 
    1.46 -                      new ScreenPoint(this.PlotArea.Left, actualMinimum),
    1.47 -                      new ScreenPoint(this.PlotArea.Right, actualMinimum) },
    1.48 -                      this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.49 -                      null, OxyPenLineJoin.Miter, true);
    1.50 -                  }
    1.51 +                        var end = this.PlotArea.Left +
    1.52 +                            this.PlotArea.Width * axis.EndPosition;
    1.53 +                        if (axis.EndPosition < 1 && axis.EndPosition > 0)
    1.54 +                            rc.DrawLine(new[] {
    1.55 +                                new ScreenPoint(end, this.PlotArea.Top),
    1.56 +                                new ScreenPoint(end, this.PlotArea.Bottom) },
    1.57 +                                    this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.58 +                                null, OxyPenLineJoin.Miter, true);
    1.59 +                    } 
    1.60 +                    else 
    1.61 +                    {
    1.62 +                        var start = this.PlotArea.Bottom - 
    1.63 +                            this.PlotArea.Height * axis.StartPosition;
    1.64 +                        if (axis.StartPosition < 1 && axis.StartPosition > 0)
    1.65 +                            rc.DrawLine(new[] { 
    1.66 +                                new ScreenPoint(this.PlotArea.Left, start),
    1.67 +                                new ScreenPoint(this.PlotArea.Right, start) },
    1.68 +                                    this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.69 +                                null, OxyPenLineJoin.Miter, true);
    1.70 +
    1.71 +                        var end = this.PlotArea.Bottom -
    1.72 +                            this.PlotArea.Height * axis.EndPosition;
    1.73 +                        if (axis.EndPosition < 1 && axis.EndPosition > 0)
    1.74 +                            rc.DrawLine(new[] { 
    1.75 +                                new ScreenPoint(this.PlotArea.Left, end),
    1.76 +                                new ScreenPoint(this.PlotArea.Right, end) },
    1.77 +                                    this.PlotAreaBorderColor, this.PlotAreaBorderThickness,
    1.78 +                                null, OxyPenLineJoin.Miter, true);
    1.79 +                    }
    1.80                  }
    1.81 +
    1.82              }
    1.83          }
    1.84