Would like to place a vertical line at a certain datetime value against the CategoryDateTimeXAxis
So far no luck...
GetScaledValue does not return anything reasonable
Xaml:
<ig:ValueOverlay Axis="{Binding ElementName=xmXAxis}" Thickness="1" Brush="Red">
<ig:ValueOverlay.Value>
<MultiBinding Converter="{StaticResource DateTimeConverter}">
<Binding Path="DateValue"/>
<Binding ElementName="xmXAxis"/>
MultiBinding>
ig:ValueOverlay.Value>
ig:ValueOverlay>
Codebehind
public class DateTimeConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
if (values[0] != null && values[0] is DateTime)
var axis = values[1] as CategoryDateTimeXAxis;
if (axis != null)
//return ((DateTime)values[0]).Ticks;
var chart = axis.SeriesViewer;
return axis.GetScaledValue(((DateTime)values[0]).Ticks, chart.WindowRect, chart.ViewportRect);
}
return null;
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
throw new NotImplementedException();
Thanks
Hello,
Thank you for your post. I have been looking into and I can suggest you use the CategoryDateTimeXAxis’ GetUnscaledValue instead of the GetScaledValue method. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I found this yesterday afternoon and it works.
http://ko.infragistics.com/community/forums/p/75441/381189.aspx