tag:userecho.com,2024-03-19:/feeds/topics/en//OxyPlot2023-12-07T20:15:12+00:00tag:oxyplot.userecho.com,2023-12-07:/communities/1/topics/390-is-it-possible-to-draw-spectrogram-with-oxyplot/2023-12-07T20:15:12+00:002023-12-07T20:15:12+00:00Is it possible to draw spectrogram with OxyPlot ? [questions] [under review]Drawing spectrogram.<br/><br/> Steve Weavers replied:<br/><p>Its easier to use a WriteableBitmap and just do it yourself.</p>Daniel Danielhttps://oxyplot.userecho.com/users/58-daniel-daniel/topics/tag:oxyplot.userecho.com,2023-04-19:/communities/1/topics/1127-limit-zoom-to-axis-only/2023-04-19T16:55:01+00:002023-04-19T16:55:01+00:00Limit zoom to axis only [questions] <p>Hi.</p><p>Is there a way to limit zooming/panning in the vertical direction to the axes area only? When the user pans or zooms with the mouse's wheel, only the horizontal axes should zoom/pan, but yet, users should be able to pan/zoom from the vertical axes</p><br/><br/>suggested by: M BM Bhttps://oxyplot.userecho.com/users/701-m-b/topics/tag:oxyplot.userecho.com,2023-04-14:/communities/1/topics/1126-why-has-oxyplot-development-stopped/2023-04-14T12:46:25+00:002023-04-14T12:46:25+00:00(Why) Has Oxyplot development stopped [questions] <p>As far as I can tell OxyPlot development has stopped.</p><p>I've been using it a lot for 3+ year and love it - I can't understand why its not more popular and thus in active development/support. </p><br/><br/>suggested by: oxyplotoxyplothttps://oxyplot.userecho.com/users/700-oxyplot/topics/tag:oxyplot.userecho.com,2022-11-22:/communities/1/topics/1125-how-get-a-specific-oxycolor-from-a-palette-example-get-the-12th-color-frome-oxypalettesjet255/2022-11-22T17:00:33+00:002022-11-22T17:00:33+00:00how get a specific oxycolor from a palette (example get the 12th color frome OxyPalettes.Jet(255)) [questions] <br/><br/>suggested by: MauriceMauricehttps://oxyplot.userecho.com/users/699-maurice/topics/tag:oxyplot.userecho.com,2022-04-14:/communities/1/topics/705-axismousedown-area-property/2022-04-14T19:06:04+00:002022-04-14T19:06:04+00:00Axis.MouseDown / Area Property [bugs] <p>Hello,</p><p>I have tried to add a Event Handler for the Axis.MouseDown Event, but it doesn't get called! </p><p> </p><p> FrequencyAxis.MouseDown += (s, e) => {</p><p style="margin-left: 20px;"> IsFrequencyAxisFixed = !IsFrequencyAxisFixed;</p><p> };</p><p> </p><p> </p><p>Also, would it be possible to add a Area property to the Axis? (Like the PlotModel.LegendArea or PlotModel.PlotArea)</p><br/><br/> Mark Bean replied:<br/><p>Yes, though I haven't looked at it in 6 years. It might take me a few days to retrieve. beanmf@gmail.com if that time frame works for you. We used Oxyplot as a graphing control for liquid chromatography and mass spectrometry. The code is not proprietary.</p>alexhttps://oxyplot.userecho.com/users/194-alex/topics/tag:oxyplot.userecho.com,2022-03-17:/communities/1/topics/1124-plotview-does-not-change-height-with-property-change/2022-03-17T09:56:24+00:002022-03-17T09:56:24+00:00PlotView does not change height with property change [bugs] <p>Hello,<br>I have a PlotView that has the height binds to the property ModelHeight in the view model. The problem is that it does not update after the property change. It only updates when starting up the plotview (the plot view is rendered for the first time) I try PlotModel.InvalidatePlot but it does not work. Seems like the height is fix. <br>Does anyone know how to fix this issue?</p><br/><br/>suggested by: TrangTranghttps://oxyplot.userecho.com/users/694-trang/topics/tag:oxyplot.userecho.com,2022-03-11:/communities/1/topics/1123-plotview-callbacks/2022-03-11T21:37:28+00:002022-03-11T21:37:28+00:00PlotView callbacks [ideas] <p>If a PlotView is converted to an image, how can I tell where in the image pixel rows particular grid lines are? Want to line up multiple views vertically. Thanks.</p><br/><br/>suggested by: Mike R.Mike R.https://oxyplot.userecho.com/users/693-mike-r/topics/tag:oxyplot.userecho.com,2021-06-16:/communities/1/topics/1122-how-to-draw-areaseries-with-all-of-points-in-lineseries-with-y-50/2021-06-16T04:01:18+00:002021-06-16T04:01:18+00:00How to draw AreaSeries with all of points in lineseries with Y > 50 [questions] <p>I want to draw AreaSeries with all of points in Lineseries with Y > 50. But I got the result like image below.<br>I just want to draw AreaSeries in red rectangle area. </p><p><img src="/s/attachments/13970/1/692/1ddaac86fb99eeefff83ef9fa99a5307.png"></p><p>var areaSeries = new AreaSeries()<br> {<br> StrokeThickness = 2,<br> LineStyle = OxyPlot.LineStyle.Solid,<br> Color = OxyColors.Transparent,<br> Color2 = OxyColors.Transparent,<br> Fill = OxyColors.Green,<br> DataFieldX2 = "X",<br> ConstantY2 = 50,<br> <br> };<br><br> // Fill series with initial values<br> foreach (var point in seriesLumen.Points)<br> {<br> if (point.Y >= 50)<br> {<br> areaSeries.Points.Add(point);<br> }<br> }<br><br> tmp.Series.Add(areaSeries);</p><p></p><p></p><br/><br/>suggested by: Tin TruongTin Truonghttps://oxyplot.userecho.com/users/692-tin-truong/topics/tag:oxyplot.userecho.com,2021-01-17:/communities/1/topics/43-wpf-lineseries-not-refreshing/2021-01-17T18:02:59+00:002021-01-17T18:02:59+00:00WPF LineSeries not refreshing [questions] <div><strong>This discussion was imported from <a href="http://oxyplot.codeplex.com/discussions/540115">CodePlex</a></strong></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/NinjaTuna">NinjaTuna</a></strong> wrote at 2014-03-25 19:18:</p><div>I am trying to use OxyPlot for real-time data plotting, but so far I've wasted a couple of hours without result. When I create a plot in XAML and add a LineSeries with ItemsSource binding, nothing happens when the binding source is updated (PropertyChanged eventhandlers and stuff are set-up correctly). Even calling RefreshPlot(true), which even seems to be unavailable in newer releases (240 has it, 261 does not), does not help.<br>The only time I actually see my data plotted is when I go zooming around the plot, the data is then updated at every zoom action (middle mouse drag).<br><br>To rule out compatibility errors, I created a small testing project.<br>MainWindow.xaml:<br><pre><code><Window x:Class="OxyPlotTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:oxy="http://oxyplot.codeplex.com" Title="MainWindow" Height="350" Width="525" MouseDown="Window_MouseDown"> <Grid> <oxy:Plot Name="Plot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <oxy:Plot.Axes> <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="10"/> <oxy:LinearAxis Position="Left" Minimum="-50" Maximum="50"/> </oxy:Plot.Axes> <oxy:Plot.Series> <oxy:LineSeries ItemsSource="{Binding PlotData}"/> </oxy:Plot.Series> </oxy:Plot> </Grid></Window></code></pre>MainWindow.xaml.cs<br><pre><code>public partial class MainWindow : Window, INotifyPropertyChanged { public MainWindow() { InitializeComponent(); this.DataContext = this; PlotData = new ObservableCollection<DataPoint>(); } private ObservableCollection<DataPoint> _plotData = new ObservableCollection<DataPoint>(); public ObservableCollection<DataPoint> PlotData { get { return _plotData; } set { _plotData = value; OnPropertyChanged("PlotData"); } } int x = 0; private void Window_MouseDown(object sender, MouseButtonEventArgs e) {//create random datapoint on mouseclick Random r = new Random(); int y = r.Next(-50, 50); PlotData.Add(new DataPoint(x,y)); x++; } #region binding stuff public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string name) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(name)); } } #endregion }</code></pre>The above code (with version 261) also does not work, a graph is only drawn when zooming. Not automatically.<br><br>I hope someone can help me, the problem is absolutely driving me mad, partly because I have seen this working in a fellow student's project.<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2014-03-25 20:56:</p><div><ol><li>OxyPlot is handling most mouse button events by default. Set a breakpoint in the event handler you created and you will see it is not being called. Try to press "shift+ctrl" and the left mouse button. This combination is not handled by OxyPlot and your event handler should be called. I think you have at least two alternatives to solve this:<ol><li>Use the <code>PreviewMouseDown</code> event instead. </li><li>Unbind the left mouse button down gesture in the plot controller. This can be done by<code>Plot.ActualController.Unbind(PlotCommands.SnapTrack);</code> or <code>Plot.ActualController.Unbind(OxyMouseButton.Left);</code> (new extension method I just added)</li></ol></li><li>OxyPlot is not observing collection changes, so you need to call <code>Plot.InvalidatePlot()</code> after you have added the point to the collection.</li></ol></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/NinjaTuna">NinjaTuna</a></strong> wrote at 2014-03-25 22:54:</p><div>Thanks for your response! <br><br>The event-handler definitely was being called, when you click at the edge of the window, it will fire. Also, this is specific to my test set-up, in the actual project the binding source is updated by a DispatcherTimer.<br><br>I see copying the list, then adding the new datapoint to it and finally reassigning it to the binding source<em>does</em> update the graph like it should and so does Plot.InvalidatePlot(). However, it does not work in my original project with the DispatcherTimer, do you think the timer itself has something to do with the inability to update the plot (being on a another thread or something like that)?<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/NinjaTuna">NinjaTuna</a></strong> wrote at 2014-03-25 23:43:</p><div>Okay, I got this working in one specific way, the DispatcherTimer seems not to be the culprit. When I have this:<br><pre><code>private List<DataPoint> _yPoints; public List<DataPoint> YPoints { get { return _yPoints; } set { _yPoints = value; RaisePropertyChanged("YPoints"); //OnPropertyChanged wrapper } }</code></pre>I need to reassign YPoints completely with a new list, after adding a point as follows:<br><pre><code>YPoints.Add(new DataPoint(x, y);YPoints = new List<DataPoint>(YPoints);</code></pre>If I don't perform the copy, no update, if I manually call RaisePropertyChanged("YPoints"), no update, if I call InvalidatePlot(true) on the plot, no update. Am I making sense here? Can you explain why it only works when I copy the data to a completely new list? It seems a rather inefficient way to handle data...<br></div></div><br/><br/> Ed Walker replied:<br/><p>@NinjaTuna, did you manage to find any alternate solutions? I had the exact same problem initiating the data update in a way that results in a chart update. Like you, it worked for me when I re-instantiate the YPoints List with:</p><pre><code>= new List<DataPoint>(YPoints);</code></pre><p>but I agree this doesn't seem the most elegant way to do it...</p>Oystein Bjorkehttps://oxyplot.userecho.com/users/2-oystein-bjorke/topics/tag:oxyplot.userecho.com,2020-11-10:/communities/1/topics/1059-is-it-possible-to-hide-completely-axis-labelsvalues-but-not-tick-marksgridlines/2020-11-10T13:16:51+00:002020-11-10T13:16:51+00:00Is it possible to hide completely Axis labels/values but not Tick Marks/Gridlines? [questions] <p>I tried setting the FontSize to 0 but it crashes, and didnt found any other way to just hide the labels?</p><br/><br/> Matt replied:<br/><p>Unfortunately the solution above didn't work for me. </p><p></p><p>However <strong>LabelFormatter = x => null</strong> did make an improvement.</p>Smokehttps://oxyplot.userecho.com/users/594-smoke/topics/tag:oxyplot.userecho.com,2020-06-26:/communities/1/topics/1120-does-oxyplot-area-series-can-be-filled-with-gradient-color/2020-06-26T02:38:20+00:002020-06-26T02:38:20+00:00Does Oxyplot area series can be filled with gradient color [questions] <p><img src="/s/attachments/13970/1/686/b29b11029d7199ca7ded72f04d3d9603.png">Does Anyone suggest any other chart view to achieve below graph</p><br/><br/>suggested by: pavani tatikondapavani tatikondahttps://oxyplot.userecho.com/users/686-pavani-tatikonda/topics/tag:oxyplot.userecho.com,2020-03-20:/communities/1/topics/1119-stringformat-of-timespanaxis/2020-03-20T16:57:45+00:002020-03-20T16:57:45+00:00StringFormat of TimeSpanAxis [ideas] <p>What is the format of the StringFormat to give to TimeSpanAxis?</p><p>Thanks</p><p></p><br/><br/>suggested by: BeorneBeornehttps://oxyplot.userecho.com/users/683-beorne/topics/tag:oxyplot.userecho.com,2019-12-09:/communities/1/topics/415-rotate-title-of-a-linearaxis/2019-12-09T18:33:18+00:002019-12-09T18:33:18+00:00Rotate title of a LinearAxis [questions] <div><strong>This discussion was imported from <a href="http://oxyplot.codeplex.com/discussions/392600">CodePlex</a></strong></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/mreu">mreu</a></strong> wrote at 2012-08-22 14:15:</p><p>Hi</p><p>I am really new to your great OxyPlot.</p><p>I have a plot with more than one horizontal axes. Some of them are very small and the titles on the left side are clipped. How can I rotate the titles so that they are horizontal and not vertikal? I did not found how to do this.</p><p>Thanks</p><p>Michael</p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2012-08-23 08:41:</p><p>Try the "Angle" property.</p><p>Note, there is an un-solved issue <a href="http://oxyplot.codeplex.com/workitem/9594" rel="nofollow">http://oxyplot.codeplex.com/workitem/9594</a>-</p><p>For vertical axes, I would also like to implement <a href="http://oxyplot.codeplex.com/workitem/9972" rel="nofollow">http://oxyplot.codeplex.com/workitem/9972</a>.</p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/mreu">mreu</a></strong> wrote at 2012-08-23 09:56:</p><p>Hi objo</p><p>Thanks for the quick answer, but "Angle" rotate the labels of the ticks not the title or do I miss something?</p><p>Thanks</p><p>Michael</p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2012-08-23 15:41:</p><p>Right, "Angle" rotates the labels of the ticks. Rotation of the titles is not yet implemented.</p><p>Do you want to rotate the titles of the horizontal (X) axes?</p><p>For vertical axes, the following feature is planned <a href="http://oxyplot.codeplex.com/workitem/9972" rel="nofollow">http://oxyplot.codeplex.com/workitem/9972</a><span>.</span></p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/mreu">mreu</a></strong> wrote at 2012-08-23 15:55:</p><p>Ho objo</p><p>yes, I need to rotate the titles on the left/right side. I have 9 LinearAxes (which are shown from left to right), some of them only show if it was activated or not. So I need the titles horizontal because they are truncated now.</p><p>Thanks</p><p>Michael</p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2012-08-24 09:16:</p><p>ok, I added <a href="http://oxyplot.codeplex.com/workitem/9994" rel="nofollow">http://oxyplot.codeplex.com/workitem/9994</a></p></div><br/><br/> Che replied:<br/><p>Did any of these changes get implemented? </p><p>I looking for a way to more accurately specify the position and rotation of the axis title.</p><p>For vertical axes I'd like to be able to write the title above the labels and in horizontal orientation.</p><p>For horizontal axes I'd like to write the title at the same height as the labels.</p><p></p><p>Thank you</p>Oystein Bjorkehttps://oxyplot.userecho.com/users/2-oystein-bjorke/topics/tag:oxyplot.userecho.com,2019-12-04:/communities/1/topics/1118-how-to-display-all-axes-in-positive-number/2019-12-04T10:28:20+00:002019-12-04T10:28:20+00:00How to Display All axes in positive number [ideas] <p>Hi All,</p><p></p><p><br>I implemented this diagram with Oxyplot and WPF.<br><br></p><p><img src="/s/attachments/13970/1/679/bd45598bfa0afe2f905ac28fa625c2a8.png"></p><p><br><br>How can you make the 4 axes positive?<br> is there an idea?<br><br>Many thanks to</p><p><br>Many thanks</p><p></p><p></p><br/><br/>suggested by: CheChehttps://oxyplot.userecho.com/users/679-che/topics/tag:oxyplot.userecho.com,2019-11-26:/communities/1/topics/1117-drag-points-up-or-down-in-a-line-series/2019-11-26T06:45:05+00:002019-11-26T06:45:05+00:00Drag points up or down in a line series [questions] <p>Hi Team,</p><p>I want to drag or move the points up/down to new position in a lineseries.</p><p></p><p>kindly do the needful on this</p><br/><br/>suggested by: venky6189venky6189https://oxyplot.userecho.com/users/402-venky6189/topics/tag:oxyplot.userecho.com,2019-11-22:/communities/1/topics/950-very-bad-performance-of-oxyplot-lineseries-with-over-2m-in-one-plotwpf/2019-11-22T08:43:33+00:002019-11-22T08:43:33+00:00VERY bad performance of OxyPlot LineSeries with over 2M in one plot(WPF) [questions] <p>Hi, I'm experiencing a VERY bad performance with oxyplot graph, specifically, 3 <span>LineSeries</span> 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. </p><p>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?</p><p><br></p><p>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?</p><p><br></p><p>Thanks, Mike</p><br/><br/> Gowin replied:<br/><p>I try the gdi and gdi+ mixing way</p>mikehttps://oxyplot.userecho.com/users/52-mike/topics/tag:oxyplot.userecho.com,2019-11-20:/communities/1/topics/1116-how-to-move-the-line-series-points-in-vertical-direction-only/2019-11-20T15:32:04+00:002019-11-20T15:32:04+00:00How to move the line series points in vertical direction only [questions] <h1><br></h1><p>Hi team,</p><p></p><p>I am using Oxyplot.wpf . I want to move the lineseries points by selecting single point in vertical direction only.<br></p><p>something similar to gamma curve. First and last point of lineseries points will be permanent(not movable).</p><p>and will be linear section at low end. </p><p>.</p><p></p><br/><br/>suggested by: Venky .BanlaVenky .Banlahttps://oxyplot.userecho.com/users/676-venky-banla/topics/tag:oxyplot.userecho.com,2019-10-29:/communities/1/topics/1114-poor-rendering-performance-with-linearaxis-and-lineseries-with-72k-datapoints/2019-10-29T15:08:52+00:002019-10-29T15:08:52+00:00Poor Rendering Performance with LinearAxis and LineSeries with 72k DataPoints [questions] <p>Hi,</p><p></p><p>i have a LineSeries with 72k Datapoints, Rendering time is about 20sec.</p><p>Is this normal? How can i speed up the rendering.</p><p></p><p>I am using LinearAxis for X and Y axis, LineSeries is bound to IEnumerable of OxyPlot DataPoints.</p><br/><br/> loiti replied:<br/><p>I am using the newest OxyPlot WPF components...</p>loitihttps://oxyplot.userecho.com/users/673-loiti/topics/tag:oxyplot.userecho.com,2019-09-24:/communities/1/topics/920-how-do-i-display-multiple-series-label-for-the-shared-axis/2019-09-24T23:56:38+00:002019-09-24T23:56:38+00:00How do I display multiple series label for the shared axis? [questions] <p>How do I display multiple series label for the same shared/linked axis? In my conversion, I am trying to emulate something like the picture below. <img src="/s/attachments/13970/1/0/a06dc2844e88174a6960915cec93ac0b.png"></p><p>I am new at this and looking at the position tier example, but can't figure it out. Many Thanks.</p><br/><br/> Richard DeVenezia replied:<br/><p>The series property <code>XAxisKey</code> and <code>YAxisKey</code> will match up to the axes with the corresponding <code>Key</code>.</p><pre> fluidSeries.YAxisKey = "Cubic meters per day"; oilSeries.YAxisKey = "Cubic meters per day"; waterSeries.YAxisKey = "Cubic meters per day"; yaxis1.Key = "Cubic meters per day"; TotalGasSeries.YAxisKey = "Cubic K-meters"; GasRateSeries.YAxisKey = "Cubic K-meters"; yaxis2.Key = "Cubic K-meters"; </pre>Johnhttps://oxyplot.userecho.com/users/304-john/topics/tag:oxyplot.userecho.com,2019-09-10:/communities/1/topics/1079-bad-ui-response-when-the-rendering-points-is-too-big/2019-09-10T10:27:20+00:002019-09-10T10:27:20+00:00Bad UI response when the rendering points is too big [questions] <p></p>I am using winform version. If the points is about 1M points, When I try to RectangleZoom the rendered model, the ui performances is relatively too worse for users.When I drag the model, the rectangle barely shows in a few seconds.The zoom rectangle should be shown in a much faster speed.How to improve the response speed, when the points to render is bigger than 1M points.<br/><br/> Gowin replied:<br/><p>It seems it can not be solved if using gdi+. Now I try to use opentk or dx9. </p>Gowinhttps://oxyplot.userecho.com/users/635-gowin/topics/tag:oxyplot.userecho.com,2019-08-30:/communities/1/topics/954-1-area-series-with-2-colors-based-on-limit/2019-08-30T08:40:21+00:002019-08-30T08:40:21+00:001 Area Series with 2 Colors based on limit [questions] <p>I've looked for a bit, but I couldn't find anything quite like this. I know TwoColorAreaSeries is quite similar, Is there currently a way to do something like this?:</p><p><br></p><p><img src="/s/attachments/13970/1/0/459fd0748bddf7d40f7835e7ccc6b8b1.png"><br></p><p><br></p><p>So when it's above/below the limit, the fill color is different, but the color still fills all the way to the bottom. </p><br/><br/> fashr replied:<br/><p>I am also looking for a similar thing and cannot find it. I need vertical and horizontal cursor lines that can be repositioned along the graphed line. I also need the way to color the erea behind those cursor lines(not just a graph line but from cursor to the end/begining of the plot). Can anyone sugest a hack how to do this. Sort of like this:</p><p><img src="/s/attachments/13970/1/638/a0215f924dde8027905ddf842366950a.png"></p>Justin Liuhttps://oxyplot.userecho.com/users/396-justin-liu/topics/tag:oxyplot.userecho.com,2019-08-13:/communities/1/topics/1080-how-to-add-xaxis-of-candlestickseries/2019-08-13T07:10:07+00:002019-08-13T07:10:07+00:00How to Add XAxis of CandleStickSeries? [questions] <p>I Want know this Topic...</p><p>ps : Now, my Current XAxis is showing default date (ex : 1899.09.01 ... etc)</p><br/><br/>suggested by: Song Jae KwangSong Jae Kwanghttps://oxyplot.userecho.com/users/636-song-jae-kwang/topics/tag:oxyplot.userecho.com,2019-08-12:/communities/1/topics/1005-how-to-reset-zoom/2019-08-12T10:39:15+00:002019-08-12T10:39:15+00:00How to reset zoom [questions] <p>I have an oxyplot RectangleBarSeries and a button "Reset". When I press the button I want the zoom to reset (in the same way the zoom resets when A is pressed on the keyboard). I've tried the ResetAllAxes(); function, but it doesn't work. Is there any other way to achieve this? </p><br/><br/> Gowin replied:<br/><p>Have you solved the probelm? In fact, the oxyplot have realized the function. In the oxyplot namespace, it has defined plotcontroller bindings. In other words, without the need to click the button ,the reset function can be realized by mouse operations ,such as double click the middle mouse button.</p>helpmehttps://oxyplot.userecho.com/users/457-helpme/topics/tag:oxyplot.userecho.com,2019-07-05:/communities/1/topics/1078-tracker-vertical-line-thickness-in-wpf/2019-07-05T07:25:55+00:002019-07-05T07:25:55+00:00Tracker vertical line thickness in WPF [questions] <p>Is there any possibility to change trackers vertical line thickness. I found only color setting.</p><br/><br/>suggested by: IgorsIgorshttps://oxyplot.userecho.com/users/633-igors/topics/tag:oxyplot.userecho.com,2019-05-15:/communities/1/topics/78-thread-safety-and-renderpoints/2019-05-15T01:34:55+00:002019-05-15T01:34:55+00:00Thread safety and RenderPoints [ideas] [under review]So I've seen the error a few times, mainly when the plot is trying to update and data is being added to the series:<br><br>> System.InvalidOperationException occurred<br>> HResult=-2146233079<br>> Message=Collection was modified; enumeration operation may not execute.<br>> Source=mscorlib<br>> StackTrace:<br>> at System.Collections.Generic.List`1.Enumerator.MoveNextRare()<br><br>Seems to be because ICollection is being used here:<br><a href="https://github.com/oxyplot/oxyplot/blob/develop/Source/OxyPlot/Series/LineSeries.cs#L480">https://github.com/oxyplot/oxyplot/blob/develop/So...</a><br>Would it be better to use one of the concurrent collects for this?<br><br/><br/> Joshua replied:<br/><p>Ah. I missed setting selectable to false for series.</p><p></p><p>Doing this </p><p></p><pre>foreach (var s in plotView.Model.Series)<br>{<br> s.Selectable = false;<br>}</pre><p>Also resolved the issue.</p>Nick Donaishttps://oxyplot.userecho.com/users/4-nick-donais/topics/tag:oxyplot.userecho.com,2019-04-16:/communities/1/topics/997-negative-axis-step/2019-04-16T15:29:19+00:002019-04-16T15:29:19+00:00negative axis step [ideas] <p>I have been looking for a way to invert an axis (smallest value in the top, largest in the bottom).</p><p><br></p><p>Example:<br></p><p>LinearAxis la = new LinearAxis()<br> {<br> AbsoluteMaximum = 10,<br> AbsoluteMinimum = 1, MinimumMajorStep = -1, IntervalLength = -1, MajorStep = -1<br> };</p><p><br></p><p>Oxyplot fails if max < min or step is less than 0 (exception).</p><p><br></p><p>It would be nice if this was possible</p><br/><br/> Peter replied:<br/><p>I have the same problem for FTIR spectra were the usual display is decreasing wavenumbers from left to right.<br><br>model.Axes.ElementAt(0).Minimun = 12.400<br>model.Axes.ElementAt(0).Maximum = 3.800</p>Gswordhttps://oxyplot.userecho.com/users/447-gsword/topics/tag:oxyplot.userecho.com,2019-03-22:/communities/1/topics/1076-circular-heat-map/2019-03-22T16:14:38+00:002019-03-22T16:14:38+00:00Circular heat map [questions] <p>Hello. Is it possible to create such plot using OxyPlot ?</p><p></p><img src="/s/attachments/13970/1/0/d72c47e74c416bf370e8487fe76ed72c.png"><p></p><p>I assume this is some modification of HeatMapSeries. If possible, could you please provide me with some code example?</p><br/><br/>suggested by: SiedexSiedexhttps://oxyplot.userecho.com/users/622-siedex/topics/tag:oxyplot.userecho.com,2019-03-11:/communities/1/topics/863-how-to-implement-a-pointcloudseries-for-large-static-point-cloud-data/2019-03-11T06:58:35+00:002019-03-11T06:58:35+00:00How to Implement a PointCloudSeries for Large, Static Point Cloud Data [questions] <p>First off, Oxyplot is an amazing project - open source, high quality, MIT, tons of samples, even documentation :-) It covers many interesting use cases for me, but I hit one particular problem:</p><p><br></p><p>In WPF the pan/zoom performance is bad on large data sets (e.g. ScatterSeries with 100000 points). This is expected, of course, because of the rich interactiveness a ScatterSeries provides; no criticism. I experimented with various settings, also checking the performance guidelines (ScatterSeries, MarkerType=crosses seems to be best currently), but the result was not sufficient.</p><p><br></p><p><strong>Use Case</strong><br></p><p>In the following screenshot you see </p><ol><li>White dots: about 90000 points from a laser scan</li><li>Various line drawings on top</li></ol><img src="/s/attachments/13970/1/0/90380157ca896cf269fe2e746af983ac.png"><p><br></p><p><strong>Goal</strong></p><div><span><p><span>Implement a high performance oxyplot "Series" for large point clouds.</span></p><ul><li>The point cloud is static, initial loading time is less relevant</li><li>A data point has x, y, color (or at least grayscale)</li><li>The user can pan and zoom to investigate different areas - fast.</li><li>Not sure about the tracker, yet.</li></ul><p><strong>Question</strong></p><p>What's the best way to achieve this? Looking at the samples, I found that PolarHeatMapSeries has an image-based rendering mode, which allows for fast pan/zoom. There were some image annotations, too. Any directions are welcome. I'm willing to contribute, if it works out well.</p></span></div><br/><br/> Patrick Stalph replied:<br/><p>Oh, and obviously this is a quite specialized solution for WPF. OxyPlot is a very generic library and has amazing support for different platforms. Of course, this comes with a performance penalty because it is difficult to map all drawing operations to appropriate architecture-specific methods. This was the other reason, why I didn't try to get this into a PR.</p>Patrick Stalphhttps://oxyplot.userecho.com/users/216-patrick-stalph/topics/tag:oxyplot.userecho.com,2019-01-15:/communities/1/topics/1075-is-net-core-supported-and-what-version/2019-01-15T13:40:55+00:002019-01-15T13:40:55+00:00Is .net core supported, and what version? [questions] <br/><br/>suggested by: ben1628ben1628https://oxyplot.userecho.com/users/620-ben1628/topics/tag:oxyplot.userecho.com,2018-11-18:/communities/1/topics/1071-scatter-plot-point-color/2018-11-18T15:51:56+00:002018-11-18T15:51:56+00:00Scatter plot point color [questions] <p>Hi all</p><p></p><p>I've have a WinForms application that I developed a while ago that uses Microsoft's Chart control.</p><p>Now I would like to move this application to WPF and found oxyplot, which seems to be all I need except for one thing.</p><p></p><p>I reallize that my usecase is a bit special, but here goes:</p><p>In my app, the user starts off with an empty chart (scatter plot). He adds points to an ObservableCollection by clicking anywhere on the chart. Clicking the point again, he can change some state of that point, right clicking removes it again.</p><p>Once he is complete, he can start a process that will do some stuff with each of the points, depending on where they are defined. So far so good.</p><p></p><p>Now to the problem:</p><p>In the old application, the state of the point (e.g. processed / unprocessed) is represented by a different image, so it's easily visible on the chart which point is in which state.</p><p>And here is my problem with oxyplot. I do not seem to be able to define a seperate point color based on a state. It seems to always take the color of the series.</p><p><br></p><p>What I have tried:</p><p>In my ViewModel, I've defined a couple CollectionViews, which filter points based on the state. This gives a proper result. But if I add a new Series in oxyplot using the CollectionView as an ItemSource, I only see the points of the last CollectionView that was added.</p><p>Code example:<br></p><p>public ICollectionView BasePoints { get; private set; }</p><p>public ICollectionView ModelPoints { get; private set; }</p><p> BasePoints = CollectionViewSource.GetDefaultView(ModelPointManager.GetInstance().PointList);</p><p>ModelPoints = CollectionViewSource.GetDefaultView(ModelPointManager.GetInstance().PointList);<br><br></p><p>PlotModel.Series.Add(new ScatterSeries(ModelPoints));<br> PlotModel.Series.Add(new ScatterSeries(BasePoints)); <---- only these points show up</p><p></p><p>However, if, instead of using collection views, I use "decoupled" collections (like sepereate ObservableCollections), they both show up.</p><p><br></p><p>I've also tried to create my own ScatterSeries based on the one from OxyPlot, and then to override the ActualMarkerFillColor property that I found in the source code:</p><p>public new OxyColor ActualMarkerFillColor {<br> get { return OxyColor.Parse("#00000000"); }<br> }</p><p><br></p><p>However, setting a breakpoint there is never getting hit, and of course the color is also not shown in the map.</p><p><br></p><p>So, at the moment, the only way to go about this is to create a bunch of collections, assign them to individual series, and when a point changes it's state in the original collection, manage all the others somehow.</p><p>This will be quite cumbersome, as there are a bunch of states a point can have, and the result would be that I would need to manage about 7 or 8 different collections, only to have them show up in the proper color.</p><p><br></p><p>Before I do this, does anyone have an other ideas / hints / tips on how I could achieve what I am trying to?</p><p></p><p>Thanks</p><p>Martin</p><br/><br/>suggested by: Martin IngoldMartin Ingoldhttps://oxyplot.userecho.com/users/616-martin-ingold/topics/tag:oxyplot.userecho.com,2018-11-12:/communities/1/topics/1070-errorcolumnseries-with-different-upper-and-lower-limits/2018-11-12T12:32:50+00:002018-11-12T12:32:50+00:00ErrorColumnSeries with different upper and lower limits [questions] <p>I would like to plot confidence intervals on my column chat - however I couldn't find a way to set the upper and lower limits separately. Is there a way to do that?</p><p>If not, somebody should do it ;) (sorry I just started with oxyplot and have no idea how to do it).</p><p></p><p>Cheers</p><p>Marwin</p><br/><br/>suggested by: Marwin SchmittMarwin Schmitthttps://oxyplot.userecho.com/users/615-marwin-schmitt/topics/tag:oxyplot.userecho.com,2018-11-11:/communities/1/topics/1069-save-an-oxyplot-chart-with-xamlwriter/2018-11-11T16:42:29+00:002018-11-11T16:42:29+00:00Save an OxyPlot Chart with XamlWriter [questions] <p>Hello,</p><p></p><p>I Try to Save a Chart with the XamlWriter.Sav-Metho, but i got an exception that it can not be serilized.</p><p><br>Can someone Help me to Save the complete Chart in an XAML-Code?<br> </p><br/><br/>suggested by: derderhttps://oxyplot.userecho.com/users/614-der/topics/tag:oxyplot.userecho.com,2018-11-07:/communities/1/topics/1068-how-to-draw-sine-and-cosine-wave-with-parameters-amp-phase-frequency-at-the-same-time/2018-11-07T07:17:24+00:002018-11-07T07:17:24+00:00How to draw sine and cosine wave with parameters (amp, phase, frequency) at the same time? [questions] <p>Hi everyone)<br><br>Try to draw sine and cosine wave with parameters with FunctionSeries method. Unsuccessfully...<br>How to draw sine and cosine wave with parameters at the same time?</p><br/><br/>suggested by: Nazar BulavkoNazar Bulavkohttps://oxyplot.userecho.com/users/613-nazar-bulavko/topics/tag:oxyplot.userecho.com,2018-11-06:/communities/1/topics/1067-show-only-the-added-datapoints-at-the-x-axis/2018-11-06T10:55:22+00:002018-11-06T10:55:22+00:00Show only the added datapoints at the x axis [questions] <p>Hello,</p><p></p><p>I want to create a line chart with three series. Each series have the same data values for the x axis. </p><p>My problem is that, the x axis interpolate the values between the data points.</p><p></p><p>Is there a possibility to change this behaviour.</p><p></p><figure><img src="/s/attachments/13970/1/0/b52c80bcb7410de1907ede7f989bb3a2.jpg"></figure><p><br></p><p></p><figure><img src="/s/attachments/13970/1/0/372c68fdf4e5f48c7dc0a6f9b2375d3a.jpg"></figure><p><br></p><br/><br/>suggested by: Christian RiepingChristian Riepinghttps://oxyplot.userecho.com/users/612-christian-rieping/topics/tag:oxyplot.userecho.com,2018-10-24:/communities/1/topics/1066-rectangleannotation-text-position/2018-10-24T15:46:31+00:002018-10-24T15:46:31+00:00RectangleAnnotation Text Position [questions] <p>Hello!</p><p><br></p><p>is there a way to stick the RectangleAnnotation text on the top of the plotarea? </p><p>i mean like with a LineAnnotation the text will allways be visible even when i zoom in or out. the text sticks on the top.</p><p><br></p><p>my problem is that i wanna use a RectangleAnnotation but a text is conected with a DataPoint</p><p>new OxyPlot.Annotations.RectangleAnnotation { <strong>TextPosition = new OxyPlot.DataPoint(start + (end-start)/2, getMinMaxValue()[1] * 0.95)</strong>, MinimumX = start, MaximumX = end, TextRotation = -90, Text = title, Fill = OxyColor.FromAColor(50, OxyColor.FromRgb(0, 102,153)), Stroke = OxyColor.FromRgb(0, 102, 153), StrokeThickness = 1 });</p><p></p><p>and when i zoom in the text isn´t visible anymore...</p><p></p><p>has anyone an idea? would be nice</p><br/><br/>suggested by: joker159357joker159357https://oxyplot.userecho.com/users/611-joker159357/topics/tag:oxyplot.userecho.com,2018-09-08:/communities/1/topics/1065-is-there-a-way-to-render-a-point-outside-of-the-plot-wpf/2018-09-08T19:27:40+00:002018-09-08T19:27:40+00:00Is there a way to render a Point outside of the Plot? (WPF) [questions] <p>I've created a custom legend and this is more or less the final piece of the puzzle.</p><p><br></p><p>Each line is:</p><p>[checkbox for series visibility] [*Need to add point shape here*] [Series title] [A custom control that displays data about the data] [row of of Buttons]</p><p><br></p><p>Each line creates a series and passes it to the plot, so I already have all the Marker parameters.<br></p><p><br></p><p>I've spent a day going through the example browser trying to dig down to how the points are actually rendered, but I could use some direction. Or, am I going to have to recreate the shapes in XAML?<br></p><br/><br/> Hugo replied:<br/><p>Well I feel like an idiot. It's real easy. Here's how to do it if anyone else has the same requirement:</p><p><br></p><p>XAML:</p><pre><Canvas Name="PointCanvas" Width="50" Height="50"/></pre><p>C#:</p><pre>OxyPlot.Wpf.CanvasRenderContext rc = new OxyPlot.Wpf.CanvasRenderContext(PointCanvas);rc.DrawMarker(new OxyRect(0,0,50,50), new ScreenPoint(8, 8), MarkerType.Diamond,new List<ScreenPoint>(), 5, OxyColors.Black, OxyColors.Green, 1);</pre><p><br></p>Hugohttps://oxyplot.userecho.com/users/609-hugo/topics/tag:oxyplot.userecho.com,2018-09-04:/communities/1/topics/35-wpf-performance/2018-09-04T12:34:47+00:002018-09-04T12:34:47+00:00WPF performance [questions] <div><strong>This discussion was imported from <a href="http://oxyplot.codeplex.com/discussions/450227">CodePlex</a></strong></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-16 19:38:</p><div>I would like to use OxyPlot in a WPF application, but appear to be encountering a performance issue. I have 8 plots in a scroll viewer, ~4 onscreen at a time. The plots are initialized and configured in code. They are updated in real-time with data (maybe 10 points per second each) up to a defined maximum amount. If I swap the type from WPF to WindowsForms using a hosted container, the performance doubles. Let me rephrase: WPF has 100% CPU usage and low UI response, WF has 50% CPU usage and good UI response.<br><br>Any idea why the difference in CPU usage/performance? Is there something I'm missing to get better WPF usage? I'm not using bindings; the simple code that works for WF is also used for WPF.<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/kevdog114">kevdog114</a></strong> wrote at 2013-07-17 20:23:</p><div>I've noticed the same thing. I am displaying different charts in WPF with OxyPlot, and the performance is not great (i.e. panning, zooming, and tracking). Some of the charts have as few as a dozen or two points and aren't updated dynamically. The WinForms example and the online Silverlight example work perfectly. <br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/everytimer">everytimer</a></strong> wrote at 2013-07-18 17:44:</p><div>I think it's a problem with WPF itself.<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-18 17:51:</p><div>It might be, but my test tries to use the objects using code rather than XAML/binding. The test application itself is WPF. The difference I'm noticing is in using the WPF version of OxyPlot vs the Windows Forms version hosted in the WPF application.<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2013-07-19 08:32:</p><div>Can you profile your application to see if the time is spent in your application, the OxyPlot library or in the WPF core?<br>I have also noticed that other platforms are performing much better than WPF. It would be interesting to know if there is something that can be improved in the WPF implementation!<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-19 14:58:</p><div>I have since gone ahead using a hosted WF OxyPlot. Seems I'll need a wrapper around it so that resizing will work properly.<br><br>I'll try putting together a test app once I have time and have a better idea how to use SharpDevelop's profiler; couldn't find a better one.<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-23 20:38:</p><div>Below code is currently set to use OxyPlot.WindowsForms control in a WPF application. Change the XAML to use OxyPlot.WPF for comparison. I was unable to retrieve any insight using either SharpDevelop or SlimTune profilers. Perhaps someone else can make sense of the data. <br><br>XAML:<br><pre><code><Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" xmlns:oxy2="clr-namespace:OxyPlot.WindowsForms;assembly=OxyPlot.WindowsForms" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded" WindowState="Maximized"> <!-- Comment/Uncomment the plot variant to use: WPF/WF --> <!--<oxy:Plot x:Name="MyPlot" />--> <WindowsFormsHost> <oxy2:Plot x:Name="MyPlot" /> </WindowsFormsHost></Window></code></pre>Code behind:<br><pre><code>using System;using System.Collections.Generic;using System.Collections;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;namespace WpfApplication1 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); InitPlot(); // initialize plot data points for(int i = 0; i < TOTAL_AXES; i++) { _SeriesIndex[i] = 0; sbyte _DataValue = 0; for(int j = 0; j < TOTAL_POINTS/2; j++) { _SeriesData[i].Add(new OxyPlot.DataPoint(_SeriesData[i].Count, _DataValue)); _SeriesData[i].Add(new OxyPlot.DataPoint(_SeriesData[i].Count, -_DataValue)); _DataValue++; } } // set up refresh timer for ~30fps _PlotRefresh.Interval = new TimeSpan(0, 0, 0, 0, 33); _PlotRefresh.Tick += new EventHandler(Timer_Tick); } private void InitPlot() { OxyPlot.Series.LineSeries srs = null; OxyPlot.Axes.LinearAxis axisBottom = new OxyPlot.Axes.LinearAxis(OxyPlot.Axes.AxisPosition.Bottom); OxyPlot.Axes.LinearAxis axisLeft = null; double wfpos = 1.0; MyPlot.Model = new OxyPlot.PlotModel(); MyPlot.Model.Padding = new OxyPlot.OxyThickness(0); // single bottom axis axisBottom.MajorGridlineStyle = OxyPlot.LineStyle.Solid; axisBottom.MinorGridlineStyle = OxyPlot.LineStyle.Solid; axisBottom.MinimumPadding = 0; axisBottom.MaximumPadding = 0; MyPlot.Model.Axes.Add(axisBottom); for(int i = 0; i < TOTAL_AXES; i++) { // initialize each left axis axisLeft = new OxyPlot.Axes.LinearAxis(); axisLeft.Position = OxyPlot.Axes.AxisPosition.Left; axisLeft.MajorGridlineStyle = OxyPlot.LineStyle.Solid; axisLeft.MinorGridlineStyle = OxyPlot.LineStyle.Solid; axisLeft.Minimum = -128; axisLeft.Maximum = 127; axisLeft.MinimumPadding = 0; axisLeft.MaximumPadding = 0; axisLeft.EndPosition = wfpos; wfpos -= ((1.0 / TOTAL_AXES) - 0.01); axisLeft.StartPosition = wfpos; wfpos -= 0.01; axisLeft.Key = "AxisKey" + i.ToString(); MyPlot.Model.Axes.Add(axisLeft); // initialize each series for the axis _SeriesData.Add(new List<OxyPlot.IDataPoint>(TOTAL_POINTS)); srs = new OxyPlot.Series.LineSeries(); srs.CanTrackerInterpolatePoints = false; srs.StrokeThickness = 1; srs.Points = _SeriesData[i]; srs.YAxisKey = axisLeft.Key; MyPlot.Model.Series.Add(srs); } } private void Window_Loaded(object sender, RoutedEventArgs e) { _PlotRefresh.Start(); } private void Timer_Tick(object sender, EventArgs e) { // this is meant for use with dynamic data/series, but the effects // are similar using static data for testing MyPlot.RefreshPlot(true); } private const int TOTAL_AXES = 4; private const int TOTAL_POINTS = 512; private List<IList<OxyPlot.IDataPoint>> _SeriesData = new List<IList<OxyPlot.IDataPoint>>(TOTAL_AXES); private int[] _SeriesIndex = new int[TOTAL_AXES]; private System.Windows.Threading.DispatcherTimer _PlotRefresh = new System.Windows.Threading.DispatcherTimer(); }}</code></pre></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-30 17:13:</p><div>Not sure how much help this is, but I have some results from the WPF Performance Suite (part of Windows SDK). It's not very detailed, but it indicates "Rendering Thread" uses 50% CPU time and "Layout" uses 20%. As far as I can tell, WPF/OxyPlot is using hardware acceleration. RenderingCapabilities.Tier returns 2, which is the highest value indicating support for hardware acceleration. The performance suite also indicates the entire OxyPlot control being frequently marked as "dirty" and requiring refreshing/rendering. This is probably expected behavior when issuing RefreshPlot(true).<br></div></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/cpuserdi">cpuserdi</a></strong> wrote at 2013-07-30 19:57:</p><div>(Formatting is lacking, just copy the table into notepad.)<br>"Top 20" results from SharpDevelop profiler:<br><pre><code>Name Call Count Time Spent TS (self) TS (per call) TS (self/call)------------------------------------------------------------------------------------------------------------------------------------WpfApplication1.App.Main 1 19487.779297ms 26.708881ms 19487.779297ms 26.708881ms OxyPlot.Wpf.Plot.ArrangeOverride 22 6385.794584ms 0.526685ms 290.263390ms 0.023940ms OxyPlot.Wpf.Plot.UpdateModelAndVisuals 21 6327.732324ms 3.068244ms 301.320587ms 0.146107ms OxyPlot.Wpf.Plot.UpdateVisuals 21 5852.759366ms 3.663617ms 278.702827ms 0.174458ms OxyPlot.PlotModel.Render 21 4932.378369ms 14.397502ms 234.875160ms 0.685595ms WpfApplication1.MainWindow..ctor 1 3128.988608ms 60.921899ms 3128.988608ms 60.921899ms OxyPlot.PlotModel.RenderAxes 42 2628.290695ms 0.843887ms 62.578350ms 0.020093ms OxyPlot.Axes.Axis.Render 210 2627.099862ms 1.284219ms 12.509999ms 0.006115ms OxyPlot.HorizontalAndVerticalAxisRenderer.Render 210 2625.815643ms 13.369001ms 12.503884ms 0.063662ms WpfApplication1.MainWindow.InitializeComponent 1 2268.427159ms 1.322134ms 2268.427159ms 1.322134ms OxyPlot.HorizontalAndVerticalAxisRenderer.RenderMajorItems 105 1827.486131ms 4.793490ms 17.404630ms 0.045652ms OxyPlot.MathRenderingExtensions.DrawMathText 798 1570.425264ms 1.443802ms 1.967951ms 0.001809ms OxyPlot.MathRenderingExtensions.DrawMathText 798 1568.981462ms 4.374377ms 1.966142ms 0.005482ms OxyPlot.Wpf.ShapesRenderContext.DrawText 798 1561.215147ms 11.262844ms 1.956410ms 0.014114ms OxyPlot.PlotModel.AdjustPlotMargins 21 1155.307446ms 14.229514ms 55.014640ms 0.677596ms OxyPlot.PlotModel.MaxSizeOfPositionTier 42 1120.887111ms 1.372298ms 26.687788ms 0.032674ms OxyPlot.Axes.Axis.Measure 105 1119.405653ms 4.064151ms 10.661006ms 0.038706ms OxyPlot.PlotModel.RenderSeries 21 1091.402684ms 2.620846ms 51.971556ms 0.124802ms WpfApplication1.App..ctor 1 1088.683889ms 161.166694ms 1088.683889ms 161.166694ms OxyPlot.Series.LineSeries.Render 84 1087.583511ms 76.632450ms 12.947423ms 0.912291ms </code></pre>I also have the SharpDevelop profile project file if needed (~20MB).<br></div></div><br/><br/> Anonymous replied:<br/>Oystein Bjorkehttps://oxyplot.userecho.com/users/2-oystein-bjorke/topics/tag:oxyplot.userecho.com,2018-08-22:/communities/1/topics/1064-how-to-create-plot-with-two-line-series-and-fill-area-between-them/2018-08-22T15:50:12+00:002018-08-22T15:50:12+00:00How to create plot with two line series and fill area between them [questions] <p>Hi,</p><p><br></p><p>is it possible to render this type of plot? (the top one)</p><figure><img></figure><p><br></p><p>We have prediction for some value and its observed value and we would like to visualize the difference between prediction and observed value. I tried to use TwoColorAreaSeries but without success.</p><p><br></p><p>Thanks</p><br/><br/>suggested by: karel bemkarel bemhttps://oxyplot.userecho.com/users/606-karelbem/topics/tag:oxyplot.userecho.com,2018-08-16:/communities/1/topics/892-isvalidpoint-on-realtime-lineserie/2018-08-16T11:27:06+00:002018-08-16T11:27:06+00:00IsValidPoint on realtime LineSerie [questions] <p>Hello guys! I've been using oxyplot for a month now and I'm pretty happy with what it delivers. I'm getting data from an oscilloscope and, after a fast processing, I'm plotting it in real time to a graph.</p><p><br></p><p>However, if I compare my application CPU usage to the one provided by the oscilloscope manufacturer, I'm loading a lot more the CPU. Maybe they're using some gpu-based plotter, but I think I can reduce my CPU usage with some modifications.<br><br>I'm capturing 10.000 samples per second and adding it to a LineSeries. I'm not plotting all that data, I'm decimating it to a constant number of points, let's say 80 points for a 20 secs measure, so I have 4 points/sec while totally zoomed out and a bit more detail if I zoom in to a specific range.</p><p><br></p><p>With the aid of ReSharper, I've noticed that the application is calling a lot of times (I've 6 different plots) the IsValidPoint method (something like 400.000.000 times), which is taking a lot of time. <br><br>I think the problem is that, when I add new points to the series, it checks for every point if it is a valid point, instead of the added values only.</p><p><br></p><p>Also, it spends a lot of time in the MeasureText/DrawText method.<br></p><p><br></p><p>My question is: is there a way to override those methods and to adapt it to my needs? I'm adding 10.000 new values each second, but the first ones remain the same, so there's no need for re-validate them. Also, the text shown doesn't change.<br><br>Thank you in advance for any advice you can give me. Have a good day!<br><br><br><br></p><br/><br/> Pawan Kumar Tiwari replied:<br/><p>Hello Julio Garcia</p><p>I have also face that issues, I am plotting Scatter Series from 60 FPS and every old frame i have cleaned and add new frame every 16 millisecond </p><p>I have check that application CPU usage is 32-36 from if render a graph and one Table updated if i wants to write data in CSV File then its CPU usage 45--56 </p><p>I have rendering a graph and Table using Dispatcher thread </p><p>I wants to Fix it CPU uses bellow 30 but till now i am not able to fix </p><p>Can you suggest me how to resolved </p>Julio García Gonzálezhttps://oxyplot.userecho.com/users/254-julio-garcia-gonzalez/topics/tag:oxyplot.userecho.com,2018-08-15:/communities/1/topics/1062-how-to-invisibility-one-plotview/2018-08-15T02:36:21+00:002018-08-15T02:36:21+00:00how to invisibility one plotview [questions] <p>hi, everybody.</p><p>Relation to the Example:"Gridline cropping" ,the plotview was split to four parts,how can I invisibility one of the four?</p><p>thanks.</p><br/><br/>suggested by: future0723future0723https://oxyplot.userecho.com/users/603-future0723/topics/tag:oxyplot.userecho.com,2018-07-13:/communities/1/topics/1061-xamarin-android-crashes-when-plotview-is-touched/2018-07-13T16:31:28+00:002018-07-13T16:31:28+00:00Xamarin Android crashes when plotview is touched [questions] <p>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. </p><p><br></p><p>How do I disable touching of the plotview?</p><br/><br/>suggested by: scotshealeyscotshealeyhttps://oxyplot.userecho.com/users/600-scotshealey/topics/tag:oxyplot.userecho.com,2018-06-13:/communities/1/topics/739-possible-memory-leak-issue/2018-06-13T15:40:14+00:002018-06-13T15:40:14+00:00Possible memory leak issue [questions] [under review]<p>I am building a Xamarin.Forms app that needs to plot several graphs that update with new data every second. I've found Oxyplot to be a good library to use, but I've encountered memory issues. To see if the problem was being caused by Oxyplot and not somewhere else in the code, I created a simple Xamarin.Forms app that has a single line series to which a new data point is added every second and ran it through the Xamarin Profiler.</p><p><br></p><p>What I find is that the memory usage continues to slowly but steadily grow over time. According to the profiler, there are a number of System.Collections.Generic.Dictionary.Entry<System.IntPtr,System.Collections.Generic.List<System.WeakReference>>[] which continue to grow in size over time. With every call to InvalidatePlot(true), the memory usage increases.</p><p><br></p><p>I've included the code here, it's just about the most simple example of what I need the graph to do in my actual application.</p><pre>namespace SimpleGraph{ public class MyPage : ContentPage { PlotModel myPlotModel = new PlotModel (); PlotView myPlotView = new PlotView(){ VerticalOptions = LayoutOptions.Fill, HorizontalOptions = LayoutOptions.Fill, }; public MyPage () { int ctr = 3; myPlotView.Model = myPlotModel; Content = myPlotView; SetupGraphs (); Device.StartTimer (new TimeSpan (0, 0, 0, 1), () => { Random r = new Random (); ctr++; UpdateGraphs(ctr); myPlotView.Model.InvalidatePlot(true); return true; }); } public void SetupGraphs() { Random r = new Random (); myPlotModel.Axes.Add (new LinearAxis { Position = AxisPosition.Bottom }); myPlotModel.Axes.Add (new LinearAxis { Position = AxisPosition.Left, Maximum = 10, Minimum = 0 }); LineSeries series1 = new LineSeries { MarkerType = MarkerType.Circle, MarkerSize = 4, MarkerStroke = OxyColors.White }; series1.Points.Add (new DataPoint (0.0, r.Next(0, 10))); series1.Points.Add (new DataPoint (1.4, r.Next(0, 10))); series1.Points.Add (new DataPoint (2.0, r.Next(0, 10))); myPlotModel.Series.Add (series1); } public void UpdateGraphs(int ctr) { Random r = new Random (); DataPoint dp = new DataPoint(ctr, r.Next (0, 10)); LineSeries series1 = myPlotModel.Series [0] as LineSeries; series1.Points.Add (dp); if (series1.Points.Count > 30) { series1.Points.RemoveAt (0); } } }}<br><code></code></pre><div></div><p>Just to make things more interesting, the issue only occurs when using Android 5 or above.</p><p><br></p><p>I am new to mobile development, so I apologize if I've done something stupid, or am just using OxyPlot incorrectly.</p><p><br></p><p>I am using version 1.0.0-unstable1957 of Oxyplot.</p><p><br></p><p>Any assistance would be greatly appreciated.</p><br/><br/> David Gillard replied:<br/><p>I've experienced what I believe is essentially the same problem with OxyPlot for GTK 1.0.0 using monodevelop.</p>ChrisMhttps://oxyplot.userecho.com/users/205-chrism/topics/tag:oxyplot.userecho.com,2018-06-08:/communities/1/topics/702-how-create-event-click-in-column-of-chart-oxyplot/2018-06-08T11:28:00+00:002018-06-08T11:28:00+00:00how create event click in column of chart oxyplot? [questions] <div><div></div></div><div><pre>hello good afternoon , I am trying to create an event just click on the column and not knowing how to do.Someone has a tip ?I am making an android app using Xamarin . Thank you.</pre></div><p><br></p><br/><br/> Ankit replied:<br/><p>Hello Lucas,</p><p><br></p><p>have you achieve click event on oxyplot chart .. ?</p><p><br></p><p>please help thanks in advanced !!</p>Lucas Augustohttps://oxyplot.userecho.com/users/179-lucas-augusto/topics/tag:oxyplot.userecho.com,2018-05-09:/communities/1/topics/1057-how-can-i-add-text-to-a-graph/2018-05-09T07:46:38+00:002018-05-09T07:46:38+00:00How can I add text to a graph? [questions] <p>I am using OxyPlot.Xamarin.Android to plot irregular polygons ( using LineSeries), I want also to add near a line it's length. It is possible to add a text in a graph? I also want the zoom in or out to work on the text like on the lines. Thanks.</p><br/><br/>suggested by: VladVladhttps://oxyplot.userecho.com/users/588-vlad/topics/tag:oxyplot.userecho.com,2018-04-09:/communities/1/topics/209-knowing-when-invalideplot-rendering-has-completed/2018-04-09T12:06:03+00:002018-04-09T12:06:03+00:00Knowing when InvalidePlot (Rendering) has completed [questions] I have a plot with a large number of points (>300000) and when I call, PlotView.InvalidatePlot(true), it takes a while to render. This is acceptable but I would like to put up an hourglass or some other indication that things will take a while. I'm having some problems though as I don't know when the Rendering is complete. I can't find an event that I can subscribe to. Is there one?<br><br><br>I call MyPlot.InvalidatePlot(true); from the main GUI thread. If my understanding is correct, InvalidatePlot works on another thread. Presumeably, it must get back on the GUI thread to actually plot data. I tried using the following:<br><br><br>Mouse.OverrideCursor = Cursors.Wait;<br>MyPlot.InvalidatePlot(true);<br>Mouse.OverrideCursor = null;<br><br><br>and other similar ideas but to no avail. I'm guessing that InvalidatePlot is a non blocking call. What I really need to do is switch to Cursors.Wait and then in some event, set the cursor back again. I was hoping for something like:<br><br><br>MyPlot.RenderingCompleted or some such thing. Can someone give me some pointers?<br><br><br>Regards,<br>Dave<br><br/><br/> SHK replied:<br/><p>Did you guys got any solution for this issue?</p><p><br></p><p>I have got it working automatically by writing the InvalidatePlot() invocation call inside the UI Dispatcher thread, It worked for 2 days, currently it's not working!!</p><p><br></p><p>Also I am facing an issue in which I need to bind Data property HeatMapSeries with 10000x10000 2D array. It throws System.OutOfMemory exception. This problem exists for the 2D array of size 2000x2000 or higher.</p><p><br></p>csharpuserhttps://oxyplot.userecho.com/users/78-csharpuser/topics/tag:oxyplot.userecho.com,2018-04-05:/communities/1/topics/1056-svg-export-special-characters/2018-04-05T08:02:35+00:002018-04-05T08:02:35+00:00svg export special characters [bugs] <p>Hi,</p><p><br></p><p>I want to create axis label with special (german) character and export it as svg</p><p>the Title of the axis should be "Länge [m]"</p><p>I tried:<br></p><pre>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 });</pre><p>this will result in <text>L&#228;nge [m]</text></p><p><br></p><p><br></p><p>with HTML syntax:</p><p>"Länge [m]"</p><p>it will result in <text>L&auml;nge [m]</text></p><p><br></p><p>and with no special syntag:</p><p>"Länge [m]"<br></p><p>it will result in <text>L??nge [m]</text><br></p><br/><br/> peterparker replied:<br/><p>the first result looks korrect but the text was corrected by the form there is an auml; after the &</p>peterparkerhttps://oxyplot.userecho.com/users/578-peterparker/topics/tag:oxyplot.userecho.com,2018-03-30:/communities/1/topics/1055-oxyplot-pan-function-override/2018-03-30T07:09:21+00:002018-03-30T07:09:21+00:00Oxyplot Pan function override. [questions] <p>How can i add new line series during panning at certain level in oxyplot wpf?</p><br/><br/>suggested by: Manjunath STManjunath SThttps://oxyplot.userecho.com/users/576-manjunath-st/topics/tag:oxyplot.userecho.com,2018-02-16:/communities/1/topics/1053-how-to-reverse-magnitudeaxis/2018-02-16T09:39:34+00:002018-02-16T09:39:34+00:00How to reverse MagnitudeAxis [questions] <p>I want to visualize the position of the satellites on the graph using PlotType.Polar. as in the picture. How to reverse MagnitudeAxis?</p><figure><img src="/s/attachments/13970/1/0/f524ad122b888073fd219e369aa7e852.jpg"></figure><br/><br/>suggested by: ArtemprodigyArtemprodigyhttps://oxyplot.userecho.com/users/570-artemprodigy/topics/tag:oxyplot.userecho.com,2018-02-14:/communities/1/topics/1052-oxyplot-lineseries-and-linearaxis/2018-02-14T05:15:57+00:002018-02-14T05:15:57+00:00Oxyplot lineseries and linearaxis [questions] <p>Hi friends,</p><p>I want to do that,</p><p>lineseris1 and Y1 depends on each other.(Y1 is left axis)</p><p>lineseris2 and Y2 depends on each other.(Y2 is right axis)</p><p>When I keep to press the right click ,I am dragging the lineseries and <br>just changing left axis(lineseries1),I want it to move both axis(left <br>and right axis).</p><p>Also,</p><p>When the lineseries1 rescale according to receiving values,left axis must change .</p><p>When the lineseries2 rescale according to receiving values,right axis must change.</p><br/><br/> Emrah Duatepe replied:<br/><p>It is OK.<br> <br>LinearAxis linearAxisY2 = new LinearAxis {<br> Title = "Y2",<br> Position = AxisPosition.Right,<br> Key = "A"<br> };</p><p>lineSeries1.YAxisKey = linearAxisY2.Key;</p>Emrah Duatepehttps://oxyplot.userecho.com/users/567-emrah-duatepe/topics/tag:oxyplot.userecho.com,2018-02-12:/communities/1/topics/652-plotting-data-stream-received-by-a-serial-port/2018-02-12T08:00:30+00:002018-02-12T08:00:30+00:00Plotting data stream received by a serial port [questions] <div><strong>This discussion was imported from <a href="http://oxyplot.codeplex.com/discussions/401597">CodePlex</a></strong></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/JohnnyPP">JohnnyPP</a></strong> wrote at 2012-11-01 21:27:</p><p>Hello,</p><p> </p><p>I would like to plot data stream received by a serial port with sampling rate set to 1 Hz. Data stream is generated by a digital temperature sensor TMP102 connected to a microcontroller. The microcontroller sends the temperature values to the PC through serial port. In windows forms there is serial port control which I use to receive the data. All works well, with one exception the plot shows only last value received by the serial port. I am aware that the code I use right now is not optimized to draw a line between received points. I read other similar threads dealing with displaying real time data like:</p><p><a href="http://oxyplot.codeplex.com/discussions/398856" rel="nofollow">http://oxyplot.codeplex.com/discussions/398856</a></p><p><a href="http://oxyplot.codeplex.com/discussions/281036" rel="nofollow">http://oxyplot.codeplex.com/discussions/281036</a></p><p><a href="http://oxyplot.codeplex.com/discussions/350457" rel="nofollow">http://oxyplot.codeplex.com/discussions/350457</a></p><p>I also looked at Realtimedemo and Refreshdemo. The answers and code are somehow confusing and complex (I am more involved in hardware than in software).</p><p>So my question is: how can I connect data points with a line? I would like to keep the code it as simple as possible.</p><p> </p><p>Thanks in advance!</p><p> </p><p>The code I use:</p><p> </p><pre style="color: black;"><span style="color: green;">// --------------------------------------------------------------------------------------------------------------------</span><span style="color: green;">// <copyright file="Form1.cs" company="OxyPlot"></span><span style="color: green;">// http://oxyplot.codeplex.com, license: Ms-PL</span><span style="color: green;">// </copyright></span><span style="color: green;">// --------------------------------------------------------------------------------------------------------------------</span> <span style="color: blue;">using</span> System.Collections.Generic;<span style="color: blue;">using</span> System.ComponentModel;<span style="color: blue;">using</span> System.Data;<span style="color: blue;">using</span> System.Drawing;<span style="color: blue;">using</span> System.Linq;<span style="color: blue;">using</span> System.Text;<span style="color: blue;">using</span> System;<span style="color: blue;">using</span> System.Windows.Forms;<span style="color: blue;">using</span> OxyPlot;<span style="color: blue;">using</span> System.Globalization; <span style="color: blue;">namespace</span> WindowsFormsDemo{ <span style="color: blue;">public</span> <span style="color: blue;">partial</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Form1</span> : <span style="color: #2b91af;">Form</span> { <span style="color: blue;">private</span> <span style="color: blue;">int</span> i = 0; <span style="color: blue;">public</span> Form1() { InitializeComponent(); } <span style="color: blue;">private</span> <span style="color: blue;">void</span> button1_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e) { serialPort1.PortName = <span style="color: #a31515;">"COM3"</span>; serialPort1.BaudRate = 9600; serialPort1.DtrEnable = <span style="color: blue;">true</span>; serialPort1.Open(); serialPort1.DataReceived += serialPort1_DataReceived; } <span style="color: blue;">private</span> <span style="color: blue;">void</span> button2_Disconnect_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">EventArgs</span> e) { <span style="color: blue;">if</span> (serialPort1.IsOpen) { serialPort1.Close(); } } <span style="color: blue;">private</span> <span style="color: blue;">void</span> serialPort1_DataReceived(<span style="color: blue;">object</span> sender, System.IO.Ports.<span style="color: #2b91af;">SerialDataReceivedEventArgs</span> e) { <span style="color: blue;">string</span> line = serialPort1.ReadLine(); <span style="color: blue;">this</span>.BeginInvoke(<span style="color: blue;">new</span> <span style="color: #2b91af;">LineReceivedEvent</span>(LineReceived), line); } <span style="color: blue;">private</span> <span style="color: blue;">delegate</span> <span style="color: blue;">void</span> <span style="color: #2b91af;">LineReceivedEvent</span>(<span style="color: blue;">string</span> line); <span style="color: blue;">private</span> <span style="color: blue;">void</span> LineReceived(<span style="color: blue;">string</span> line) { <span style="color: blue;">double</span> dTemperature, dTemperatureRound; <span style="color: blue;">try</span> { dTemperature = <span style="color: blue;">double</span>.Parse(line, <span style="color: #2b91af;">CultureInfo</span>.InvariantCulture); dTemperatureRound = <span style="color: #2b91af;">Math</span>.Round(dTemperature, 4); label1.Text = <span style="color: #2b91af;">Convert</span>.ToString(dTemperatureRound); <span style="color: blue;">var</span> pm = <span style="color: blue;">new</span> <span style="color: #2b91af;">PlotModel</span>(<span style="color: #a31515;">"TMP102 digital temperature sensor"</span>, <span style="color: #a31515;">"Temperature data stream"</span>) { PlotType = <span style="color: #2b91af;">PlotType</span>.Cartesian, Background = <span style="color: #2b91af;">OxyColors</span>.White, }; <span style="color: blue;">var</span> linearAxisX = <span style="color: blue;">new</span> <span style="color: #2b91af;">LinearAxis</span>(); linearAxisX.Title = <span style="color: #a31515;">"Sample number"</span>; linearAxisX.Position = <span style="color: #2b91af;">AxisPosition</span>.Bottom; linearAxisX.MajorGridlineColor = <span style="color: #2b91af;">OxyColor</span>.FromArgb(40, 0, 0, 139); linearAxisX.MajorGridlineStyle = <span style="color: #2b91af;">LineStyle</span>.Solid; linearAxisX.MinorGridlineColor = <span style="color: #2b91af;">OxyColor</span>.FromArgb(20, 0, 0, 139); linearAxisX.MinorGridlineStyle = <span style="color: #2b91af;">LineStyle</span>.Solid; pm.Axes.Add(linearAxisX); <span style="color: blue;">var</span> linearAxisY = <span style="color: blue;">new</span> <span style="color: #2b91af;">LinearAxis</span>(); linearAxisY.Title = <span style="color: #a31515;">"Temperature [°C]"</span>; linearAxisY.Position = <span style="color: #2b91af;">AxisPosition</span>.Left; linearAxisY.MajorGridlineColor = <span style="color: #2b91af;">OxyColor</span>.FromArgb(40, 0, 0, 139); linearAxisY.MajorGridlineStyle = <span style="color: #2b91af;">LineStyle</span>.Solid; linearAxisY.MinorGridlineColor = <span style="color: #2b91af;">OxyColor</span>.FromArgb(20, 0, 0, 139); linearAxisY.MinorGridlineStyle = <span style="color: #2b91af;">LineStyle</span>.Solid; pm.Axes.Add(linearAxisY); <span style="color: blue;">var</span> lineSeries1 = <span style="color: blue;">new</span> <span style="color: #2b91af;">LineSeries</span>(); lineSeries1.Color = <span style="color: #2b91af;">OxyColor</span>.FromArgb(255, 78, 154, 6); lineSeries1.MarkerFill = <span style="color: #2b91af;">OxyColor</span>.FromArgb(255, 78, 154, 6); lineSeries1.MarkerStroke = <span style="color: #2b91af;">OxyColors</span>.ForestGreen; lineSeries1.MarkerType = <span style="color: #2b91af;">MarkerType</span>.Circle; lineSeries1.StrokeThickness = 2; lineSeries1.DataFieldX = <span style="color: #a31515;">"Date"</span>; lineSeries1.DataFieldY = <span style="color: #a31515;">"Value"</span>; lineSeries1.Points.Add(<span style="color: blue;">new</span> <span style="color: #2b91af;">DataPoint</span>(i, dTemperatureRound)); pm.Series.Add(lineSeries1); plot1.Model = pm; i++; } <span style="color: blue;">catch</span> (<span style="color: #2b91af;">Exception</span> ex) { <span style="color: #2b91af;">MessageBox</span>.Show(ex.ToString()); } } }}</pre><p> </p></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/objo">objo</a></strong> wrote at 2012-11-01 21:41:</p><p>I would suggest to create the PlotModel, axes and LineSeries in your form constructor. Call plot1.InvalidatePlot(true) to refresh. Something like this (not tested):</p><pre> public class Form1 : Form { private readonly LineSeries lineSeries1; private int i; public Form1() { InitializeComponent(); var pm = new PlotModel("TMP102 digital temperature sensor", "Temperature data stream") { PlotType = PlotType.Cartesian, Background = OxyColors.White }; var linearAxisX = new LinearAxis(); linearAxisX.Title = "Sample number"; linearAxisX.Position = AxisPosition.Bottom; linearAxisX.MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139); linearAxisX.MajorGridlineStyle = LineStyle.Solid; linearAxisX.MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139); linearAxisX.MinorGridlineStyle = LineStyle.Solid; pm.Axes.Add(linearAxisX); var linearAxisY = new LinearAxis(); linearAxisY.Title = "Temperature [°C]"; linearAxisY.Position = AxisPosition.Left; linearAxisY.MajorGridlineColor = OxyColor.FromArgb(40, 0, 0, 139); linearAxisY.MajorGridlineStyle = LineStyle.Solid; linearAxisY.MinorGridlineColor = OxyColor.FromArgb(20, 0, 0, 139); linearAxisY.MinorGridlineStyle = LineStyle.Solid; pm.Axes.Add(linearAxisY); this.lineSeries1 = new LineSeries(); this.lineSeries1.Color = OxyColor.FromArgb(255, 78, 154, 6); this.lineSeries1.MarkerFill = OxyColor.FromArgb(255, 78, 154, 6); this.lineSeries1.MarkerStroke = OxyColors.ForestGreen; this.lineSeries1.MarkerType = MarkerType.Circle; this.lineSeries1.StrokeThickness = 2; this.lineSeries1.DataFieldX = "Date"; this.lineSeries1.DataFieldY = "Value"; pm.Series.Add(this.lineSeries1); plot1.Model = pm; } private void button1_Click(object sender, EventArgs e) { serialPort1.PortName = "COM3"; serialPort1.BaudRate = 9600; serialPort1.DtrEnable = true; serialPort1.Open(); serialPort1.DataReceived += this.serialPort1_DataReceived; } private void button2_Disconnect_Click(object sender, EventArgs e) { if (serialPort1.IsOpen) { serialPort1.Close(); } } private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e) { string line = serialPort1.ReadLine(); this.BeginInvoke(new LineReceivedEvent(this.LineReceived), line); } private void LineReceived(string line) { double dTemperature, dTemperatureRound; try { dTemperature = double.Parse(line, CultureInfo.InvariantCulture); dTemperatureRound = Math.Round(dTemperature, 4); label1.Text = Convert.ToString(dTemperatureRound); this.lineSeries1.Points.Add(new DataPoint(this.i, dTemperatureRound)); plot1.InvalidatePlot(true); this.i++; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private delegate void LineReceivedEvent(string line); }</pre></div><hr><div><p><strong><a href="http://www.codeplex.com/site/users/view/JohnnyPP">JohnnyPP</a></strong> wrote at 2012-11-01 22:20:</p><p>Thanks Objo,</p><p>it works!</p></div><br/><br/> Emrah Duatepe replied:<br/><p>if I drag the plot with right click ,shifting was stop,how was it stopped,any offer.Also Can I set time axis? I mean time axis show me long time. I would like to show me for example 20 s update time.<br></p>Oystein Bjorkehttps://oxyplot.userecho.com/users/2-oystein-bjorke/topics/