2012-12-06 17 views

回答

3

你不能只改變FontHeight,因爲你只能得到FontHeight或FontWidth諮詢他們的價值觀。因此,如果你想改變字體的大小(高度和寬度),你必須分配一個值,如代碼下一行做字體大小:

public Form1() 
     { 
      InitializeComponent(); 
      InitializeChart(); 
     } 
     private void InitializeChart() 
     { 
      tChart1.AfterDraw += new PaintChartEventHandler(tChart1_AfterDraw); 
     } 

     void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g) 
     { 
      g.Font.Size = 25; 
      g.TextOut(100, 150, "TeeChartFor.Net"); 
     } 

我希望能有所幫助。

謝謝,

+0

並且還我開發的應用程序,它示出了樣值的曲線圖中收集的,如果值的範圍是圖具有正常背景色,但如果是有故障的我想設置圖表背景以Aqua顏色,我嘗試使用tchart1.backcolor = Color.Aqua,我也試過tchart1.panel.color = Color.Aqua,但它們不會改變背景顏色。我錯過了什麼?非常感謝你 –

+1

@saumilpatel作爲桑德拉帕佐斯張貼在另一個答覆,你需要按照我在這裏解釋:http://www.teechart.net/support/viewtopic.php?f=4&t=12058&p=51829&hilit=backcolor# p51829 –

3

默認TeeChart圖表的背景中有一個漸變。如果你想改變顏色,以前你必須禁用背景漸變。你可以做下一行代碼:

private void InitializeChart() 
{ 
    tChart1.Panel.Gradient.Visible = false; 
    tChart1.Panel.Color = Color.Aqua; 

} 

我希望能對你有幫助。

謝謝,

+0

真棒!非常感謝 ! :) –

相關問題