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

Most efficient way to refresh data for a single data series?

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

RickNZ wrote at 2012-08-29 13:18:

I have a single <oxy:Plot> object in a WPF application, with 11 LinearAxis and LineSeries objects attached to it.

I'd like the graph to update whenever the associated data is updated. Each update is always for only 2 of the LineSeries. I'm currently binding the ItemSource for each LineSeries to an array of data container objects in code behind, then calling RefreshData(true) on the Plot object. While that does work, it seems like there should be a more efficient way to handle the updates.

Is there?

I thought at first that just setting ItemSource again would be enough by itself to trigger an update, but that doesn't seem to be the case.

Help: Mouse Event in Annotation

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

Artiga wrote at 2013-10-15 15:31:

Hello guys!

In my plot I have a PolygonAnnotation, and I also have a line crossing this Polygon, I wanna trigger a action only if I click in the Polygon, not if I click in the line crossing the polygon ...

Doing like that:
var pa = new PolygonAnnotation
                {
                    Layer = AnnotationLayer.BelowAxes,
                    Points = annotationPolygon,
                    Color = OxyColors.Black,
                    Fill = OxyColors.Transparent,

                };  

pa.MouseDown += (s, e) =>
            {
                if (e.ChangedButton != OxyMouseButton.Left)
                {
                    return;
                }

               myAction();
               
                PlotModel.InvalidatePlot(false);
            };
In this way, when I click inside the polygon the action triggers, but if I click in a line crossing the polygon the action also triggers (probably because the line are inside the polygon), but I do not want that, its possible to solve this?

Artiga wrote at 2013-10-15 16:03:

Ok, I made a workaround using the shift button ... thx

everytimer wrote at 2013-10-15 22:10:

Did you try setting e.Handled = true?

ColumnSeries with DateTimeAxis instead of category axis

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

Tom4Cat wrote at 2012-07-04 11:32:

Hi Objo,
thank you for the great project.

In our application I need a ColumnSeries based on a DateTimeAxis.
If I didn't overlook it in discussion or issue tracker I could only use CategoryAxis on x-Axis or?
The target is to show bar charts based on a time span.
Best variant for us: set start and end date, set granularity (to use with zooming functions)
At the moment I transform the dates to strings to use as categories, but your DateTimeAxis at the LineSeries looks even better ;-)

Thank you for your great work...
Tom4Cat
PS: Is there a possibility to donate something to you (wish list at amazon or paypal account)?

 

 


objo wrote at 2012-07-07 00:22:

A CategoryAxis is required for the BarSeries/ColumnSeries (the categories are needed for stacking/grouping).

Try using (or subclass) RectangleBarSeries, which should be possible to use with DateTimeAxis/TimeSpanAxis (I hope to get time to improve these axes later this year).

Books are very welcome :) Here is an Amazon wishlist with some titles related to this library!

How to copy a plot in WindowsForms ?

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

buaashuai wrote at 2014-07-03 13:46:

Hi~~ I am using WindowsForms, and i need to copy a plot to clipboard after i press a button. In what way can i accomplish this? Thanks.

Slxe wrote at 2014-07-04 19:27:

Here's how I'm handling it:
PlotController.BindKeyDown(OxyKey.C,
                           OxyModifierKeys.Control,
                           new DelegatePlotCommand<OxyKeyEventArgs>(
                               CopyChart_OnKeyDown));
                               
private void CopyChart_OnKeyDown(
    IPlotView view,
    IController controller,
    OxyKeyEventArgs args)
{
    var chartBitmap = new Bitmap(uiPlotView.Width, uiPlotView.Height);
    uiPlotView.DrawToBitmap(chartBitmap,
                            new Rectangle(0, 0, uiPlotView.Width, uiPlotView.Height));
    Clipboard.SetImage(chartBitmap);
}
I actually based this on some code that used to be in the PlotCommands, not sure why it was taken out.

buaashuai wrote at 2014-07-06 10:01:

Thanks to you. you answer is right and my problem has solved.

buaashuai wrote at 2014-07-06 10:02:

Slxe wrote:
Here's how I'm handling it:
PlotController.BindKeyDown(OxyKey.C,
                           OxyModifierKeys.Control,
                           new DelegatePlotCommand<OxyKeyEventArgs>(
                               CopyChart_OnKeyDown));
                               
