
Plot.ResetAllAxes vs. ResetManipulator
seveland12 wrote at 2013-04-19 16:31:
objo wrote at 2013-04-24 11:01:
Axes
collection in the
PlotModel
and call the Reset
method of each axis. Then call the
RefreshPlot
on the PlotModel. If this does not work, there is probably a bug (I have not tested myself).
How to Create HighLowSeries/CandlestickSeries
kcbtdev wrote at 2013-06-13 18:11:
objo wrote at 2013-06-13 23:35:
https://oxyplot.codeplex.com/workitem/9999

How do I display a graph in Visual Studio?
faroskalin wrote at 2013-12-06 16:39:
So I am using the Example Browser application, and I have pasted the code to VS 2013, like so:

I understand that the return type of the Notinterpolatedvalues() method is a PlotModel. Now - how do I display that? As in, what is the method I need to use in my main method in order to play Notinterpolatedvalues()?
Thank you.
faroskalin wrote at 2013-12-06 17:43:
Essentially, it's a convenience factor in the use of var in this instance like "when the type is elsewhere on the same line".

Linechart over stream of numbers
Alxandr wrote at 2012-03-29 13:02:
I'd like to make a linechart over a stream of numbers that continuously get's generated. Sort of like a cpu-usage graph or something along those lines; where the new data enters on the right side, and the old data exits on the left. Also, I do not know beforehand the maximum number that will be generated in this series (but I do know it will never be below 0). What I tried so far was something like this:
private class NetworkPlotModel : PlotModel { private LineSeries ups, downs; private LinearAxis vax; public NetworkPlotModel() { Axes.Clear(); Axes.Add(new TimeSpanAxis(pos: AxisPosition.Bottom, title: "Time", min: -60, max: 0)); Axes.Add(vax = new LinearAxis(AxisPosition.Right, "Value")); vax.MaximumPadding = 0.03; Series.Add(ups = new LineSeries(OxyColor.FromRGB(1, 0, 0), strokeThickness: 3, title: "Up")); } public void Push(TimeSpan delta, double up) { for (int i = 0; i < ups.Points.Count; i++) { IDataPoint p = ups.Points[i]; ups.Points[i] = new DataPoint(p.X - delta.TotalSeconds, p.Y); } ups.Points.Add(new DataPoint(0, up)); this.Update(true); } }
However, this does not seem to draw a line at all (even though I call the Push-method 1 time, 100 times or 1000 times, and I've also tried to call it once a sec, and up to 10 times a second).
Could I please get an example of how to make something like this work?
ckoo wrote at 2012-03-29 14:36:
I implemented something similar using an observable. Here is the code below, which might give you a few hints.
Random rand = new Random(); Observable.Interval(TimeSpan.FromSeconds(0.1)).Where( x => x < 100).Subscribe( x => { var series = ((LineSeries) pm.Series[0]); if( x > 50) { // Remove the first point in the series when we readh 50 data points. series.Points.RemoveAt(0); // Reset the minimum value on the xAxis. pm.Axes[0].Minimum = series.Points[0].X; } // Add the new point series.Points.Add( new DataPoint(3 + x, rand.Next(10))); // Set maximum value pm.Axes[0].Maximum = x; // Need to reset the xAxis for it refresh properly ((LineSeries) pm.Series[0]).XAxis.Reset(); plotControl.Refresh(); } );
I think the PlotModel class also has a .Refresh() method.
objo wrote at 2012-03-30 13:16:
PlotModel.Update updates the model, but does not refresh the plot control.
Use PlotControl.Refresh or PlotModel.Refresh to redraw the plot.
Will add examples on the wiki page http://oxyplot.codeplex.com/wikipage?title=Refreshing%20a%20plot
Alxandr wrote at 2012-03-30 13:47:
Thank you :)

LineSeries: Strange behaviour
frozzzyy wrote at 2012-06-19 11:16:
Hi, objo!
Сan You look at this screenshot?
May I get rid of this?
objo wrote at 2012-06-19 12:24:
First guess: Try to change the LineJoin
property on the LineSeries
from
Miter
to Round
.
frozzzyy wrote at 2012-06-19 12:58:
Thank You! Works well!

LineSeries in Cartesian plot does not redraw correctly.
endorphing wrote at 2013-08-16 23:57:
Steps to reproduce,
1) Set the PlotType to Cartesian,
2) Re-size the main Window of your application to a very small horizontal width.
3) Now click on the top-right corner of your window to make it full-screen.
Result: The line series does not redraw in the plot area, and retains the previous small size.
This issue can also be seen in your ExampleBrowser application in the Cartesian axes examples. Any idea what might be causing this?
Thanks in advance for your help.
everytimer wrote at 2013-08-17 20:45:
To solve this you could associate the Window State Changed to a method that resets the axes.
void ResetAxes()
{
foreach (var axis in plotter.Axes)
{
axis.Reset();
}
}
Good luckendorphing wrote at 2013-10-08 21:24:
<oxy:Plot Name="MyPlot" Model="{Binding MyPlot.Model}" SizeChanged="MyPlot_SizeChanged" />
private void MyPlot_SizeChanged(object sender, SizeChangedEventArgs e)
{
var plotter = sender as Plot;
var model = plotter.Model;
if (!ReferenceEquals(model, null) && model.PlotType == PlotType.Cartesian)
plotter.ResetAllAxes();
}
thomasdr wrote at 2013-12-12 12:45:
objo wrote at 2013-12-12 20:27:
The best solution would be to solve the 'cartesian axes' in a more general way, as described in https://oxyplot.codeplex.com/workitem/10095

