I have the label of my Axis tied to a converter that will display values in specific units - ie display 1000000000 as 1.5 or 1500.0.
Within our UI, the users can set the display units and number of decimals for the axis label (these properties are INotifyPropertyChanged) and when they change, we reset the values inside the Converter.
Everything works correctly - EXCEPT, the axis lable changes do not immediatly 'refresh' and we have to resize our application window to see the new axis labels. Is there way to force the xamDataChart (or the axis) to redraw itself. None of the data within the series is changing just the axis label value due to a change in converter properties.
thanks
Rod
Hello Rod,
Tahnk you for your post. I have been looking into it and if I understand correctly you are using a DataTemplate for the Label of the Axis and using a Converter in it, you are displaying the value of the axis in different manner and you wish the values to update after changing properties of your view model that determine the type of the conversion and the number of digits after the decimal poin. If this is correct, I can suggest using a MultiBinding in the DataTempalte and bind to the value of the axis and also to both, unit type and precision properties and in the IMultiValueConverter you can perform the logic for displaying the label’s content. I have created a sample application for you, that shows how you can implement this approach and allow changing the unit type of the Y axis (million or billions) and the number after the decimal points for the labels.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I have tried different scenarios (adding a dependency property to the converter, and multibinding) with no success.
I modified your example and have attached it. The problem I am encountering is my ViewModel the view model contains the Display Properties and the list of data bound to the chart. in my multiconverter, I cant get to the properties correctly.
Take a look and fix the error in my ways - PLEASE
Thank you for your reply. I have been looking into it and I have modified the sample application that you have attached, in order to implement the approach I have described in my previous rely.
Thank you for your reply. I am very glad that you have managed to solve the issue that you were having. Please let me know if you need any further assistance on the matter.
Thanks for the example, I was able to get it functioning late last night in a sample application - but was still having issues with it in our real application. Our application contains a larger heirarchical view model (VMChart contains a XAxisVM and YAxisVM ). For some reason the property change wasnt getting bubbled up correctly. After lots of frustration, I added in a Property Changed event that did nothing more than rethrow the property changed event for YAxisVM! that solved the whole problem.
Thanks for your help. There is a lot of noise related to just this issue on the Internet, lots of people trying to solve it with dependency properties on their converters - but that really didnt work too well and caused other issues. the multibinding is the way to go.
Thanks