This is the discussion forum for OxyPlot.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!
+17
Under review

Real-time time-series plot

Amit Pawar 4 years ago in Bugs • updated by Oystein Bjorke 4 years ago 1
Hello World,

First of all thank you very much for such a great library.
I am using this to display static data of ECG and it works perfect for me.
Now I am trying to use this for real-time ECG monitor.

I am having some issue,
The graph need to refresh at interval of 250 ms.
Total points contains in the graph 1250.
When I am trying to add new point in the series and try to refresh the plotmodel, the system slows down.
Kindly guide me to achieve this functionality.


I request you to kindly add example in the example browser for Real-Time Time-Series plot.
Some similar examples are,
FLOT
SciChart
Visifire
+3

OxyPlot Xamarin.Android Dynamic Plot Performance

Yun 2 years ago in Bugs • updated by yuyan 2 years ago 1

Hi All,

I am using Xamarin.Android.OxyPlot to do dynamic data plot.

Here my questions is:


(1 )

When there are multi PlotViews on screen, there seems to be a “interference” between each other.Now the situation is : I have 4 plotviews on-screen, I create a invalidatePlot_new(Dirty Rect) method to draw partially for one plotview, picturing 1st plotView draw partially everytime, the other 3 call InvalidatePlot(true) by default(which will redraw entire view everytime). Why the 1st also redraw entire View also? It seems that 1st plotView is also following the others. It only draw partially when I set all 4 plotviews to call invalidatePlot_new(Dity Rect).


(2)

Second question is, I am fetching data at HIGH Frequency(2k Hz or more). I assume plotView could draw 20 times/sec with 100 plots every time. Well in fact it takes much longer to finish one plotView (60ms or more). I understand that a lot of Customized Canvas Draw happening which takes tons of CPU usage( 40% or more). So is there anyway I could decrease CPU usage, I’ve heard that using drawLines() instead of drawPath() will be more efficient. My goal is to limit each OnDraw() lower than 40ms( I can get 25 fps at least), also CPU usage lower than 30% since I will add more features based on this project.

Since not too many docs about Xamarin.Android.Oxyplot, so I hope this the right place I could get some help.

Of course, thanks for your great work, I really enjoy working with OxyPlot Library. Thanks ahead for you guys.

+3
Under review

TimeSpanAxis throwing FormatException

Zoran Filipovic 4 years ago in Bugs • updated by Ganesh Jagdale 4 years ago 3
Hi,
Clicking on the marker is throwing "FormatException".The problem occurs in the ExampleBrowser also. To reproduce the problem just open ExampleBrowser -> TimeSpanAxis example, click on any marker. 

Exception details:

System.FormatException was unhandled by user code
HResult=-2146233033
Message=Input string was not in a correct format.
Source=mscorlib
StackTrace:
at System.Globalization.TimeSpanFormat.FormatCustomized(TimeSpan value, String format, DateTimeFormatInfo dtfi)
at System.Globalization.TimeSpanFormat.Format(TimeSpan value, String format, IFormatProvider formatProvider)
at System.TimeSpan.ToString(String format, IFormatProvider formatProvider)
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at OxyPlot.StringHelper.Format(IFormatProvider provider, String formatString, Object item, Object[] values) in c:\projects\oxyplot\Source\OxyPlot\Utilities\StringHelper.cs:line 65
at OxyPlot.PlotElement.Format(String formatString, Object item, Object[] values) in c:\projects\oxyplot\Source\OxyPlot\PlotModel\PlotElement.cs:line 163
at OxyPlot.Series.DataPointSeries.GetNearestPoint(ScreenPoint point, Boolean interpolate) in c:\projects\oxyplot\Source\OxyPlot\Series\DataPointSeries.cs:line 109
at OxyPlot.Series.LineSeries.GetNearestPoint(ScreenPoint point, Boolean interpolate) in c:\projects\oxyplot\Source\OxyPlot\Series\LineSeries.cs:line 343
at OxyPlot.Series.Series.HitTestOverride(HitTestArguments args) in c:\projects\oxyplot\Source\OxyPlot\Series\Series.cs:line 141
at OxyPlot.UIElement.HitTest(HitTestArguments args) in c:\projects\oxyplot\Source\OxyPlot\Graphics\UIElement.cs:line 64
at OxyPlot.Model.<HitTest>d__0.MoveNext() in c:\projects\oxyplot\Source\OxyPlot\Graphics\Model.cs:line 72
at OxyPlot.Model.HandleMouseDown(Object sender, OxyMouseDownEventArgs e) in c:\projects\oxyplot\Source\OxyPlot\Graphics\Model.MouseEvents.cs:line 88
at OxyPlot.ControllerBase.HandleMouseDown(IView view, OxyMouseDownEventArgs args) in c:\projects\oxyplot\Source\OxyPlot\Graphics\ControllerBase.cs:line 82
at OxyPlot.Wpf.PlotView.OnMouseDown(MouseButtonEventArgs e) in c:\projects\oxyplot\Source\OxyPlot.Wpf\PlotView.cs:line 588
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
InnerException:

+2

LineSeries visibility in wpf Crash if not visible

