I have a Xamdatachart bound to a datatable, the x axis is datetime. I am using the XamZoombar to zoom in on the data. This i working fine. However I need to run a function which marks the data being shown in the chart with a value. My question is how do i find the start and end date of the visible data in the Xamdatachart. If i can find these dates i can then pass them to my function.
Pete,
I am just checking if my last reply was helpful for you.
If you require any further assistance, feel free to ask.
Hello Pete,
I have been looking into your scenario and I could suggest you using GetUnscaledValue method in order to get maximum and minimum displayed datetime value. Here is a code snippet how this could be achieved:
CategoryDateTimeXAxis xAxis = ((CategoryDateTimeXAxis)this.chart.Axes["XAxis"]);
var viewport = new Rect(0, 0, xAxis.ActualWidth, chart.Axes.OfType<NumericYAxis>().First().ActualHeight);
var windowRect = this.chart.WindowRect;
var minVal = xAxis.GetUnscaledValue(0, new ScalerParams(windowRect, viewport, xAxis.IsInverted));
DateTime min = new DateTime((long)minVal);
var maxVal = xAxis.GetUnscaledValue(xAxis.ActualWidth, new ScalerParams(windowRect, viewport, xAxis.IsInverted));
DateTime max = new DateTime((long)maxVal);
I hope this helps. If you have any questions on the matter, do not hesitate to ask.