This is a migrated thread and some comments may be shown as answers.

Value does not fall within the expected range

3 Answers 279 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Craig Ellis
Top achievements
Rank 1
Craig Ellis asked on 15 Sep 2010, 05:36 PM

I've been struggling with this error for a few days now and am really really stumped.

I have a XAML page that loads just fine in VS2010 Designer and also in Expression Blend. I needed to add a Telerik RadChart control to that page and within our application,  we had a chart all set up.

All I did was copy the chart from the original XAML and pasted it into my new XAML page. Once I did that, the XAML does not open up in EB anymore nor does it open up in VS2010 Designer. The error I get is the standard:

ArgumentException was thrown due to document error: Value does not fall within the expected range.

Once I remove the RadChart that I pasted into the XAML, everything goes back to being normal.

This is the RadChart that I pasted into the XAML.

Any help would be greatly appreciated.

 

 

<telerikChart:RadChart ItemsSource="{Binding Path=Securities}" UseDefaultLayout="False" Height="250" Width="250">

 

<telerikChart:RadChart.PaletteBrushes>

 

<SolidColorBrush Color="#ffd200" />

 

<SolidColorBrush Color="#6c91b6" />

 

<SolidColorBrush Color="#012141" />

 

<SolidColorBrush Color="#ffb862" />

 

<SolidColorBrush Color="#ff8600" />

 

<SolidColorBrush Color="#828282" />

 

<SolidColorBrush Color="#a65151" />

 

<SolidColorBrush Color="#7e0001" />

 

<SolidColorBrush Color="#63b16e" />

 

<SolidColorBrush Color="#0f631b" />

 

</telerikChart:RadChart.PaletteBrushes>

 

<telerikChart:RadChart.SeriesMappings>

 

<telerikCharting:SeriesMapping x:Name="benchmarkPieChart" ChartAreaName="PieChartArea" >

 

<telerikCharting:SeriesMapping.FilterDescriptors>

 

<telerikCharting:ChartFilterDescriptor Member="BenchmarkSsmWeight"

 

Operator="IsGreaterThan"

 

Value="0.005" />

 

</telerikCharting:SeriesMapping.FilterDescriptors>

 

<telerikCharting:SeriesMapping.SeriesDefinition>

 

<telerikCharting:PieSeriesDefinition ShowZeroValuesLabels="False" ShowItemToolTips="True" ShowItemLabels="True"></telerikCharting:PieSeriesDefinition>

 

</telerikCharting:SeriesMapping.SeriesDefinition>

 

<telerikCharting:SeriesMapping.ItemMappings>

 

<telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="BenchmarkName"></telerikCharting:ItemMapping>

 

<telerikCharting:ItemMapping DataPointMember="YValue" FieldName="BenchmarkSsmWeight" ></telerikCharting:ItemMapping>

 

<telerikCharting:ItemMapping DataPointMember="Tooltip" FieldName="BenchmarkName"></telerikCharting:ItemMapping>

 

<telerikCharting:ItemMapping DataPointMember="LegendLabel" FieldName="BenchmarkName"></telerikCharting:ItemMapping>

 

</telerikCharting:SeriesMapping.ItemMappings>

 

</telerikCharting:SeriesMapping>

 

</telerikChart:RadChart.SeriesMappings>

 

<Grid>

 

<Grid.ColumnDefinitions>

 

<ColumnDefinition Width="*" />

 

</Grid.ColumnDefinitions>

 

<telerikCharting:ChartArea Grid.Column="0" x:Name="PieChartArea" Margin="5,5,5,5" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalAlignment="Top"/>

 

 

<telerikCharting:ChartLegend Grid.Column="1" x:Name="BenchmarkPieLegend" Header="" VerticalAlignment="Top" LegendItemStyle="{StaticResource ChartLegendItemStyle}" Background="Transparent" BorderBrush="Transparent" FontSize="8"/>

 

</Grid>

 

</telerikChart:RadChart>

3 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 20 Sep 2010, 02:36 PM
Hi Craig Ellis,

This issue was not reproduced on our end. I just did copy/paste of your xaml to a page containing a few elements and the designer loaded just fine. Could you please specify the exact version of your assemblies and, if possible, send us an application where the problem is reproducible ?

Kind regards,
Ryan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Craig Ellis
Top achievements
Rank 1
answered on 21 Sep 2010, 05:30 PM
Thanks for the reply.

Telerik.Windows.Controls
Version - 2010.2.812.1040
Runtime Version v2.0.50727

Telerik.Windows.Controls.Charting
Version - 2010.2.812.1040
Runtime Version v2.0.50727