private void CopyChart_OnKeyDown(
    IPlotView view,
    IController controller,
    OxyKeyEventArgs args)
{
    var chartBitmap = new Bitmap(uiPlotView.Width, uiPlotView.Height);
    uiPlotView.DrawToBitmap(chartBitmap,
                            new Rectangle(0, 0, uiPlotView.Width, uiPlotView.Height));
    Clipboard.SetImage(chartBitmap);
}
I actually based this on some code that used to be in the PlotCommands, not sure why it was taken out.
Thanks to you. you answer is right and my problem has solved.

Multiple Charts in a single chart control

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

heromyth wrote at 2011-08-09 05:00:

OxyPlot is so cool. I just found it. I want to place multiple charts into a single chart control to implement something like belown:

http://www.agoil.cn/bbs/attachment/Mon_0809/257_140028_0e6d58504e6e1a5.jpg

I wonder whether it is easy for OxyPlot.

I known the ZedChart supports multiple charts layout. However, it is abandoned, and is just for WinForm.

Thanks.


objo wrote at 2011-08-09 10:44:

yes, you can use multiple axes and set the StartPosition and EndPosition (relative to the plot area) of each axis. You can mix both logarithmic and linear axes in the same plot.

For the well logs I think you could create one x-axis for each data series, and set the Start/EndPosition of each axis. You need to create a custom axis class to render only max and min as in your example.

Area series are supported, but you need to make a custom series to support colour coding as in the "Clay" series. 


heromyth wrote at 2011-08-10 06:09:

That's great.

For Silverlight version, it is not support using Axes property in XAML like WPF version, is it?

Yes, each data series should have it's own x-axis. I think it can be called a virtual x-axis or logical x-axis (which is not renderable). And, all the data series in a ChartArea ( or a track ) should share a common x-axis which is actual x-axis (it is drawable for the PlotArea). Has the data series of OxyPlot a interface like this? If not, I want to implement one.

By the way, the position of Axis can be adjusted slightly?  If the magins of PlotArea are set to bigger, the distance between the title and the Axis also becomes bigger, and can't be adjusted.


objo wrote at 2011-08-10 13:31:

I will update the properties of both the WPF and Silverlight Axis controls soon. Currently you have to use a PlotModel to access all properties. (I prefer to do it this way).

All your logs can share the same depth axis, but currently this can only be rendered on the left or right side of the plot area. It is not possible to move the position of the axis, but this is something we could consider to add (using offset values relative to the plot area). E.g. AxisPosition = Left and AxisPositionOffset = 0.5 could render the axis left of the center of the plot.


heromyth wrote at 2011-08-10 15:31:

If multiple x-axises are placed at the same section of a PlotArea for example StartPosition=0, EndPosition=0.5, just one x-axis at a time can do panning. So, if these x-axises are grouped, they can be panned together. Is it worth doing this? If it is, I want to do it.


heromyth wrote at 2011-08-11 05:29:

heromyth wrote:

If multiple x-axises are placed at the same section of a PlotArea for example StartPosition=0, EndPosition=0.5, just one x-axis at a time can do panning. So, if these x-axises are grouped, they can be panned together. Is it worth doing this? If it is, I want to do it.

I have submitted a patch for this. The demo code can be emailed to you if you are interesting in it.

Now, I want to implement the adjustable AxisPosition. Any suggestion for this? Thanks.

How about implementing the splitter between the TrackAreas?


objo wrote at 2011-08-11 08:59:

thanks! I will have a look at this soon. I am currently working on some of the other issues that I will check in first.

OxyPlot.Metro from NuGet: chart completely empty!

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

cureos wrote at 2014-07-31 09:33:

I have been using OxyPlot.Metro in a Caliburn.Micro based Windows 8 application.

I have my View.xaml something like this:
// xmlns:oxy="using:OxyPlot.Metro"  
<oxy:Plot x:Name="Chart" Model="{Binding PlotModel}"/>
The PlotModel is a notifiable property in ViewModel.cs and it is initialized during view-model construction pretty much like this:
PlotModel = new PlotModel();
PlotModel.Axes.Add(new LinearAxis { Title = "X", Position = AxisPosition.Bottom });
PlotModel.Axes.Add(new LinearAxis { Title = "Y", Position = AxisPosition.Left });
The display of curves is updated based on user selection in an event handler in the View.xaml.cs file:
Chart.Model.Series.Clear();
var newSeries =new LineSeries { 
    ItemsSource = SomeListOfPointObjects, DataFieldX = "X", DataFieldY = "Y" };
