Have the following XAML code for a ToolWindow, the window appears but the chart is blank...Using the debugger to examine the xamDataChart object all Itemsources and setting are correct. Can't understand what is out of alignment.
<Window x:Class="PaddockGRASP.Views.GraphWindow"
xmlns:ig="http://schemas.infragistics.com/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
Title="Results Graph Window" Height="300" Width="600"
ShowInTaskbar="False" WindowStyle="ToolWindow"
DataContext="{Binding Main, Source={StaticResource Locator}}">
<Window.Resources>
<ig:StringFormatConverter x:Key="StringFormatConverter" />
<DataTemplate DataType="{x:Type System:DateTime}">
<TextBlock Text="{Binding StringFormat={}{0:MMM yyyy}}"/>
</DataTemplate>
<SolidColorBrush x:Key="StripBrush" Color="#7FC1C1C1" />
<SolidColorBrush x:Key="StrokeBrush" Color="LightGray" />
<Style x:Key="CategoryXAxisElementStyle" TargetType="ig:CategoryDateTimeXAxis">
<Setter Property="Interval" Value="12" />
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="Strip" Value="{StaticResource StripBrush}" />
<Setter Property="Stroke" Value="{StaticResource StrokeBrush}" />
<Setter Property="StrokeThickness" Value="12" />
<Setter Property="MajorStroke" Value="{StaticResource StrokeBrush}" />
<Setter Property="MajorStrokeThickness" Value="0.5" />
<Setter Property="MinorStroke" Value="{StaticResource StrokeBrush}" />
<Setter Property="MinorStrokeThickness" Value="0.075" />
</Style>
<Style x:Key="NumericYAxisElementStyle" TargetType="ig:NumericYAxis">
<Setter Property="Strip" Value="Transparent" />
<Setter Property="StrokeThickness" Value="2.5" />
<Setter Property="MinorStrokeThickness" Value="0.125" />
<Style x:Key="CrosshairStyle" TargetType="Line">
<Setter Property="Stroke" Value="Black" />
<Setter Property="Opacity" Value="0.7" />
<Setter Property="StrokeThickness" Value="2.0" />
</Window.Resources>
<Grid>
<ig:XamDataChart x:Name="xamDataChart"
HorizontalZoomable="True"
HorizontalZoombarVisibility="Visible"
CrosshairLineStyle="{StaticResource CrosshairStyle}"
CrosshairVisibility="Visible" Margin="2,0,2,2" Padding="0" MouseRightButtonDown="xamDataChart_MouseRightButtonDown">
<ig:XamDataChart.Axes>
<ig:CategoryDateTimeXAxis x:Name="xmXAxis"
ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}"
DateTimeMemberPath="Date"
Label="{}{Date:MMM yyyy}"
Style="{StaticResource CategoryXAxisElementStyle}">
<ig:CategoryDateTimeXAxis.LabelSettings>
<ig:AxisLabelSettings FontFamily="Segoe UI" FontSize="10" Foreground="Black" FontWeight="Bold" />
</ig:CategoryDateTimeXAxis.LabelSettings>
</ig:CategoryDateTimeXAxis>
<ig:NumericYAxis x:Name="xmYAxis"
Style="{StaticResource NumericYAxisElementStyle}">
<ig:NumericYAxis.LabelSettings>
<ig:AxisLabelSettings FontFamily="Segoe UI" FontSize="10" Foreground="Black" FontWeight="Bold"
Location="OutsideLeft" />
</ig:NumericYAxis.LabelSettings>
</ig:NumericYAxis>
<ig:NumericYAxis x:Name="xmYAxis2">
Location="OutsideRight" />
</ig:XamDataChart.Axes>
<ig:XamDataChart.Series>
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis}" ValueMemberPath="Rain" MarkerType="None" Title="Monthly Rainfall"
TrendLineType="SimpleAverage"
TrendLineBrush="LightCoral"
TrendLinePeriod="{Binding ElementName=sldTrendLinePeriod, Path=Value, Converter={StaticResource StringFormatConverter}, ConverterParameter='0'}"
TrendLineThickness="2"/>
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis}" ValueMemberPath="TSDM" MarkerType="None" Title="TSDM"/>
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis}" ValueMemberPath="Growth" MarkerType="None" Title="Growth" />
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis2}" ValueMemberPath="LWG" MarkerType="None" Title="Live Weight Gain" />
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis2}" ValueMemberPath="SoilLoss" MarkerType="None" Title="Soil Loss" />
<ig:LineSeries ItemsSource="{Binding Path=Project.ActiveScenario.ActiveResults}" XAxis="{Binding ElementName=xmXAxis}" YAxis="{Binding ElementName=xmYAxis2}" ValueMemberPath="RadCover" MarkerType="None" Title="Radiation Cover" />
</ig:XamDataChart.Series>
</ig:XamDataChart>
<StackPanel Orientation="Vertical" Margin="229,0,183,226" HorizontalAlignment="Center" Width="166">
<TextBlock Text="TrendLine Period" Margin="2" HorizontalAlignment="Center" FontSize="10" FontWeight="Bold" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Slider x:Name="sldTrendLinePeriod" Width="120" Value="12" Minimum="1" Maximum="24" TickFrequency="24" TickPlacement="BottomRight" HorizontalAlignment="Left" Height="16" SmallChange="1" SnapsToDevicePixels="False" />
<TextBlock Width="30" Text="{Binding Value, ConverterParameter=0, Converter={StaticResource StringFormatConverter}, ElementName=sldTrendLinePeriod}" TextAlignment="Center" HorizontalAlignment="Right" />
</StackPanel>
</Grid>
</
Window>
the binding is to
public
ObservableCollection<GRASPRecord> ActiveResults
{
get { return _activeResults; }
}
and
[
Serializable]
IgnoreFirst(1)]
FixedLengthRecord()]
public class GRASPRecord
FieldFixedLength(8)]
FieldConverter(ConverterKind.Date, "yyyyMMdd")]
public DateTime Date;
public float Rain;
public float TSDM;
public float Growth;
public float Cover;
public float Runoff;
public float SoilLoss;
public float LWG;
public float Beasts;
public float Eaten;
public float RadCover;
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks that solved the problem
I have been looking into your sample and I can say that the everything is correct, but the XamDataChart Axis cannot be bound to Fields, like in your case, so my suggestion is to reorganize your data and use public Properties instead of Fields.
Hope this helps you.
Ok,
have produced a isolated example of the problem, please find attached
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Feel free to write me if you have further questions.