33
Source/Examples/LINQPad/MyExtensions.FW40.linq
Normal file
33
Source/Examples/LINQPad/MyExtensions.FW40.linq
Normal file
@@ -0,0 +1,33 @@
|
||||
<Query Kind="Program">
|
||||
<Reference Relative="..\..\..\Output\OxyPlot.dll"></Reference>
|
||||
<Reference><RuntimeDirectory>\System.Xaml.dll</Reference>
|
||||
<Reference><RuntimeDirectory>\WPF\WindowsBase.dll</Reference>
|
||||
<Reference><RuntimeDirectory>\WPF\PresentationCore.dll</Reference>
|
||||
<Reference><RuntimeDirectory>\WPF\PresentationFramework.dll</Reference>
|
||||
<Reference Relative="..\..\..\Output\OxyPlot.Wpf.dll"></Reference>
|
||||
<Namespace>System.Windows</Namespace>
|
||||
<Namespace>System.Windows.Controls</Namespace>
|
||||
<Namespace>System.Windows.Media</Namespace>
|
||||
<Namespace>OxyPlot</Namespace>
|
||||
<Namespace>OxyPlot.Wpf</Namespace>
|
||||
</Query>
|
||||
|
||||
void Main()
|
||||
{
|
||||
var pm = new PlotModel("Sine curve");
|
||||
pm.Series.Add(new FunctionSeries(Math.Sin,0,20,200));
|
||||
pm.Show();
|
||||
}
|
||||
|
||||
public static class MyExtensions
|
||||
{
|
||||
public static void Show(this PlotModel model, double width = 800, double height = 500) {
|
||||
var w = new Window() { Title = "OxyPlot.Wpf.PlotView : " + model.Title, Width = width, Height = height };
|
||||
var plot = new PlotView();
|
||||
plot.Model = model;
|
||||
w.Content = plot;
|
||||
w.Show();
|
||||
}
|
||||
}
|
||||
|
||||
// You can also define non-static classes, enums, etc.
|
||||
8
Source/Examples/LINQPad/ReadMe.txt
Normal file
8
Source/Examples/LINQPad/ReadMe.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Tested with LINQPad 4.38.07 (Beta, free edition)
|
||||
|
||||
1. Build OxyPlot release
|
||||
Tools/build.cmd
|
||||
2. Start LINQPad
|
||||
3. Set the plugins/extensions and queries folders to the "OxyPlot/Source/Examples/LINQPad" folder
|
||||
4. Test the "My extensions" main example
|
||||
5. Test the SimpleFunction/SimpleLinePlot queries
|
||||
14
Source/Examples/LINQPad/SimpleFunction.linq
Normal file
14
Source/Examples/LINQPad/SimpleFunction.linq
Normal file
@@ -0,0 +1,14 @@
|
||||
<Query Kind="Program">
|
||||
<Namespace>OxyPlot</Namespace>
|
||||
</Query>
|
||||
|
||||
void Main()
|
||||
{
|
||||
var pm = new PlotModel("Simple Function Plots") { PlotType = PlotType.Cartesian };
|
||||
|
||||
pm.Series.Add(new FunctionSeries(Math.Sin, -10, 10, 0.1, "sin(x)"));
|
||||
pm.Series.Add(new FunctionSeries(Math.Cos, -10, 10, 0.1, "cos(x)"));
|
||||
pm.Series.Add(new FunctionSeries(t => 5 * Math.Cos(t), t => 5 * Math.Sin(t), 0, 2 * Math.PI, 0.1, "5cos(t),5sin(t)"));
|
||||
|
||||
pm.Show();
|
||||
}
|
||||
18
Source/Examples/LINQPad/SimpleLinePlot.linq
Normal file
18
Source/Examples/LINQPad/SimpleLinePlot.linq
Normal file
@@ -0,0 +1,18 @@
|
||||
<Query Kind="Program">
|
||||
<Namespace>OxyPlot</Namespace>
|
||||
</Query>
|
||||
|
||||
void Main()
|
||||
{
|
||||
var pm = new PlotModel("Simple Line Plot");
|
||||
|
||||
var lineSeries1 = new LineSeries("LineSeries1");
|
||||
|
||||
lineSeries1.Points.Add( new DataPoint (1,1));
|
||||
lineSeries1.Points.Add( new DataPoint (2,2));
|
||||
lineSeries1.Points.Add( new DataPoint (3,1.5));
|
||||
|
||||
pm.Series.Add(lineSeries1);
|
||||
|
||||
pm.Show();
|
||||
}
|
||||
Reference in New Issue
Block a user