Chart.Model.Series.Add(newSeries);
Chart.InvalidatePlot();
With the old NuGet version 2014.1.1.1 this is working well and the selected curves are properly displayed in the chart.

However. When I upgrade to the latest OxyPlot.Metro version from NuGet (as of this writing version 2014.1.319.1), or for that matter any version released after 2014.1.1.1, the above code produces a white, emtpy chart!

Has anyone else experienced this problem? In that case, did you find a workaround to the issue?

How to Set X Axis with DateTime

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

patilraviraj2007 wrote at 2012-03-16 10:07:

Hello,

I do have developed Silverlight Navigation Application, Where I am looking for D3 Charts, found that there is no support for HorizontalDateTime Axis like WPF ChartPlotter Control. Can you suggest how I can achieve the same?

Does Silverlight Chart control has any provision to handle Date Time Values on X-Axis, Also should be mange/plot the intervals automatically based on Chart Zoom in/out. / Or individual axis Mouse wheel scroll.

Please revert. Thanks in advance.

Regards

Raviraj

 


objo wrote at 2012-03-17 14:17:

Create a PlotModel and add a DateTimeAxis to the axes collection.

This axis will be used as the horizontal axis by default. If you don't specify a vertical axis, a LinearAxis will be added automatically.

Note that the DateTime values must be converted to double to be used with Oxyplot. Use the DateTimeAxis.ToDouble or DateTimeAxis.CreateDataPoint methods (the last one will create points you can add directly to e.g. a LineSeries).

See the DateTimeAxis examples in the ExampleLibrary.

The automatic interval algorithm in the DateTimeAxis is limited, this is issue #7988.  


patilraviraj2007 wrote at 2012-03-17 14:21:

Thanks,

Are you talking about Silverlight D3 Controls ot the OxyPlot Control Lib?

Regards

Raviraj


objo wrote at 2012-03-17 14:30:

For Silverlight, you should use OxyPlot.PlotModel and OxyPlot.DateTimeAxis in OxyPlotSL.dll.

The Silverlight control is OxyPlot.Silverlight.Plot in OxyPlot.Silverlight.dll.


patilraviraj2007 wrote at 2012-04-11 18:44:

Hello Objo,

Thanks, I got the axis as DateTime Axis on Plot, but real problem is i cant pass values to X Axis as DateTime ( As it accepts Double), What is the best way to show the data that you have in collection like KeyValue Pair of  DateTime and Values.?

Is there any specific logic required to convert to DateTime to double ?

Please help!!

Raviraj


objo wrote at 2012-04-11 19:25:

Try the DateTimeAxis.ToDouble method to do the conversion.

I started to describe it here:
http://oxyplot.codeplex.com/wikipage?title=Axes


patilraviraj2007 wrote at 2012-04-12 08:57:

Thanks a lot :) So Cool..


patilraviraj2007 wrote at 2012-04-14 13:06:

 

Thanks Objo,

Got the data on the Plot thanks, now i do have another problem like i  have two Plots, where if I Zoom In/Out X-Axis of Plot1 then Plot 2 X-Axis should also perform Zoom In/Out respectively (based on operation performed) and vice versa.

Both Plots have X-Asis as DateTime Axis,  Both axis has same Start and end Date while ingratiating the DateTime Axis. and both chart have Linear Y-Axis.

During debug came to know that, if I scroll on X-Axis of Plot1, internally i found that - Mouse position gets captured and further converted in the proper date time values (Double) and function ZoomAt(Factor, X) gets called. where X is nothing but the datetime values (Double). 

As the Mouse position get calculated or taken in consideration to calculate the DataPoint values for Zooming the Plot, the position of the Plot2 doesn't get calculated as mouse is not even over the Plot2.

Is it Possible to do in OxyPlot? Please suggest.

Thanks & Regards

Raviraj


oxijen wrote at 2013-05-30 17:13:

Hi;

