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

Trouble with Theming of Line and Area Charts

2 Answers 55 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 02 Nov 2011, 05:07 PM
I am having problems with theming of line and area charts.  When I apply a custom theme and have a LineSeriesDefinition or some of the other line and area series definitions, I get an exception.  Leaving everything else the same, if I define the chart with a BarSeriesDefinition instead, it will work fine.  The error isn't helpful enough for me to debug the problem effectively.  The error is as follows:

Webpage error details


User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.3; .NET4.0C; .NET4.0E; MS-RTC LM 8)
Timestamp: Wed, 2 Nov 2011 16:03:35 UTC

Message: Unhandled Error in Silverlight Application 
Code: 4004    
Category: ManagedRuntimeError       
Message: System.Windows.Markup.XamlParseException:  [Line: 0 Position: 0] ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at System.Windows.ResourceManagerWrapper.GetResourceForUri(Uri xamlUri, Type componentType)
   --- End of inner exception stack trace ---
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
   at MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
   at System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
   at System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
   at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
   at System.Windows.Controls.ItemsControl.AddContainers()
   at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)     

Line: 54
Char: 13
Code: 0
URI: http://localhost:58463/TestTelerikThemesTestPage.html

I realize it's a long shot, but can someone shed some light on this problem?

2 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 03 Nov 2011, 10:04 AM
Hi Steven,

Here is my answer copied from the other thread concerning the same issue:

When you have a custom theme applied to RadChart, there is one step in addition which needs to be done with the chart xaml. More information can be found in our help, and this help topic in particular. You need to add storyboards for your custom theme in the Chart.xaml file. Attached is its modified version.

Greetings,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Steven
Top achievements
Rank 1
answered on 04 Nov 2011, 02:54 PM
Thank you for your prompt response.  This was exactly my problem.  I suppose I should RTFM...
Tags
Chart
Asked by
Steven
Top achievements
Rank 1
Answers by
Sia
Telerik team
Steven
Top achievements
Rank 1
Share this question
or