I don't think I can send the entire application but I can post the entire XAML that we are trying to load if that might help.

I am running Windows Server 2008 R2 Enterprise
Visual Studio 2010 Version 10.0.30319.1 RTMRel
Expression Belnd 4 + SketchFlow Version 4.0.20525.0

The following is the entire XAML

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
mc:Ignorable="d"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
xmlns:local="clr-namespace:PIMCO.Optimizer.PrintControls"
xmlns:optzr="clr-namespace:PIMCO.Optimizer"
x:Class="PIMCO.Optimizer.PrintControls.BenchmarkPage"
d:DesignHeight="300" d:DesignWidth="400" Width="1200" Height="950">

<UserControl.Resources>
<Style x:Key="ChartLegendItemStyle"
TargetType="telerikCharting:ChartLegendItem">
<Setter Property="Foreground"
Value="White" />
<Setter Property="FontSize"
Value="8" />
</Style>

</UserControl.Resources>


<Grid x:Name="LayoutRoot" Background="#FF224773">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid x:Name="gridHeader" Grid.Row="0" Background="#FF00203F" Height="60" Margin="0" VerticalAlignment="Top" d:LayoutOverrides="Height">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="30,4,0,4" HorizontalAlignment="Left" >
<TextBlock Text="BENCHMARK - " Margin="0,0,5,0" Foreground="#FFFF8A00" VerticalAlignment="Center" FontSize="15" FontWeight="Bold" />
<TextBlock Text="{Binding BenchmarkName}" Foreground="#FFFF8A00" VerticalAlignment="Center" FontSize="13" FontWeight="Bold" />
</StackPanel>
<Image Source="/PIMCO.Optimizer;component/images/Optimizer_Logo.png" Height="50" Margin="0,5,30,5" Width="165" d:LayoutOverrides="VerticalMargin" HorizontalAlignment="Right" Grid.Column="1"/>
</Grid>
<Border x:Name="bdrContent" Grid.Row="1" BorderThickness="0" Margin="10" Background="#FF3C6697" CornerRadius="10" Padding="5" Width="1050" Height="650">
<Grid x:Name="gridContent" Grid.Row="1" Width="1050" Height="650">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border x:Name="bdrCashflowDiscountCurve" Grid.Row="0" Grid.Column="0" BorderThickness="0" CornerRadius="10" Margin="5" Padding="5" Background="#FF224773">
<Grid x:Name="gridCashflowDiscountCurve" Grid.Row="0" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="CASHFLOW &amp; DISCOUNT CURVE" Grid.Row="0" Grid.Column="0" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Margin="10,10,0,0" />
<Border x:Name="bdrCurveChart" Grid.Row="1" Grid.Column="0" BorderThickness="0" Margin="5" CornerRadius="10" Background="#FF3C6697" Padding="5">
<optzr:LiabilityCurves x:Name="curveChart" Width="475" Height="200" Curve="{Binding Path=Curve}" IsPrintView="True"/>
</Border>
</Grid>
</Border>
<Border x:Name="bdrLiabilityBenchmarkRiskComparison" Grid.Row="1" Grid.Column="0" BorderThickness="0" CornerRadius="10" Margin="5" Padding="5" Background="#FF224773">
<Grid x:Name="gridLiabilityBenchmarkRiskComparison">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="LIABILITY vs BENCHMARK RISK COMPARISON" Grid.Row="0" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Margin="10,10,0,0" />
<Border x:Name="bdrRiskChart" BorderThickness="0" Margin="5" Grid.Row="1" CornerRadius="10" Background="#FF3C6697" Padding="5">
<telerikChart:RadChart x:Name="benchmarkRiskComparison" ItemsSource="{Binding Path=RiskConstraints}" UseDefaultLayout="False" Background="Transparent" BorderBrush="Transparent" Height="150" Width="450">
<telerikChart:RadChart.PaletteBrushes>
<SolidColorBrush Color="#022242" />
<SolidColorBrush Color="#ff8600" />
</telerikChart:RadChart.PaletteBrushes>

<telerikChart:RadChart.SeriesMappings>

<telerikCharting:SeriesMapping x:Name="liabiltyMapping" ChartAreaName="riskChartArea" >
<telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:ChartFilterDescriptor Member="IsOptimized"
Operator="IsNotEqualTo"
Value="False" />
</telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:SeriesMapping.SeriesDefinition >
<telerikCharting:BarSeriesDefinition ShowZeroValuesLabels="False" ShowItemLabels="False"></telerikCharting:BarSeriesDefinition>
</telerikCharting:SeriesMapping.SeriesDefinition>
<telerikCharting:SeriesMapping.ItemMappings >
<telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="ConstraintName" />
<telerikCharting:ItemMapping DataPointMember="YValue" FieldName="LiabilityValue"/>
</telerikCharting:SeriesMapping.ItemMappings>
</telerikCharting:SeriesMapping>