No WinForms Plot Control!
jacakk wrote at 2013-01-10 20:54:
I'm using OxyPlot.WindowsForms and VS 2010 Ultimate.
I'm trying to add Control Plot but in Controls Menu there is no such thing like "Plot"!
Help!
objo wrote at 2013-01-12 17:58:
- Right click in the toolbox
- Select "Choose items..."
- Press "Browse..." under ".NET framework components
- Select the OxyPlot.WindowsForms.dll assembly (note that there are versions for both .NET 4.0 and .NET 4.5)
- The "Plot" control should appear under "OxyPlot.WindowsForms Components" in the ToolBox
jfraschilla wrote at 2013-08-18 19:37:
There are no components in 'xxx\OxyPlot.WindowsForms.dll' that can be placed on the toolbox.
John
morty77 wrote at 2013-09-27 13:25:
I am a new user to OxyPlot and tried to create an WinForms example in VS2012 Professional. I followed the steps to add OxyPlot to the VS designer toolbox but I get the following error when I add OxyPlot.WindowForms.dll:I created a WPF project in VS 2012 Express, and I can't see the OxyPlot in the toolbox either (installed through NuGet). I tried to add the OxyPlot.Wpf.dll like you did for the OxyPlot.WindowsForms.dll and I get the same error message (although for Wpf):
There are no components in 'xxx\OxyPlot.WindowsForms.dll' that can be placed on the toolbox.
John
"There are no components in '...\OxyPlot.Wpf.dll' that can be placed on the toolbox."
Have you found a solution to your problem?
Thanks.
Gimly wrote at 2013-09-27 13:56:
xmlns:oxy="http://oxyplot.codeplex.com"
And then you can simply put the plot wherever you want in your WPF control.<oxy:Plot>
</oxy:Plot>
If you're new to WPF, you'll see quickly that the designer is not really the way to create your interface, you shouldn't use it really and use the XAML editor instead.
Still can't seem to dislay anything in Metro , does anyone have it working in Metro
doctorj wrote at 2012-09-18 23:58:
Thank you for your response. That helped , I had to download the metro stuff again and I from the xaml file. I took the commands from it for oxy and inserted in my xaml file and these commands were recognized ok. However when I executed the code with my vb code , no graph came up. I was expecting to see at the axes of the graph. Do I need the other xaml files you have in the BasicSample directory also? I also noticed that the BasicSample directory did not have a Project file so I could execute the project - is it supposed to be like that? in my VB project I have a Visual Basic Project File that I click on to start the project. Is it possible that I am not executing the right oxy commands in my vb code. I am posting the code here again.
Dim plotControl As New OxyPlot.Metro.Plot
Dim plotModel1 As New OxyPlot.PlotModel
plotModel1.Title = "Outside"
plotModel1.Axes.Add(New LinearAxis(AxisPosition.Bottom, -20, 80))
plotModel1.Axes.Add(New LinearAxis(AxisPosition.Bottom, -10, 10))
plotControl.Model = plotModel1
plotModel1.RefreshPlot(True)
//xmlns:oxy="using:OxyPlot.Metro"
//<//oxy:Plot Model="{Binding PlotModel
code I put in my xaml file
//}"/>

how to run tests?
chronodekar wrote at 2012-07-13 08:12:
I just checked out the source-code and built, what I assume are the Oxyplot libraries.
There is a project called "Oxyplot.Tests", which I assume contains the unit tests for this project. What tool do I need to use to run them? Or rather, HOW do I even run the tests?
The code does not look like nUnit or xUnit stuff to me.
Puzzled,
chronodekar
objo wrote at 2012-07-13 09:35:
the *.Tests assemblies contain standard NUnit tests.
Note that some of the tests are asserting on images. I have not checked in the baseline of the plot bitmaps (*.png). The baseline is generated first time the tests are executed.
chronodekar wrote at 2012-07-13 12:35:
Ah, thank you for your reply! I opened the files "OxyAssert.cs" and "TestModels.cs" from the upper level in Visual Studio. There were no [Test] attributes or even [TestFixture] in them and I was wondering if I missed anything.
After reading your reply, I went digging a bit deeper and found Axes/AxisTests.cs which has something I'm familiar with. :)
I'm trying to understand the code base - at least at a very high level initially, before digging further. Any suggestions on where I should start?
-chronodekar
objo wrote at 2012-08-08 23:17:
To understand the code base, I would look at the PlotModel, LineSeries and LinearAxis classes (and ancestor classes). See the PlotModel.Render method, that's the 'main' method of the plots!
Служба підтримки клієнтів працює на UserEcho