I'm stuck too in datetime point (Silverlight Project)...
Can you send sample xaml and code?

i'm succeed to getting line chart on screen but my datetime values (x axes) appears in double.

//xaml

xmlns:oxyS="clr-namespace:OxyPlot.Silverlight;assembly=OxyPlot.Silverlight"

<oxyS:Plot x:Name="Plot1" Grid.Row="1" Model="{Binding PlotModel}" Width="1024" Height="768"/>

//c#

var tmp = new PlotModel("Project");

OxyPlot.Series.LineSeries ls = new OxyPlot.Series.LineSeries("Values");

tmp.Series.Add(ls);

PlotModel = tmp;

foreach (var item in List)
{
ls.Points.Add(new OxyPlot.DataPoint(TimeSpanAxis.ToDouble(ts), Convert.ToDouble(olcum[1])));
}

objo wrote at 2013-06-08 11:17:

You need to add a horizontal DateTimeAxis, otherwise you will get a LinearAxis by default.

Panning and Zooming

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

JuergenD wrote at 2012-11-07 15:51:

Hi, thanks for this great Plot-Library!

I have a question about panning and zooming charts. I have a time series with data for every day for about ten years. I created a simple line chart with this data and everything looks nice. But I have a problem with the zoom/pan feature. 

Using the Mousewheel or the +/- Key zooms the chart in both directions (x and y axis). But I need the zoom only on the x-axis and the y-axis should scale itself automatically by the new min/max values inside the chart window. 

Also panning the chart left/right with the cursor keys should rescale the y-axis.

Is this possible?

Best Regards
Juergen 


objo wrote at 2012-11-07 16:15:

Sorry, this is not supported 'out of the box'.

You could subscribe to the x-axis change event, then find the minimum and maximum y-values for the visible part of the curve (you have to write this yourself).
Then update the minimum and maximum properties of the y-axis and refresh the plot.

This should work for both mouse and keyboard events.


JuergenD wrote at 2012-11-08 09:31:

Oh wow, that was quick :-) Thanks for your fast response.

I will try to add your suggestions to my code. Thanks for your help.


JuergenD wrote at 2012-11-08 13:22:

Ok, I was playing around with the code but without success. How can I update the min/max Values of the y-axis?

I can access the min/max DateTime Values from the visible range inside the change event like so

void xAxisDateTime_AxisChanged(object sender, AxisChangedEventArgs e) {
    DateTimeAxis axis = sender as DateTimeAxis;
    DateTime dtMax = DateTime.FromOADate(axis.ActualMaximum);
    DateTime dtMin = DateTime.FromOADate(axis.ActualMinimum);

But when I try to update the min/max values of the y-axis with new values I already retrieved from my data:

myYAxis.Minimum = GetMin(dtMin, dtMax);
myYAxis.Maximum = GetMax(dtMin, dtMax);
myPlot.RefreshPlot(true);

nothing happens. How can I refresh the chart?
By the way, I am using class variables (myPlot, myYAxis) to access the plot components. Is it possible to get access to the components via the "sender" object? I am in the X-Axis event handler. How can I access the Y-Axis or the series of my plotmodel without using class variables?

Best Regards
Juergen 


JohnnyPP wrote at 2012-11-13 21:15:

Hello,

 

what is the status of this thread? I am also very interested in the feature that zooms only the x-axis and the y-axis scales itself automatically by the new min/max values inside the chart window.

 

Kind regards,

Johnny 


JuergenD wrote at 2012-11-14 09:48:

@JohnnyPP

The status is unchanged. Unfortunately I got no response from the author anymore.

The current implemented zoom/pan feature feels more like a zoom/pan inside a drawing software like Photoshop. In my opinion it makes no sense to zoom/pan a chart this way. It is pretty useless to see areas of my chart without the function graph or data series. Therefore I would prefer an option to force the chart to show always a piece of my function and disable the possibility to pan or zoom to an area where the function or the dataseries does not exist.

I would need an example or information about how I can change the min/max values for the y-axis and then force a redraw of the chart. It does not work with the method I already tested (see my prev. message). 

Another problem is to get access to the y-axis and the series from inside x-axis event handler. I can use "global" class variables, but this is a bit clumsy...

Please let me know when you get any further information. 

Best Regards,
Juergen 


objo wrote at 2012-11-14 18:36:

The Minimum and Maximum properties are overridden by the ViewMaximum and ViewMinimum properties (which are set when you pan/zoom your axes). You can

a) call Reset() then set Minimum and Maximum on the y-axis

