We have a client where we are showing a RadCartesianChart where the horizontal axis has a year's worth of weekly data (53 data points).
The client is wishing to model a feature present in a legacy application built against ChartFX where the user is able to click a button to a preset Zoom and PanOffest of a quarter's worth of data (13 datapoints).
I've created a spike where I'm displaying the Zoom and PanOffset, and where I can set the values as well - here's where I'm at now. Problem is that depending on the monitor size or whether the application is maximized or windowed at some custom size, the PanOffset value can differ.
I'm assuming I somehow need to get the width of the chart, set the Zoom to (4,1) and the PanOffset would need to be calculated based upon the width of the chart or maybe just the chart axis? HorizontalAxis.ActualWidth appears to be returning zero.
For example, in the view model command handler for clicking the Q2 button I have - but again - these hard-coded values don't work properly if the application is a different size.
Can you give me some direction on this?
The client is wishing to model a feature present in a legacy application built against ChartFX where the user is able to click a button to a preset Zoom and PanOffest of a quarter's worth of data (13 datapoints).
I've created a spike where I'm displaying the Zoom and PanOffset, and where I can set the values as well - here's where I'm at now. Problem is that depending on the monitor size or whether the application is maximized or windowed at some custom size, the PanOffset value can differ.
I'm assuming I somehow need to get the width of the chart, set the Zoom to (4,1) and the PanOffset would need to be calculated based upon the width of the chart or maybe just the chart axis? HorizontalAxis.ActualWidth appears to be returning zero.
For example, in the view model command handler for clicking the Q2 button I have - but again - these hard-coded values don't work properly if the application is a different size.
#region PresetQuarter2Commandprivate readonly ICommand _PresetQuarter2Command;/// <summary>/// Command binding./// </summary>public ICommand PresetQuarter2Command { get { return _PresetQuarter2Command; } }/// <summary>/// Action method./// </summary>public void PresetQuarter2(){ var zoomSize = new Size(3.79, 1); var pointOffset = new Point(-1138.65, 0); this.Zoom = zoomSize; this.PanOffset = pointOffset;}/// <summary>/// CanExecute method./// </summary>/// <returns>True if the command can be executed, otherwise false.</returns>public bool CanPresetQuarter2(){ return true; // Example of how to trigger the calling of this method //((DelegateCommand)PresetQuarter2Command).RaiseCanExecuteChanged();}#endregionCan you give me some direction on this?