Trouble with Theming of Line and Area Charts

3 posts, 0 answers
  1. Steven
    Steven avatar
    3 posts
    Member since:
    Aug 2011

    Posted 02 Nov 2011 Link to this post

    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. Sia
    Sia avatar
    756 posts

    Posted 03 Nov 2011 Link to this post

    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.

    the Telerik team

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

  3. Steven
    Steven avatar
    3 posts
    Member since:
    Aug 2011

    Posted 04 Nov 2011 Link to this post

    Thank you for your prompt response.  This was exactly my problem.  I suppose I should RTFM...
Back to Top