In one of my charts I have defined one ScatterSeries bound to an observable collection of data points in my view model
<ig:XamDataChart x:Name="scatterChart" Visibility="Visible" Margin="10" Title="{Binding ChartLabel}" MinHeight="400" MinWidth="400" Grid.Row="1" Grid.ColumnSpan="2" Grid.RowSpan="3" HorizontalZoomable="False" VerticalZoomable="False"> <ig:XamDataChart.Axes> <ig:NumericXAxis x:Name="scatterXAxis" Title="{Binding Captions[LENGTHCAPTION]}" MinimumValue="0" MaximumValue="{Binding MaxXValue}"> <ig:NumericXAxis.LabelSettings> <ig:AxisLabelSettings Location="OutsideBottom" Extent="50" FontSize="10" Visibility="Visible" /> </ig:NumericXAxis.LabelSettings> </ig:NumericXAxis> <ig:NumericYAxis x:Name="scatterYAxis" Title="{Binding Captions[DURATIONCAPTION]}" MinimumValue="0" MaximumValue="{Binding MaxYValue}"> <ig:NumericYAxis.LabelSettings> <ig:AxisLabelSettings Location="OutsideLeft" Extent="50" FontSize="10" Visibility="Visible" /> </ig:NumericYAxis.LabelSettings> </ig:NumericYAxis> </ig:XamDataChart.Axes> <ig:XamDataChart.Series> <ig:ScatterSeries Name="scatter" ItemsSource="{Binding ScatterChartValues}" Visibility="Visible" MarkerType="Automatic" MarkerBrush="Green" XMemberPath="X" YMemberPath="Y" YAxis="{Binding ElementName=scatterYAxis}" XAxis="{Binding ElementName=scatterXAxis}" ShowDefaultTooltip="True"></ig:ScatterSeries> </ig:XamDataChart.Series> </ig:XamDataChart>
The collection of data points is refreshed after user interaction. Change notifications are submitted.
Chart title and axis labels are refreshed as well as axis labels but data points are not positioned where I expect them to be in the plot area. I only see one data point in zero zero position, but tooltip tell me that it actually should have been positioned elsewhere.
Please tell me how I can force plot area refresh.
Hello,
Were you able to update the sample to reproduce the issue so that we can investigate further?
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hi,
I've tried to more closely reproduce your setup. I've attached a modified solution to that effect. In the new solution I am using a ViewModel with an Observable Collection of Class DataPoints. The ItemSource of the series is bound to the appropriate property on the VM which is the DataContext of the View. When the user clicks a button the collection is cleared and 10 new "points" are added. This still seems to work for me.
If you'd like, please feel free to modify this so I can better try to reproduce the behavior you are seeing.
Thanks,
Richard
Senior Software Developer
Infragistics, Inc
Thanks for your response,
Yes, I use 13.2 version. I have downloaded and tested your sample and it works. I can see a couple of differences between your sample and my implementation:
1. My data series is bound to a property in my view model which is data context for the view
2. My data point objects are defined as classes not as structs
3. I have tried to force refresh using RenderSeries, but that had no effect.
May be this can explain the difference in behavior, and may be the scatter series does not like this kind of binding. In another chart I have bound a view model property to a column series. This chart handles refresh as expected.
In my implementation it did exactly the same as you, except for the differences explained. On user action I clear the data point collection and add new data points. I can live with current solution. My trick was to set my view model property to null before I added new data point.
I tried to reproduce your issue; however I was unable to. I've attached a simple solution that changes the series item source on the click of a button. I am running this in 13.2 and was hoping you could confirm the version you are using. If you could isolate your issue in a sample I'd be more than glad to take a deeper look in to it. Lastly, you can call RenderSeries on the series to force it to refresh. I hope this helps.
The chart is placed inside a tab item. If I move to another tab and return then data points are positioned where they are supposed to be. I can also force it to refresh if I set series ItemSource to null before source collection is updated and then set ItemSource once more after source collection is updated.
Do anyone know any better trics?