wiyosaya 3 years ago in Bugs • updated 3 years ago 1
I'm using a LineSeries declared in xaml. I am binding an ObservableCollection<DataPoint> to the ItemsSource property. Because of my design, I would like to set the Visibility property on the LineSeries to Collapsed. Then, when I click on a control, I would like to set the Visibility property to Visible via a Style or Binding.

This is all certainly easy enough to do, however, I have found that if the Visibility property is set to Collapsed, datapoints are added to the observable collection, then the Visibility property is set to Visible, a null reference exception is thrown from LineSeries.Render where the code tests actualPoints.Count. It would appear that adding points to a bound observable collection when the LineSeries is not visible, and then changing visibility does not properly update the internal data point collection.

If, however, the visibility property is set to Visible when the observable collection is changed, I can then set the visibility property to anything I want, and all works fine.

Is this a bug?

I can work around this by setting some sort of "AllSeriesInitialized" flag, that keeps all of the series visible until they are all initialized, but it seems that the currently exhibited behavior is not ideal, IMHO.

Thanks.
+1

Oxyplot's performance boost via SharpDX not visible?

Ss Oi 2 years ago in Bugs • updated by ShannonZ 1 year ago 2

Hi, what I did was to start two VS2015 projects, prepare the libraries ready using sources of master in GitHub, then add PlotView for each project seprately from Oxyplot SharpDX Wpf and Oxyplot Wpf. At last I used the same data for each of plots.


this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 0,  100, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 0,  100, 0.1, "sin(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 50, 150, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 50, 150, 0.1, "sin(x)"));this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 0, 100, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 0, 100, 0.1, "sin(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 50, 150, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 50, 150, 0.1, "sin(x)"));this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 0, 100, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 0, 100, 0.1, "sin(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 50, 150, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 50, 150, 0.1, "sin(x)"));this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 0, 100, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 0, 100, 0.1, "sin(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 50, 150, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 50, 150, 0.1, "sin(x)"));this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 0, 100, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 0, 100, 0.1, "sin(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Cos, 50, 150, 0.1, "cos(x)"));
this.PlotModel.Series.Add(new FunctionSeries(Math.Sin, 50, 150, 0.1, "sin(x)"));

To my surprise, there is actually no performance gain at all (see. http://discussion.oxyplot.org/topics/733-direct3d-10-renderer-fork-of-oxyplot-ive-done-it/). Draging the axes is in both programs very slow approx. ~1 fps, or better to say with SharpDX.wpf there are more wrong behaviors, eg. parts of lines that out of axes are still to see, and edges of axes with SharpDX are not fully filled than in normal Oxyplot.


So can someone advise me what did I do wrong or miss?


Thank you indeed.




0

Xamarin Android crashes when plotview is touched

scotshealey 5 months ago in Bugs • updated 5 months ago 0

I have a plotview model using lineseries. I have an issue, while the plotview is updating if I touch the plot, I get an unhandled exception. I have set the axis IsPanEnabled and IsZoomEnabled to false. I have set the view clickable and enabled to false. 


How do I disable touching of the plotview?

0

svg export special characters

peterparker 9 months ago in Bugs • updated 9 months ago 1

Hi,


I want to create axis label with special (german) character and export it as svg

the Title of the axis should be "Länge [m]"

I tried:

plotModel.Axes.Add(new LinearAxis
            {
                IsZoomEnabled = false,
                IsPanEnabled = false,
                Title = "Länge [m]",
                Position = AxisPosition.Bottom,
                MajorGridlineStyle = LineStyle.Solid,
                Minimum = auswertungX.Min,
                Maximum = auswertungX.Max
            });

this will result in <text>L&#228;nge [m]</text>



with HTML syntax:

"Länge [m]"

it will result in <text>L&auml;nge [m]</text>


and with no special syntag:

"Länge [m]"

it will result in <text>L??nge [m]</text>

0

Plotting minutes on datetime axis

Maddog56 10 months ago in Bugs 0

I have seen a few discussions of the following issue, so I'm asking about it again.. I am plotting a data point every 5 minutes using the datetime axis and the labels on the axis say 04:49, 09:59, etc. Basically every time being a second short of 05:00, 10:00 etc.  Sometimes it has been 05:01, 10:01 etc. Has there been an authoritative conclusion and possible fix or remedy for such behavior?

0

Plot in UWP (Raspberry Pi 3 ) cuts off y axis

Markus Sanna 1 year ago in Bugs 0

Dear all,


I want to raise one question about a line series in UWP , Raspberry Pi 3,  which is cut off at the y axis at 350 and the x axis begins at ~120. Do you have any idea about the reasons?


Thanks in advance,


Markus



0

OxyPlot Lineseries doesnt draw first 50 points

Lars 2 years ago in Bugs 0

Hi! I draw a simple LineSeries with 480 data points in Oxyplot. But for some reason the first 50 points are not drawn but can be marked.

I am using Visual Studio 2017 Windows 10 universal app.


Also when i zoom in or out and move the curve with mouse buttons. The curve is drawn anywhere in the app not only in the Oxyplot box.