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
635
InfoStrips in xamDataChart
posted

Hello,

We need to manage dynamically  multiple InfoStrips in xamDataChart control (ideally in a ViewModel with the MVVM pattern )

Specifically, here are the blocking points encountered with ChartStripBehaviors :

1. Have the possibility to binding on the properties StartDateString, EndDateString from a source (ideally the DataContext of the main view)

2. Have the possibility to binding on the collection InfoStripCollection to manage multiple InfoStrips dynamically

Any suggestions would be appreciated

Best Regards,

Parents
  • 138253
    Offline posted

    Hello Anis,

    Thank you for your email. I have been looking into the functionality that you have described and I have created custom Info Strip functionality for you, that allows generating the Info Strips by binding to a collection of your ViewModel. I have created a behavior with attached property that allows you to set info strip generator to all X axis of the XamDataChart (NumericXAxis, CategoryXAxis and CategoryDateTimeXAxis). The property is called CustomVerticalInfoStrip and accepts value from type CustomVerticalInfoStrip, which I have defined. The CustomVerticalInfoStrip contains several properties. In order to show the info strips you should set the ItemsSource property to a collection and I can suggest using an ObservableCollection<T> (of collection that implement INotifyCollectionChanged), so the CustomVerticalInfoStrip can detect changes in the collection. Also you should set the StripStartMemeberPath and StripEndMemeberPath to the names of the properties of the items source that determine the start and the end of each Info Strip. For the NumericXAxis, you can set the paths to double or int type properties, for the CategoryDateTimeXAxis, the properties should be from DateTime type and for the CategoryXAxis, you should use double of int properties and the strips will be aligned based on the indexes of the items of the source. For the CatecoryXAxis you can also use double values and for example, if you set star index to .5 the strip will start half way between the firs and the second item. I have created a sample application for you, that shows how you can implement this approach.

    Please let me know if you need any further assistance on the matter.

    CustomBindableInfoStrips.zip
Reply Children