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

Having trouble styling my chart

2 Answers 59 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Brian Garson
Top achievements
Rank 2
Brian Garson asked on 10 Sep 2009, 06:43 PM
Hello,

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; 
 
            //styles 
            activityChartSeries.Appearance.Border.Visible = false
            activityChartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels; 
            activityChartSeries.DefaultLabelValue = "#%{P2}"
 
            //data source 
            RadChart2.DataSource = activityStats; 
 
            //add series 
            RadChart2.Series.Add(activityChartSeries); 
            RadChart2.Series[0].DataYColumn = "Value"
             
            //data bind 
            RadChart2.ItemDataBound += new EventHandler<ChartItemDataBoundEventArgs>(RadChart2_ItemDataBound); 
            RadChart2.DataBind(); 

<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"
        </telerik:RadChart> 

2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 11 Sep 2009, 06:22 PM
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:

RadChart2.ChartTitle.Appearance.Dimensions 

0
Velin
Telerik team
answered on 14 Sep 2009, 08:35 AM
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,
Velin
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.
Tags
Chart (Obsolete)
Asked by
Brian Garson
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Velin
Telerik team
Share this question
or