or

b) call Zoom(newMinimum,newMaximum) on the y-axis

Then call RefreshPlot as you do in your code.


JuergenD wrote at 2012-11-15 09:57:

@objo

No need to be sorry, the software is free and I am very grateful for your work :-)

Your last hint was the missing puzzle-piece for my code. I am using variant b and now I can pan the chart on the x-axis and the y-axis and the function plot redraws perfectly. I have to fine tune the performance of my seek min/max method for really large data series, but that should be easy...

Many Thanks for your help

and best regards

Juergen 


JohnnyPP wrote at 2012-11-15 20:20:

Hello Juergen,

 

would it be possible for you to post your solution to the forum? It would help me a lot.

Thanks in advance!

 

Johnny


JuergenD wrote at 2012-11-16 10:00:

@Johnny

My program is rather to big to publish it here. But I wrote a small example, with my "solution". It is not perfect, but it works for me.
Create a new Windows Form Solution named SimpleChart, add  an OxyPlot.WindowsForms.Plot control on your form, change the Layout.Doc property from None to Fill and use my code inside form1.cs.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using OxyPlot;

namespace SimpleChart {
    public partial class Form1 : Form {
        //I am using a small helper class for my date/value pairs
        //providing an IComparable Interface for using BinarySearch
        //in the x-axis change event
        class MyValue : IComparable {
            public DateTime Date { get; set; }
            public double Value { get; set; }
            public MyValue(DateTime d) {
                Date = new DateTime(d.Year, d.Month, d.Day);
            }
            public MyValue(DateTime d, double v) {
                Date = new DateTime(d.Year, d.Month, d.Day);
                Value = v;
            }
            int IComparable.CompareTo(object to) {
                return Date.CompareTo(((MyValue)to).Date);
            }
        }
            
        DateTimeAxis xAxisDateTime;
        LinearAxis yAxisValues;
        List<MyValue> myValues;
        PlotModel plotModel;
        LineSeries lineSeries;

        public Form1() {
            InitializeComponent();

            myValues = new List<MyValue>();
            DateTime startDate = new DateTime(2000, 1, 1);
            double startValue = 100;
            Random r = new Random();
            for (int i = 0; i < 1000; i++, startDate = startDate.AddDays(1), startValue += (r.NextDouble() - 0.5)) {
                myValues.Add(new MyValue(startDate, startValue));
            }

            plotModel = new PlotModel("Chart");

            xAxisDateTime = new DateTimeAxis() { 
                IntervalType = DateTimeIntervalType.Auto, 
                MinorIntervalType = DateTimeIntervalType.Days, 
                MajorGridlineStyle = LineStyle.Solid, 
                MinorGridlineStyle = LineStyle.Dot, 
                CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek, 
                FirstDayOfWeek = DayOfWeek.Monday, 
                Position = AxisPosition.Bottom 
            };
            //Set the min/max values of the x-axis to my min/max date to prevent zoom/pan beyond data series
            xAxisDateTime.AbsoluteMinimum = myValues[0].Date.ToOADate();
            xAxisDateTime.AbsoluteMaximum = myValues[myValues.Count - 1].Date.ToOADate();
            
            //calling user defined event on change
            xAxisDateTime.AxisChanged += xAxisDateTime_AxisChanged;

            yAxisValues = new LinearAxis() { 
                MajorGridlineStyle = LineStyle.Solid, 
                MinorGridlineStyle = LineStyle.Dot 
            };

            plotModel.Axes.Add(xAxisDateTime);
            plotModel.Axes.Add(yAxisValues);

            lineSeries = new LineSeries {
                Title = "Values",
                Color = OxyColor.FromArgb(255, 78, 154, 6),
                MarkerType = MarkerType.None,
                StrokeThickness = 1,
                DataFieldX = "Date",
                DataFieldY = "Value",
                ItemsSource = myValues
            };

            plotModel.Series.Add(lineSeries);
            plot1.Model = plotModel;

        }

