1
votes

I'm trying to create a aditional mark from TDonutSeries at runtime. I have used this source code below:

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

In this line

Shape.Style = smsPercent;

I received this error: E2003 Undeclared identifier: 'style'

Is there any way to set the style for the specific mark item or I need to use a specific unit?

2

2 Answers

0
votes

There is no Style property for TTextShape object. But you can use OnGetMarkText event to output mark labels in own custom format.

0
votes

You can cast to TSeriesMarkShape to access the Style property. Ie:

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