12-07-2017 07:20 PM - edited 12-07-2017 07:21 PM
Just wanted to provide an update.
I figured out another way to get my desired behavior that does not involve the use of a PagedChart adjuster or a customer plot renderer. I was unable to adopt your solution into my application and did not want to spend anymore time figuring out why. Here is a brief explanation of my solution.
My graph's DataSource is binded to a AnalogWaveform<double>[] read-only property on my view model.
<ni:Graph x:Name="Graph" Margin="0" HorizontalAlignment="Stretch" Height="600" DataSource="{Binding InfoCollections, Mode=OneWay}" PlotAreaBackground="Beige">
public AnalogWaveform<double>[] InfoCollections { get { return AnalogWaveform<double>.FromArray2D(_classFromModel.InfoCollections); } }
I realized that I do not need the "shifting in time" behavior that is provided by the paged chart. So, I added a 2-dimensional (InfoCollections) array to my _classFromModel. InfoCollections is a 2 by (whatever my x axis range is) array that holds the data I want to display on the graph. Everytime I read new data from the serial port, I add it to InfoCollections and increment it's associated index that keeps track of where to put incoming data. If the index is greater or equal to whatever my x axis range is I reset the index back to 0 which effectively provides the "wraparound" behavior that I was looking for in the first place.
Also, I have my Adjuster property for my AxisDouble set to None in my XAML and I am now just using standard line plot renderers.
<ni:AxisDouble x:Name="XAxisRange" Orientation="Horizontal" Range="{Binding XAxisRange, Mode=OneWay}" Adjuster="None"/>
Thanks for the help!
12-08-2017 09:37 AM
Sorry I couldn't be of more help. Glad you found an approach that fit your needs!
12-08-2017 02:04 PM
No apology necessary, thanks again for your help.