Having trouble styling my chart

Thread is closed for posting
3 posts, 0 answers
  1. Brian Garson
    Brian Garson avatar
    54 posts
    Member since:
    Jan 2008

    Posted 10 Sep 2009 Link to this post


    I'm having trouble styling my chart, specifically #1 and #2 which you can see in the image located here:

    #1. how do I remove these borders? 

    #2. How do I remove this gap where the title is? 

    below is snippets of my code behind and ASPX designer code:

    //create chart type Pie 
                ChartSeries activityChartSeries = new ChartSeries(); 
                activityChartSeries.Type = ChartSeriesType.Pie; 
                activityChartSeries.Appearance.Border.Visible = false
                activityChartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels; 
                activityChartSeries.DefaultLabelValue = "#%{P2}"
                //data source 
                RadChart2.DataSource = activityStats; 
                //add series 
                RadChart2.Series[0].DataYColumn = "Value"
                //data bind 
                RadChart2.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(RadChart2_ItemDataBound); 

    <telerik:RadChart ID="RadChart2" BorderWidth="0"  ChartTitle-Appearance-Border-Visible="false" ChartTitle-TextBlock-Visible="false" Legend-Appearance-Border-Visible="false" Width="500" Height="375" OnBeforeLayout="RadChart2_BeforeLayout" 
                OnItemDataBound="RadChart2_ItemDataBound" runat="server" DefaultType="Pie" Skin="Web20"

  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 11 Sep 2009 Link to this post

    I'm not 100% sure about #2 but I do know that #1 is:

    RadChart2.PlotArea.Appearance.Border.Visible = false

    And then for the chart my suggestions is that you go here and then play around with it:


  3. Velin
    Velin avatar
    391 posts

    Posted 14 Sep 2009 Link to this post

    Hi Brian,

    This code should work for you:
    //set diameter of the pie chart to 100% 
    series1.Appearance.DiameterScale = 1; 
    //Hides the title. 
    RadChart1.ChartTitle.Appearance.Visible = false
    //Hides the chart border 
    RadChart1.Appearance.Border.Visible = false
    //Hides the plot area border 
    RadChart1.PlotArea.Appearance.Border.Visible = false
    //Set 0 margins to the plot area 
    RadChart1.PlotArea.Appearance.Dimensions.Margins = new Telerik.Charting.Styles.ChartMargins(0, 0, 0, 0); 

    Hope this will help.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top