<telerikCharting:SeriesMapping x:Name="benchmarkMapping" ChartAreaName="riskChartArea" >
<telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:ChartFilterDescriptor Member="IsOptimized"
Operator="IsNotEqualTo"
Value="False" />
</telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:SeriesMapping.SeriesDefinition >
<telerikCharting:BarSeriesDefinition ShowZeroValuesLabels="False" ShowItemLabels="False"></telerikCharting:BarSeriesDefinition>
</telerikCharting:SeriesMapping.SeriesDefinition>
<telerikCharting:SeriesMapping.ItemMappings >
<telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="ConstraintName" />
<telerikCharting:ItemMapping DataPointMember="YValue" FieldName="BenchmarkValue"/>
</telerikCharting:SeriesMapping.ItemMappings>
</telerikCharting:SeriesMapping>

</telerikChart:RadChart.SeriesMappings>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<telerikCharting:ChartArea x:Name="riskChartArea" >
<telerikCharting:ChartArea.AxisX>
<telerikCharting:AxisX LayoutMode="Between" AutoRange="True" />
</telerikCharting:ChartArea.AxisX>
</telerikCharting:ChartArea>
</Grid>
</telerikChart:RadChart>
</Border>
</Grid>
</Border>
<Border x:Name="bdrSensitivityAnalysis" Grid.Row="2" Grid.Column="0" BorderThickness="0" CornerRadius="10" Margin="10" Padding="5" Background="#FF224773">
<Grid x:Name="grdSensitivityAnalysis" Grid.Row="2" Grid.Column="0" >
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="SENSITIVITY ANALYSIS" Grid.Row="0" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Margin="10,10,0,0" />
<Border BorderThickness="0" Margin="5" Grid.Row="1" CornerRadius="10" Background="#FF8196AE" Padding="5">
<local:InterestRateSensitivity x:Name="sensitivityChart" Margin="0" DataContext="{Binding}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Width="450" Height="150"/>
</Border>
</Grid>
</Border>
<Border x:Name="bdrBenchmarkPercentages" Grid.Row="0" Grid.Column="1" BorderThickness="0" CornerRadius="10" Margin="5" Padding="5" Background="#FF224773" >
<Grid x:Name="gridBenchmarkPercentages" Grid.Row="0" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="BENCHMARK PERCENTAGES" Grid.Row="0" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Margin="10,10,0,0" />
<Border x:Name="bdrPieChart" Grid.Row="1" BorderThickness="0" Margin="5" CornerRadius="10" Background="#FF3C6697" Padding="5">
<telerikChart:RadChart ItemsSource="{Binding Path=Securities}" UseDefaultLayout="False" Height="200" Width="300" HorizontalAlignment="Center" VerticalAlignment="Center" >
<telerikChart:RadChart.PaletteBrushes>
<SolidColorBrush Color="#ffd200" />
<SolidColorBrush Color="#6c91b6" />
<SolidColorBrush Color="#012141" />
<SolidColorBrush Color="#ffb862" />
<SolidColorBrush Color="#ff8600" />
<SolidColorBrush Color="#828282" />
<SolidColorBrush Color="#a65151" />
<SolidColorBrush Color="#7e0001" />
<SolidColorBrush Color="#63b16e" />
<SolidColorBrush Color="#0f631b" />
</telerikChart:RadChart.PaletteBrushes>
<telerikChart:RadChart.SeriesMappings>
<telerikCharting:SeriesMapping x:Name="benchmarkPieChart" ChartAreaName="PieChartArea" >
<telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:ChartFilterDescriptor Member="BenchmarkSsmWeight"
Operator="IsGreaterThan"
Value="0.005" />
</telerikCharting:SeriesMapping.FilterDescriptors>
<telerikCharting:SeriesMapping.SeriesDefinition>
<telerikCharting:PieSeriesDefinition ShowZeroValuesLabels="False" ShowItemToolTips="True" ShowItemLabels="True" RadiusFactor="0.5" >
<telerikCharting:PieSeriesDefinition.LabelSettings>
<telerikCharting:RadialLabelSettings ShowConnectors="True" SpiderModeEnabled="True" />
</telerikCharting:PieSeriesDefinition.LabelSettings>

