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 8 months ago in Bugs • updated by yuyan 8 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 2 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 1 year ago in Bugs • updated 1 year 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.
0
karwi 2 weeks 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?



0
Phil Jollans 2 months ago in Bugs 0

I have configured a plot using XAML (using Plot not PlotView) with 6 LineAnnotations, which I want to show or hide optionally.


I have used Binding to connect the Visibility property of the LineAnnotations to properties in my ViewModel.


The properties are boolean and I have used a converter to convert the value to Visibility.Collapsed or Visibility.Visible (but I could just as well have defined a property with the type Visibility).


This doesn't work. The LineAnnotations are always visible.

In fact, I don't think that the Visibility property of a LineAnnotation works at all.


Is this is bug?

Is there a workaround?


Phil

0
stackFlow Over 2 months ago in Bugs 0

private void LoadData()

{

List<Points> measurements = Data.GetData(allPointsOfSelectedZone);//Now measurements contains all the points in the order displayed in ViewModel.cs Code of other tried sample written below
var dataPerDetector = measurements.GroupBy(m => m.DetectorId).OrderBy(m => m.Key).ToList();
foreach (var data in dataPerDetector)
{
var lineSerie = new LineSeries
{
StrokeThickness = 1,
MarkerSize = 1,
MarkerStroke = colors[0],
MarkerType = markerTypes[0],
CanTrackerInterpolatePoints = true,
Title = string.Format("Zone Selected :{0}", data.Key),
Smooth = false,
};
data.ToList().ForEach(d => lineSerie.Points.Add(new DataPoint(DateTimeAxis.ToDouble(d.Time), d.Tesnion)));
PlotModel.Series.Add(lineSerie);
}
lastUpdate = DateTime.Now;
}
0
giorgione91 2 months ago in Bugs 0

Hello to everyone! I developed a android app on Visual Studio with Xamarin. My app comunicate with a Arduino board and retrive me a html with a temperature value. The app running without problems both in debug mode than in release, but when I create the apk and install them on the phone the graph doesn't rapresent the double value of temperature on y axes. I try to cast to int the double values of temperature, but on the phone nothing change. Anyone Can help me?

0
Ss Oi 4 months ago in Bugs • updated by Milan 3 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
Sivarjun 5 months ago in Bugs 0


If you sum all percentage values it gives 101% but if you click and hold mouse left key on chart it shows actual value. how to show actual value insted of round of.



Thanks,

Sivarjun.