Exemple #1
0
        public static void TestPngExport()
        {
            // the PlotView is a WPF control that's created in the .xaml code
            OxyPlot.Wpf.PlotView examplePlotView = new OxyPlot.Wpf.PlotView();

            // create the plot
            Plot plot = new ScatterPlot(examplePlotView, new List <Datum> {
                new Datum(0, 1), new Datum(2, 3)
            });

            string exportPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "testPngExport.png");

            plot.ExportToPng(exportPath);
            Assert.That(File.Exists(exportPath));

            File.Delete(exportPath);
        }