Page 1 of 1

Configuring marks (in a pie series)

Posted: Fri Jun 21, 2019 3:57 pm
by 16585021
I have a pie series where the marks overlap the caption. Here is a sample:

Image

I am not too sure how to fix it--but spent ~30 minutes in the IDE chart/pie series marks and only got more confused.

I can decrease the font size a bit, but how do I hide the background (via code please).

Can I decrease the pie size a little?

I would also like to hide the background to the marks, but cannot figure that out.

Any other suggestions would be appreciated.

Note that the IDE is pretty confusing--it looks like there are several places to configure marks (chart editor/series]/[pie series]Marks and chart editor/series]/Format/Marks--I don't know the difference).

Re: Configuring marks (in a pie series)

Posted: Thu Jun 27, 2019 10:36 am
by yeray
Hello,
EdDressel wrote:
Fri Jun 21, 2019 3:57 pm
I can decrease the font size a bit, but how do I hide the background (via code please).
You can call "Marks.Brush.Clear".
EdDressel wrote:
Fri Jun 21, 2019 3:57 pm
Can I decrease the pie size a little?
You can manually set a CustomXRadius. Since the Cirlced property is set to true by default, you don't need to set the CustomYRadius.

Ie:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;
  Chart1.Legend.Hide;

  Chart1.Title.Text.Text:='This is a title with a big font';
  Chart1.Title.Font.Size:=20;

  with TPieSeries(Chart1.AddSeries(TPieSeries)) do
  begin
    AddPie(10, 'label 1');
    AddPie(20, 'label 2');
    AddPie(20, 'label 3');
    AddPie(30, 'label 4');

    Marks.Font.Size:=15;
    Marks.Style:=smsLabelValue;
    Marks.MultiLine:=True;
    
    Marks.Brush.Clear;
    CustomXRadius:=100;
  end;
end;
Project1_2019-06-27_12-28-45.png
Project1_2019-06-27_12-28-45.png (21.17 KiB) Viewed 7367 times
EdDressel wrote:
Fri Jun 21, 2019 3:57 pm
Any other suggestions would be appreciated.
You could also write your own algorithm to move the marks, you could use the DragMarks tool to let the user move the marks manually, or you could set them to be inside the pie setting PieMarks.InsideSlice to True.
EdDressel wrote:
Fri Jun 21, 2019 3:57 pm
Note that the IDE is pretty confusing--it looks like there are several places to configure marks (chart editor/series]/[pie series]Marks and chart editor/series]/Format/Marks--I don't know the difference).
- The options in the "Series/Marks" tab are those related to the properties in TChartSeries.Marks. These properties are shared with all the other series.
- The options in the ""Series/Format/Marks" tab are those related to the properties in TPieSeries.PieMarks. These properties are only present in the PieSeries.