Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
655
Force DataChart to refresh
posted

Hello!

We provide an option to our users to show/hide certain series. This is done by setting visibility of particular series to Visible/Collapsed.

Their ItemsSource is set to ObservableCollection, and sometimes this collection changes. And the problem happens when doing this:

1) User hides one of the series (sets Visibility to Collapsed)

2) Series changes

3) User sets Visibility to Visible

After this, series isn't visible! This problem happens only with the series that have been hidden, others are changing fine.

In fact, data is bound correctly, but the chart doesn't draw this series for some reason. This is confirmed by the fact that forcing the chart to refresh (e.g. zooming) instantly shows that missing series.

So, why is this happening? Is there any way to force XamDataChart to refresh explicitly?

Currently, I use a workaround: I set visibility to Collapsed, give time to draw a series using Windows.Forms.Application.DoEvents() (without this it wouldn't work), change series, and then set Visibility to Collapsed, but it isn't acceptable because the missing series "blinks" for a moment during this.

Best regards, Vasily.

Parents Reply Children