2

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 Answers2

1

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

MBo
  • 77,366
  • 5
  • 53
  • 86
  • But in my case, I need to create more than one Mark item (like as possible to do on design time in Series/Series1//Marks/Text/ button +) . In this method OnGetMarkText I have access to main mark text item. Is there any way to manipulate the child mark item? Thanks for your attention. – Valber Custódio Aug 30 '17 at 20:38
0

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;
Yeray
  • 5,009
  • 1
  • 13
  • 25