</telerikCharting:PieSeriesDefinition>
</telerikCharting:SeriesMapping.SeriesDefinition>
<telerikCharting:SeriesMapping.ItemMappings >
<telerikCharting:ItemMapping DataPointMember="XCategory" FieldName="BenchmarkName"></telerikCharting:ItemMapping>
<telerikCharting:ItemMapping DataPointMember="YValue" FieldName="BenchmarkSsmWeight" ></telerikCharting:ItemMapping>
<telerikCharting:ItemMapping DataPointMember="Tooltip" FieldName="BenchmarkName"></telerikCharting:ItemMapping>
<telerikCharting:ItemMapping DataPointMember="LegendLabel" FieldName="BenchmarkName"></telerikCharting:ItemMapping>
</telerikCharting:SeriesMapping.ItemMappings>
</telerikCharting:SeriesMapping>
</telerikChart:RadChart.SeriesMappings>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<telerikCharting:ChartArea Grid.Column="0" x:Name="PieChartArea" Margin="5,5,5,5" HorizontalAlignment="Left" HorizontalContentAlignment="Left" VerticalAlignment="Top" LabelFormatBehavior="HumanReadable" SmartLabelsEnabled="True"/>

</Grid>
</telerikChart:RadChart>
</Border>
</Grid>
</Border>
<Border x:Name="bdrBenchmarkTabularResults" Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" BorderThickness="0" CornerRadius="10" Margin="5" Padding="5" Background="#FF224773">
<Grid x:Name="gridTabularResults" Grid.Row="1" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="BENCHMARK TABULAR RESULTS" Grid.Row="0" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" FontWeight="Bold" Margin="10,10,0,0" />
<Border x:Name="bdrBenchmarkRisks" Grid.Row="1" BorderThickness="0" Margin="5" CornerRadius="10" Background="#FF3C6697" Padding="5" Height="480">
<ListBox x:Name="benchmarkRisks" Grid.Row="1" Margin="0" BorderThickness="0" ItemsSource="{Binding Securities}" Background="Transparent" Foreground="White"
ItemContainerStyle="{StaticResource PrintListBoxItemStyle}"
FontSize="8" VerticalAlignment="Top" >
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<telerik:RadWrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>

<ListBox.ItemTemplate>
<DataTemplate>

<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock>
<Run FontWeight="Bold" FontSize="9" Text="{Binding Path=BenchmarkName, StringFormat=' {0} - '}" Foreground="#FFFF8A00"/>
<Run FontWeight="Bold" FontSize="9" Text="{Binding Path=BenchmarkSsmWeight, StringFormat=' {0:P2}'}" Foreground="#FFFF8A00"/>
</TextBlock>

<ListBox BorderThickness="0" x:Name="securityRisks" Grid.Row="1" ItemsSource="{Binding BenchmarkRiskMeasures}" Background="Transparent" Foreground="White"
ItemContainerStyle="{StaticResource PrintListBoxItemStyle}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<telerik:RadWrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>

<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0" >
<TextBlock>
<Run FontSize="8" Text="{Binding Path=RiskMeasureName,StringFormat=' {0}:'}" />
<Run FontSize="8" Text="{Binding Path=RiskMeasureValue, StringFormat='{}{0:N2}'}" />
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>

</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
</Grid>
</Border>
</Grid>
</Border>
<Grid x:Name="gridFooter" Grid.Row="2" Background="#FF00203F" Height="50" Margin="0" VerticalAlignment="Bottom" d:LayoutOverrides="Height">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="/PIMCO.Optimizer;component/images/pimco_logo.png" Margin="10,10,30,10" HorizontalAlignment="Right" Width="150" Height="40" Grid.Column="1"/>
<TextBlock x:Name="Client_Name_Copy1" Text="{Binding ClientName}" Foreground="White" Margin="30,10,10,10" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="21.333" FontWeight="Bold" />
</Grid>
</Grid>
</UserControl>

0
Velin
Telerik team
answered on 24 Sep 2010, 02:08 PM
Hi Craig Ellis,

Thank you for the information supplied.

We were able to reproduce a problematic behavior when filter descriptors are used in design time. The problem is that in design time the chart control is populated with some dummy data and when the filter descriptors are applied on this data an exception is thrown. Could you please verify that removing the filter descriptors from xaml solves the problem ? Thanks.

Sincerely yours,
Ryan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Craig Ellis
Top achievements
Rank 1
Answers by
Velin
Telerik team
Craig Ellis
Top achievements
Rank 1
Share this question
or