This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I got an example from another thread "http://www.mindscapehq.com/forums/thread/4818" to make strip chart by updating ActualMaximum property during the chart updating. But what's different from that example is that I'm using MVVM pattern, I update ActualMaximum from my viewModel by data binding during the chart updating. But something is weird that it only works at the initialization of my chart. but not work during the line updating. Thanks Jason, But I've try that way already, it seems that's not the case. Below is my code snippet, maybe there is something you can find, Thanks a lot.
The viewModel goes like below:
And below is the snippet of updating ActualMaximum property, it's following your example of strip chart:
|
|
|
Hello Yaron To fix this, please try make your ActualMaximum property on your view model both readable and writeable (get and set). Then use a TwoWay binding when binding the axis to your ActualMaximum property. The problem is that the axis has some internal logic that can modify the ActualMaximum property as a result of ensuring constraints or performing operations such as zooming. Unfortunately in WPF, doing this causes any bindings on the ChartAxis.ActualMaximum property to be overwritten - unless there is a TwoWay binding. Jason Fauchelle |
|
|
Thank Jason, But I've tried that way you suggested, it seems not the case. I don't know maybe I've missed some flag configuration or something else? And I've appended my code snippet, maybe you can find something. Thanks a lot. |
|
|
Thanks for the code Yaron I could not find any issues with the code you posted. Could there be an issue in your onPropertyChanged method? I have attached an updated version of the StripCharting demo that uses an MVVM approach. The functionality all works fine. If you want to run the sample to see it working, make sure to add a reference to your copy of the Mindscape.WpfElements.dll. See if you can use this sample to find the issue in your project. Or if you can send me a full sample of what you have so far, I can investigate it for you. Jason Fauchelle |
|