        void xAxisDateTime_AxisChanged(object sender, AxisChangedEventArgs e) {
            DateTimeAxis axis = sender as DateTimeAxis;

            //save the current min/max date values
            DateTime dtMax = DateTime.FromOADate(axis.ActualMaximum);
            DateTime dtMin = DateTime.FromOADate(axis.ActualMinimum);

            double minValue = double.MaxValue;
            double maxValue = double.MinValue;

            //BinarySearch, because the xAxisDateTime is sorted
            int idxMin = myValues.BinarySearch(new MyValue(dtMin));
            int idxMax = myValues.BinarySearch(new MyValue(dtMax));

            //if we can not find an exact location (result is negativ) we can use the complement 
            //see BinarySearch help for further explanation
            if (idxMin < 0) idxMin = ~idxMin;
            if (idxMax < 0) idxMax = ~idxMax;

            //find the corresponding min/max values in the selected intervall
            for (int i = idxMin; i < idxMax; i++) {
                minValue = Math.Min(minValue, myValues[i].Value);
                maxValue = Math.Max(maxValue, myValues[i].Value);
            }

            //set y-axis min/max and redraw the chart
            yAxisValues.Zoom(minValue, maxValue);
            plotModel.RefreshPlot(true);
        }
    }
}

When running the program, you have first to zoom (mouse wheel or ctrl-right mouse button) inside the chart to use the x-axis pan feature (drag with right mouse button or use cursor keys), because if it is "unzoomed" you already see the whole chart and cannot pan beyond valid x/y pairs. Ctrl-Double-Click with Right mouse button brings back the whole chart.

Hope that helps
bet regards

Juergen 


endorphing wrote at 2013-10-08 17:18:

I believe there's a property called 'IsZoomEnabled' in the Axis (in the WPF version), that lets you disable zooming in a particular direction.

Gubo wrote at 2014-03-19 10:34:

I think it does not work 100% accurately because instead of DateTime.FromOADate() you should use DateTimeAxis.ToDateTime(). There is a one day difference for some reason.

jackRose wrote at 2014-05-06 13:18:

I think it's very important feature - the zoom only on the x-axis or the y-axis. The best choice +/- for zooming and mouse wheel for panning. I will try to use info from this topic, but I hope it will be supported 'out of the box'. Oxyplot is really fantastic graphic library, but it needs to get this feature.

@objo
In any case thank you for great job!

To switch the axis of a Series

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

heromyth wrote at 2011-08-25 08:39:

It seems it is the only way to switch the axis of a series that is to use the Key property of the axis like these:

            series.XAxisKey = xAxis.Key;
            series.YAxisKey = yAxis.Key;

So, it requires the Key must be defined as a unique string firstly. What happened for switching the axis directly, like these:

            series.XAxis = xAxis;
            series.YAxis = yAxis;

I have nearly 20  X-Axis and a Y-Axis, each series is assocated with a X-Axis and the same Y-Axis.

 

The Points of a series also can't be setted now, then, it's a limitation for using custom storage which implements the interface of IList.

Thanks for using List<IDataPoint> as its inner storage. 


objo wrote at 2011-08-25 09:07:

right, you should use the axis keys to reference axes, I think it is safer than setting the references directly, so I removed that option. 

I reintroduced the DataPointSeries.Points setter again, I see it can be good for performance!

0

Real-time graphs: LineSeries.Points.AddRange VS LineSeries.ItemsSource

Jeong-hun Sin 10 years ago updated by Nick Donais 10 years ago 1
I am upgrading my static graphs application to real-time graphs. My data object (which I wrote, therefore I can change in any way necessary) exposes a property IList<DataPoint>. Now that it is a real-time data, new DataPoints will be appended to it continuously. If I think in WPF way, I think I should bind that property to LineSeries.ItemsSource and let it take care of updates (though I have to call InvalidatePlot()), right? But it seems calling AddRange() with only newly added DataPoints (though I have to separately create such a list each time just to pass it to AddRange) seems to be more efficient; am I correct?

Slightly off-topic but I could not really find a good example of real-time graph with latest version of OxyPlot. In order to implement real-time graphs, I have to periodically call AddRange(), move the visible range of the time axis, and call InvalidatePlot(); am I correct?

 If you could add such an example to the home page, that would be very helpful.