本文整理汇总了C#中PlotModel.UpdateAndRenderToNull方法的典型用法代码示例。如果您正苦于以下问题:C# PlotModel.UpdateAndRenderToNull方法的具体用法?C# PlotModel.UpdateAndRenderToNull怎么用?C# PlotModel.UpdateAndRenderToNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlotModel
的用法示例。
在下文中一共展示了PlotModel.UpdateAndRenderToNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoPlotMargins
public void AutoPlotMargins()
{
var plot = new PlotModel { Title = "Auto PlotMargins" };
var verticalAxis = new LinearAxis { Position = AxisPosition.Left };
var horizontalAxis = new LinearAxis { Position = AxisPosition.Bottom };
plot.Axes.Add(verticalAxis);
plot.Axes.Add(horizontalAxis);
plot.UpdateAndRenderToNull(800, 600);
Assert.That(plot.ActualPlotMargins.Left, Is.EqualTo(26).Within(1), "left");
Assert.That(plot.ActualPlotMargins.Top, Is.EqualTo(0).Within(1), "top");
Assert.That(plot.ActualPlotMargins.Right, Is.EqualTo(0).Within(1), "right");
Assert.That(plot.ActualPlotMargins.Bottom, Is.EqualTo(21).Within(1), "bottom");
}
示例2: Axis_DesiredSize
public void Axis_DesiredSize()
{
var xaxis = new LinearAxis { Position = AxisPosition.Bottom, Title = "X-axis" };
var yaxis = new LinearAxis { Position = AxisPosition.Left, Title = "Y-axis" };
var plot = new PlotModel { Title = "Simple plot" };
plot.Axes.Add(xaxis);
plot.Axes.Add(yaxis);
var ls = new LineSeries();
ls.Points.Add(new DataPoint(3, 13));
ls.Points.Add(new DataPoint(10, 47));
ls.Points.Add(new DataPoint(30, 23));
ls.Points.Add(new DataPoint(40, 65));
ls.Points.Add(new DataPoint(80, 10));
plot.Series.Add(ls);
// initial setting
plot.UpdateAndRenderToNull(800, 600);
Assert.That(yaxis.DesiredSize.Width, Is.EqualTo(35.0).Within(0.5), "y-axis width");
Assert.That(yaxis.DesiredSize.Height, Is.EqualTo(0.0).Within(1e-6), "y-axis height");
Assert.That(xaxis.DesiredSize.Width, Is.EqualTo(0.0).Within(1e-6), "x-axis width");
Assert.That(xaxis.DesiredSize.Height, Is.EqualTo(35.0).Within(0.5), "x-axis height");
// larger numbers on axis -> larger desired size
yaxis.Zoom(10000, 11000);
plot.UpdateAndRenderToNull(800, 600);
Assert.That(yaxis.DesiredSize.Width, Is.EqualTo(50.0).Within(0.5), "y-axis width");
Assert.That(yaxis.DesiredSize.Height, Is.EqualTo(0.0).Within(1e-6), "y-axis height");
}
示例3: FixedPlotMargins
public void FixedPlotMargins()
{
var plot = new PlotModel { PlotMargins = new OxyThickness(23, 19, 17, 31) };
plot.UpdateAndRenderToNull(800, 600);
Assert.That(plot.ActualPlotMargins.Left, Is.EqualTo(plot.PlotMargins.Left), "left");
Assert.That(plot.ActualPlotMargins.Top, Is.EqualTo(plot.PlotMargins.Top), "top");
Assert.That(plot.ActualPlotMargins.Right, Is.EqualTo(plot.PlotMargins.Right), "right");
Assert.That(plot.ActualPlotMargins.Bottom, Is.EqualTo(plot.PlotMargins.Bottom), "bottom");
}