Charts+Monotouch: How to get the Date from the XAxis.AxisRange.Minimum?


I use NSDate for the XAxis. When I zoomed in I try to get the actual Date (NSDate or DateTime) for the AxisRange.

I tried:

double secsSinceRefTime = ((NSNumber)_mainChart.XAxis.AxisRange.Minimum).DoubleValue;

But this gives me wrong number. I bet I need some scaling or different startTime?

Any idea

Thank you 


Okay I found the answer: As always the answer is in Casting to what you like to have… hehehe

SChartDateTimeAxis axis = (SChartDateTimeAxis)_mainChart.XAxis;
var range = (SChartDateRange)axis.AxisRange;
NSDate min = range.MinimumAsDate;
NSDate max = range.MaximumAsDate;