2010-04-21 18 views
5

Microsoft Chart denetimlerini kullanarak bir 3d grafik oluşturuyorum. İşte resim: Ben her çubuk grafiğin üstünde noktayı göstermek istiyorumMicrosoft Chart denetimlerini kullanarak Grafikteki etiket

alt text http://www.highoncoding.com/articleimages/bar_graph.png

. Gibi çubuk grafik üstündeki Sınav 1 için vs. 2 (2 deki gibi noktaları) göstermelidir İşte

kodudur:

<asp:Chart ID="ExamsChart" Width="600" Height="320" runat="server"> 
     <Titles> 
     <asp:Title Text="Exam Report" /> 
     </Titles> 
     <Series> 
      <asp:Series Name="ExamSeries" ChartType="Column"> 
      </asp:Series> 
     </Series> 
     <ChartAreas> 

      <asp:ChartArea Name="ChartArea1"> 
      <Area3DStyle Enable3D="true" WallWidth="10" /> 
      </asp:ChartArea> 
     </ChartAreas> 
     </asp:Chart> 
: Burada

private void BindData() { 

      var exams = new List<Exam>() 
      { 
       new Exam() { Name = "Exam 1", Point = 10 }, 
       new Exam() { Name = "Exam 2", Point = 12 }, 
       new Exam() { Name = "Exam 3", Point = 15 }, 
       new Exam() { Name = "Exam 4", Point = 2 } 
      }; 

      var series = ExamsChart.Series["ExamSeries"];   



      series.YValueMembers = "Point"; 
      series.XValueMember = "Name"; 

      //series.MarkerStyle = System.Web.UI.DataVisualization.Charting.MarkerStyle.Circle; 
      //series.MarkerSize = 20; 
      //series.LegendText = "hellow"; 
      //series.Label = "something";    


      var chartAreas = ExamsChart.ChartAreas["ChartArea1"];   


      ExamsChart.DataSource = exams; 
      ExamsChart.DataBind(); 
     } 

ve html kodu

GÜNCELLEME:

: Burada

cevaptır MS grafik örnekleri Doğrudan

cevap

1

:

// Show data points values as labels 
chart1.Series["Series1"].IsValueShownAsLabel = true; 

// Set data point label 
chart1.Series["Series1"].Points[2].Label = "My Point Label\nLabel Line #2"; 
İlgili konular