Hi Team.
Im looking forward to built a radar chart and im wondering if there is any way to reach something like this. See pic attached.
Thanks in advance.
Best regards.
Radar
Re: Radar
Hello,
This looks very similar to the discussed here:
http://www.teechart.net/support/viewtop ... =3&t=15202
This looks very similar to the discussed here:
http://www.teechart.net/support/viewtop ... =3&t=15202
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Radar
Hi Alberto,
Also note the TPolarGridSeries could fit your requirements:
Also note the TPolarGridSeries could fit your requirements:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Radar
Hello again Alberto,
I've been playing with the TPolarSeries and that's the best I could achieve with it:
I've been playing with the TPolarSeries and that's the best I could achieve with it:
Code: Select all
const
SectorNames : array[0..9] of string =
(
'POSSESSION', 'OFFENSIVENESS', 'HIGH PRESS', 'CROSSING',
'FAST TEMPO', 'SUSTAINED THREAT', 'BUILD UP', 'MAINTENANCE',
'COUNTER ATTACK', 'DIRECT PLAY'
) ;
TeePiStep:Double = Pi/180.0;
var Series1: TPolarGridSeries;
procedure TForm1.FormCreate(Sender: TObject);
var Sector, Track, tmpIndex: Integer;
begin
//Chart1.Title.Visible:=false;
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
Chart1.Axes.Left.Visible:=false;
Chart1.Axes.Left.Grid.Color:=clWhite;
Chart1.Axes.Left.Grid.Style:=psDot;
Chart1.Axes.Top.Visible:=false;
Chart1.Axes.Bottom.Visible:=false;
Chart1.Axes.Bottom.Grid.Visible:=false;
Chart1.Axes.Right.Ticks.Visible:=false;
Chart1.Axes.Right.MinorTicks.Visible:=false;
Chart1.Axes.Right.LabelsFont.Color:=clWhite;
Chart1.Axes.Right.LabelsFont.Size:=6;
Chart1.Axes.Right.Axis.Visible:=false;
Chart1.Axes.Left.Increment:=50;
Chart1.AxisBehind:=false;
Chart1.OnBeforeDrawSeries:=Chart1BeforeDrawSeries;
Series1:=Chart1.AddSeries(TPolarGridSeries) as TPolarGridSeries;
with Series1 do
begin
Palette.UseColorRange:=false;
Color:=RGB(55, 47, 45);
Pen.Color:=Color;
CirclePen.Visible:=false;
RotationAngle:=110;
OnGetCircleLabel:=polarGetCircleLabels;
NumSectors:=10;
NumTracks:=255;
for Sector:=0 to NumSectors-1 do
begin
for Track:=0 to NumTracks-1 do
begin
tmpIndex:=AddCell(Sector,Track,0);
if (
((Sector=0) and (Track>110)) or
((Sector=1) and (Track>120)) or
((Sector=2) and (Track>100)) or
((Sector=3) and (Track>90)) or
((Sector=4) and (Track>180)) or
((Sector=5) and (Track>140)) or
((Sector=6) and (Track>160)) or
((Sector=7) and (Track>120)) or
((Sector=8) and (Track>140)) or
((Sector=9) and (Track>70))
) then
SetNull(tmpIndex);
end;
end;
end;
Chart1.Draw;
end;
procedure TForm1.polarGetCircleLabels(Sender:TCustomPolarSeries; const Angle:Double; Index:Integer;
var Text:String);
begin
Text:=SectorNames[Index];
if (Index>3) and (Index<5) then
Chart1.Canvas.Pen.Style:=psSolid
else
Chart1.Canvas.Pen.Style:=psDash;
end;
procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
var p : TPolarGridSeries;
begin
p:=TPolarGridSeries(Chart1[0]);
Chart1.Canvas.Brush.Style:=bsSolid;
Chart1.Canvas.Brush.Color:=rgb(67, 152, 67);
Chart1.Canvas.Ellipse(p.CircleRect);
end;
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if (Sender=Chart1.Axes.Right) then
begin
if LabelText='0' then
LabelText:='-100%'
else if LabelText='50' then
LabelText:='-50%'
else if LabelText='100' then
LabelText:='0%'
else if LabelText='150' then
LabelText:='50%'
else if LabelText='200' then
LabelText:='100%'
else if LabelText='250' then
LabelText:='150%';
end;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmpValue: Double;
tmpX, tmpY: Integer;
begin
Chart1.Canvas.Pen.Color:=clWhite;
Chart1.Canvas.Pen.Width:=2;
Series1.DrawRing(100, 0);
tmpValue:=18;
Chart1.Canvas.Pen.Width:=1;
while tmpValue<(360-MinAxisIncrement) do
begin
Series1.AngleToPos(TeePiStep*tmpValue,Series1.XRadius,Series1.YRadius,tmpX,tmpY);
Chart1.Canvas.LineWithZ(Series1.CircleXCenter,Series1.CircleYCenter,tmpX,tmpY,Series1.EndZ);
tmpValue:=tmpValue+36;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Radar
Hi Alberto,
This style still has to be polished (ie the circle labels aren't correctly positioned on the center of the slices) but it looks promising:
If you find problems to translate it, don't hesitate to let us know.
We've just implemented a new DrawStyle so with the next version it will be possible to do this:AlbertoRG wrote:That looks very very close to what i need..thanks for the work.
Code: Select all
Series1.DrawStyle := dsCircled;
I'm sorry. Since TeeChart ActiveX is a wrapper from TeeChart VCL we have to develop the new features in Delphi and TeeChart ActiveX inherits them automatically or with a few adaptations.AlbertoRG wrote:I need to translate the sample to VB6 and see if i can get the same-
If you find problems to translate it, don't hesitate to let us know.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |