I have created a XamDataChart that is bound to a real-time data source. I need the x-axis (Date) to update in real-time. Currently the x-axis labels are only updated when the chart is re-sized horizontally. Is there any way to have the x-axis labels update in real-time?
Kevin, does the collection that the XAxis is bound to support INotifyCollectionChanged? Can you post any kind of sample of how you have this configured?
The collection is bound to an ObservableCollection.
Graham, Have you been able to recreate the memory leak problem I pointed out earlier?
If I replace the collection that implements ICollectionChanged with a List that is replaced on each update cycle like you BindingLiveData example from the XamFeatureBrowser as follows:
List<StockMarketDataPoint> newData = new List<StockMarketDataPoint>(); newData.AddRange(_data); this.xmDataChart.DataContext = newData;
The CategoryXAxis labels update correctly but I end up with a large memory leak possibly due to replacing the collection each update cycle??
Kevin,
I'll take a look. The data management of the chart was pretty carefully designed around some Weak Event patterns, but its possible some regression problems worked their way into the release. I'll let you know if I find the root cause of the leak.
-Graham
Unfortunately there are two bugs associated with changing the datacontext with that rapidity, at the moment. One is a fast leak which you can work around with this:
SyncManager.SetSyncSettings( xamDataChart1, new SyncSettings() { SyncChannel = Guid.NewGuid().ToString() });
The other is a slow leak, which, unfortunately, I don't have a work around for you at this time. I would avoid using this approach in any case as it won't be as efficient as simply modifying the existing data source because changing the data source can cause the chart to in-validate and then re-validate itself (not to mention hit these bugs, apparently!). I've created a bug (36483) to track the resolution of these memory leaks.
This problem is giving me a terrible headache. Does anyone know when it will be fixed? Please help me! ㅜ.ㅜ
Hi,
You can reference a bug number when you contact developer support to check the status of a bug. Could you describe the problem you are having so we can be sure its already captured?
Thanks,
Hi Graham,
Thanks for quick reply. Yes it was the issue I was not notifying property change. Thanks once again.
Does your collection implement INotifyCollectionChanged? Could you share a small sample illustrating the incorrect behavior? That would help us identify the problem.
I am also having the same issue of not updating the horizontal labels. I am using categoryXAxis for labels which is binded with a collection which is dynamic and its values are also volatile. In code collection is getting updates but its not visible on the chart surface. Can you please suggest something in this regard.
Thanks.