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.
If the collection is bound to an ObservableCollection (or theTickerBuffer from the your example) the lineseries updates correctly but the CategoryXAxis labels (DateTime) do not update until the control is re-sized.
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??
For my implementation I am trying to plot the last X number of seconds of live data that updates at approx 30 Hz . I am adding to the end of the collection and removing from the beginning. Please advise on the best way to implement this.
I have also tried the CategoryDateTimeXAxis instead of the CategoryXAxis but this axis seems to always throw an ArgumentOutOfRange exception.
Was the fix for this bug ever released? If so, which version is it in?
Hi Graham,
Thanks for quick reply. Yes it was the issue I was not notifying property change. Thanks once again.
Hi,
Does your collection implement INotifyCollectionChanged? Could you share a small sample illustrating the incorrect behavior? That would help us identify the problem.
-Graham
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.
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,