Difficulty with creating special chart.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
BennieC
Newbie
Newbie
Posts: 1
Joined: Wed Apr 01, 2020 12:00 am

Difficulty with creating special chart.

Post by BennieC » Thu Apr 02, 2020 7:44 am

Hi I am quite a newbie with charting end definitely with TeeChart. I need to create a chart as per the included image but have no idea how to approach it. I have investigated XY plots as well as polar plots but am not able to create this.
RadialPlot.jpg
RadialPlot.jpg (61.94 KiB) Viewed 7520 times
Some guidance will be appreciated
Regards and stay safe.

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Difficulty with creating special chart.

Post by Yeray » Tue Apr 14, 2020 8:04 am

Hello,

Here a simple example using ColorLineTools for the green lines and manually drawing the circles at OnBeforeDrawSeries event:

Code: Select all

uses Series, VCLTee.TeeTools;

procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
const radius: array of Double=[3.9, 7.5, 11, 14.5];
var i, x, y, w, h: Integer;
begin
  for i:=0 to High(radius) do
  begin
    with Chart1.Canvas do
    begin
      Brush.Clear;
      Pen.Color:=clBlack;
      Pen.Width:=1;
      Pen.Style:=psDot;
      with Chart1.Axes do
        Ellipse(Bottom.CalcPosValue(radius[i]), Left.CalcPosValue(radius[i]),
                Bottom.CalcPosValue(-radius[i]), Left.CalcPosValue(-radius[i]));
    end;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;
  Chart1.Legend.Hide;
  Chart1.Axes.Left.SetMinMax(-16,16);
  Chart1.Axes.Bottom.SetMinMax(-16,16);

  with TColorLineTool(Chart1.Tools.Add(TColorLineTool)) do
  begin
    Axis:=Chart1.Axes.Left;
    Pen.Color:=clGreen;
    Pen.Width:=2;
    Value:=0;
  end;

  with TColorLineTool(Chart1.Tools.Add(TColorLineTool)) do
  begin
    Axis:=Chart1.Axes.Bottom;
    Pen.Color:=clGreen;
    Pen.Width:=2;
    Value:=0;
  end;

  with TPointSeries(Chart1.AddSeries(TPointSeries)) do
  begin
    Pointer.Size:=2;
    Pointer.Style:=psCircle;
    AddXY(-7.5,-7);
    AddXY(14.5, 14.5);
  end;
end;
Project1_2020-04-14_10-03-02.png
Project1_2020-04-14_10-03-02.png (30.57 KiB) Viewed 7457 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply