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
Amit Pawar 2 years ago in Bugs • updated by Oystein Bjorke 2 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
Yun 12 months ago in Bugs • updated by yuyan 12 months 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
Zoran Filipovic 3 years ago in Bugs • updated by Ganesh Jagdale 2 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
wiyosaya 2 years ago in Bugs • updated 2 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
Ss Oi 8 months ago in Bugs • updated by Milan 7 months ago 1

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
Lars 2 weeks 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.



0
Naveen Gogineni 1 month ago in Bugs • updated 4 weeks ago 0

I have a ListView with a binding template. And I have a list of PlotModels which I am using to bind to the list view.
And my PlotView is inside the template where I am binding the PlotModel to the PlotView.

Everything is running smooth in Android. But the problem is I am getting a error "PlotModel is already in use by some other PlotView control.".
when I am trying to run it on IOS.


//My content page
public MyConstructor()
{
List<MyChart> charts = new List<MyChart>();
charts.Add(new MyChart { PlotModel = PlotModel1 });
charts.Add(new MyChart { PlotModel = PlotModel2 });
charts.Add(new MyChart { PlotModel = PlotModel3 });
charts.Add(new MyChart { PlotModel = PlotModel4 });
ListView lvPlots = new ListView(ListViewCachingStrategy.RetainElement)
{
ItemsSource = charts,
ItemTemplate = new DataTemplate(typeof(NewDashboardSubCell)),
HasUnevenRows = true
};
Content = lvPlots;
}

public class MyChart
{
       public MyPlotModel PlotModel { get; set; }
}

//My View Cell
public class NewDashboardSubCell : ViewCell
{
        PlotView plotView;
        public NewDashboardSubCell()
        {
            try
            {
                plotView = new PlotView
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    IsVisible = true,
                    IsEnabled = true,
                    HeightRequest = App.ScreenHeight - 100,
                    WidthRequest = App.ScreenWidth - 40
                };

                plotView.SetBinding(PlotView.ModelProperty, "PlotModel");

                View = plotView;                
            }
            catch (Exception ex)
            {
            }
        }
}


0
mike 3 months ago in Bugs • updated 3 months ago 1

Hi, I'm experiencing a VERY bad performance with oxyplot graph, specifically, 3 LineSeries with over 2M points. I'm not drawing anything fancy, the background is with solid color with no images and no markers or anything like that. The graph cannot be even scrolled properly.

I wished I was aware to this performance hit before I implemented my whole project with this library... Is there some solution with how to deal with such issues? Is there a DX wrapper ready to boost the performance?


I would also like to know why after loading all the items(over 2M)when there is no activity(such as adding, panning, zooming) the application response is very slow? are there oxyplot updates that are happening in the background? Is there some way to "lock" the graphs?


Thanks, Mike

0
Philipp 3 months ago in Bugs 0

I am using oxyplot on a touch-panel computer.

If I use the mouse to pan along x-axis it is smooth. If I use my finger on a touch-panel it is not a smooth panning.

Is there a possibility to smoothen touch-panning?

Thanks a lot,

Philipp

0
karwi 4 months ago in Bugs 0

Hi,


I get my plot visible in the VS 2015 but not in the application in the debug mode. I can press RMB and see the "finger" icon shown when moving the plot area, however nothing is visible form the plot source. Any Ideas?