2017-08-27 87 views
1

我試圖在運行時從TDonutSeries創建一個aditional標記。 我已經使用低於該源代碼:TeeChart VCL - 添加標記

with Series1.Marks.Children.Add do 
    begin 
     Shape.Font.Size:= 10; 
     Shape.ShapeStyle:= fosRectangle; 
     Shape.Style:= smsPercent; 
    end; 

在這一行

Shape.Style = smsPercent; 

我接收此錯誤: E2003未說明的標識符 '風格'

是否有任何方式來爲特定標記項目設置樣式還是我需要使用特定單位?

回答

0

您可以將其轉換爲TSeriesMarkShape以訪問Style屬性。即:

with Series1.Marks.Children.Add do 
    begin 
    Shape.Font.Size:= 10; 
    Shape.ShapeStyle:= fosRectangle; 
    TSeriesMarkShape(Shape).Style:= smsPercent; 
    end; 
0

對象沒有Style屬性。但是您可以使用OnGetMarkText事件以自定義格式輸出標記標籤。

+0

但在我而言,我需要建立一個以上的馬克項目(如儘可能在系列/系列1 //標誌/文字/按鍵+設計時做的)。在這種方法OnGetMarkText我有權訪問主標記文本項目。有沒有辦法來操作子標記項?感謝您的關注。 –