2014-03-01 77 views
1

我正在使用Telerik版本2013.我想在RadChart內顯示y值,例如4,6,5,12和4。我怎樣才能做到這一點? 目前,我的輸出是這樣的:如何在RadHtmlChart中放置標籤

Enter image description here

ASPX代碼:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
</telerik:RadScriptManager> 
<telerik:RadHtmlChart 
    ID="RadHtmlChart" 
    runat="server" 
    Legend-Appearance-Visible="true" 
    Legend-Appearance-Position="Bottom" 
    Width="250px" 
    Height="250px"> 
    <PlotArea> 
     <Series> 
      <telerik:PieSeries> 
       <LabelsAppearance> 
        <TextStyle Margin="-30" /> 
       </LabelsAppearance> 
      </telerik:PieSeries> 
     </Series> 
    </PlotArea> 
</telerik:RadHtmlChart> 

ASPX.CS代碼:

protected void Page_Load(object sender, EventArgs e) 
{ 
    SeriesItem s1 = new SeriesItem(6); 
    s1.Name = "A"; 

    SeriesItem s2 = new SeriesItem(5); 
    s2.Name = "B"; 

    SeriesItem s3 = new SeriesItem(12); 
    s3.Name = "C"; 

    SeriesItem s4 = new SeriesItem(4); 
    s4.Name = "D"; 

    SeriesItem s5 = new SeriesItem(4); 
    s5.Name = "E"; 

    PieSeries ps = new PieSeries(); 
    ps.Items.Add(s1); 
    ps.Items.Add(s2); 
    ps.Items.Add(s3); 
    ps.Items.Add(s4); 
    ps.Items.Add(s5); 
    ps.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.PieLabelsPosition.Column; 
    ps.TooltipsAppearance.Visible = false; 

    RadHtmlChart.PlotArea.Series.Add(ps); 
    RadHtmlChart.DataBind(); 
} 

回答

相關問題