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

RadChart - Theme Drill Down in a Single Chart Area

2 Answers 76 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 26 Apr 2011, 04:17 PM
Hello - 

I am having issues applying a theme to a Silverlight RadChart that uses Drill Down logic in a single chart area. I created a sample project based on the exact source code found here (http://www.telerik.com/help/silverlight/radchart-features-drill-down-in-a-single-chart-area.html). When I issue a StyleManager.SetTheme call to any theme other than Office_BlackTheme a blank page is rendered in the browser Is there something I am missing?

Thanks - 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls.Charting;
using Telerik.Windows.Controls;
 
namespace SLTestDrillDown
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            radChart.ItemsSource = GetChartData();
            //this does not work. Setting to any other skin besides Office_BlackTheme
            //causes the page to not render
            //A blank page is displayed in the browser
            StyleManager.SetTheme(radChart, new VistaTheme());
             
            //this is the only theme that works
            //StyleManager.SetTheme(radChart, new Office_BlackTheme());
        }
 
        private List<Company> GetChartData()
        {
            return new List<Company>() {
       new Company() {
           Name="ToyYoda",
           Sales = new ModelSalesCollection() {
               new ModelSales("Coolla", 120000),
               new ModelSales("Coolla", 115000),
               new ModelSales("Veso", 89000),
               new ModelSales("Veso", 79000)
           }
       },
       new Company() {
           Name="Marda",
           Sales =new ModelSalesCollection() {
               new ModelSales("Tree", 145000),
               new ModelSales("Tree", 132000),
               new ModelSales("Six", 121000),
               new ModelSales("Six", 111000)
           }
       }
   };
        }
    }
 
    public class Company
    {
        public string Name
        {
            get;
            set;
        }
        public ModelSalesCollection Sales
        {
            get;
            set;
        }
    }
 
    public class ModelSalesCollection : List<ModelSales>
    {
        public double TotalAmount
        {
            get
            {
                return this.Sum(modelSales => modelSales.Amount);
            }
        }
    }
 
    public class ModelSales
    {
        public string Model
        {
            get;
            set;
        }
        public double Amount
        {
            get;
            set;
        }
        public ModelSales(string model, double amount)
        {
            this.Model = model;
            this.Amount = amount;
        }
    }
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 27 Apr 2011, 07:35 AM
Hello Jonathan,

You need to explicitly reference the theme assembly as only the default theme (Office_Black) is embedded in the control assembly in order to limit the assembly size. So if you want to use the Vista theme for example,  you need to reference the Telerik.Windows.Themes.Vista.dll that is available as part of the suite installation.

Hope this helps.


Greetings,
Giuseppe
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
Jonathan
Top achievements
Rank 1
answered on 27 Apr 2011, 02:29 PM
Perfect, worked great after adding those references. Thanks.
Tags
Chart
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or