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
|
Hello, Please find attached a zipped demo project (just remove .txt). I currently bind the ChartAxis properties Minimum, Maximum, ActualMaximum, ActualMinimum to viewmodel properties. They are all set to TwoWay binding. Start the application.
If there is "NO" binding set for the ActualMaximum and ActualMinimum then when we set the Minimum and Maximum axis values through the binding the data gets displayed properly scaled to the chart. Question: Shouldn't the chart also automatically scale itself when we bind the ActualMaximum and ActualMinimum as when we do not bind the ActualMaximum and ActualMinimum? Or is it that whenever we bind Maximum, Minimum, ActualMaximum and ActualMinimum we have set all 4 values when first loading the data. Thanks Oscar p.s. The xaml has different chart binding scenarios which you can try and see the different behaviours. (see commented out parts.) |
|
|
Hi Oscar, Thanks for the repro project. Binding ActualMinimum and ActualMaximum gives you full control over those values. In the repro project that you sent, you are initially setting those values to zero, and so when you load the chart, the ActualMin and ActualMax values get set to zero as you have specified. To answer your question - When you bind all 4 values, you'll want to set all 4 values to be what you want. I hope that explains it. Please let me know if you have further questions about this and I'll help you out. -Jason Fauchelle |
|
|
Thanks Jason. I'm just curious if we only bind the Minimum and Maximum values but not the ActualMinimum and ActualMaximum and load the data set the Minimum and Maximum everything gets displayed properly. How does the chartaxis know that the ActualMinimum and ActualMaximum are not bound or does the chartaxis by default sets the ActualMinimum and ActualMaximum to the Minimum and Maximum values when the Minimum and Maximum values change and afterward they get overwritten by the bound ActualMinimum and ActualMaximum? Oscar |
|
|
Hi Oscar, Basically, whenever the ActualMinimum and ActualMaximum properties are set internally, the ChartAxis sets a flag to say that they are being set by some internal logic. When the ActualMin/Max properties are set outside the chart control - be it a binding, or directly setting the property - the internal flag is not set, and this is an indication that something outside the chart want's to take control of those values. So when those properties are set by you, another flag is set to disable the auto-viewport logic - that's the bit that sets ActualMin and ActualMax to be the min/max values when something changes. In fact, this flag is public - ChartAxis.IsAutoViewportEnabled - this property and the surrounding logic were added to solve other ActualMin/Max issues that you had in the past where the chart control was updating the viewport internally and overriding your bindings. Hope that makes sense, let me know if you have further questions. -Jason Fauchelle |
|
|
Yes this makes sense. Thank you very much Jason for taking the time to explain. This helps give me a bigger picture and understand how it all connects. Cheers Oscar |
|