Hi
I have D7 and TeeChartPro 8.04. I'm quite new to this TeeChart so I'm making stupid questions:)
I can easily publish X/Y datapoints to chart but can I somehow draw polygon area a top of some points and say : "select/categorisate these points and paint area with x color"?
I need to make many categorisation for data points..
Thanks
Polygon to select data points?
Hi Juha,
There is not a series method to do this but here there is a proposition of how you could do it. It consists on creating a map series that will be the selector polygon. You create your polygon as a map series shape and then you'll be able to use its clicked method to see what points of your points series are in the area:
There is not a series method to do this but here there is a proposition of how you could do it. It consists on creating a map series that will be the selector polygon. You create your polygon as a map series shape and then you'll be able to use its clicked method to see what points of your points series are in the area:
Code: Select all
uses series, TeeMapSeries;
procedure TForm1.FormCreate(Sender: TObject);
var
ASerie: TMapSeries;
APol: TTeePolygon;
i: integer;
PSerie: TPointSeries;
begin
ASerie:=TMapSeries.Create(Chart1);
ASerie.ParentChart:=Chart1;
APol:=ASerie.Shapes.Add;
with APol.Points do
begin
AddXY(1,1);
AddXY(2,4);
AddXY(0,7);
AddXY(4,10);
AddXY(5,8);
AddXY(3,4);
AddXY(5,2);
end;
PSerie:=TPointSeries.Create(Chart1);
PSerie.ParentChart:=Chart1;
PSerie.FillSampleValues(25);
Chart1.Draw;
Chart1.Title.Clear;
for i:=0 to PSerie.Count-1 do
begin
if (ASerie.Clicked(PSerie.CalcXPos(i), PSerie.CalcYPos(i)) = 0) then
Chart1.Title.Text.Add('Point ' + inttostr(i) + ' in the polygon');
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Thanks Yeray,
This example helped a lot!
But now I still have some problem because this "selector polygon" comes from external datapoints file.
So points are not in proper order to create nice polygon and polygon shape will be a mesh.
What is the best way to sort polygon datapoints that they will create a solid area/polygon - not crossing from arbitrary between points?
They would have to go around to center virtual point.
Any algorithm idea?
Thanks!
-juha
This example helped a lot!
But now I still have some problem because this "selector polygon" comes from external datapoints file.
So points are not in proper order to create nice polygon and polygon shape will be a mesh.
What is the best way to sort polygon datapoints that they will create a solid area/polygon - not crossing from arbitrary between points?
They would have to go around to center virtual point.
Any algorithm idea?
Thanks!
-juha
Hi Juha,
I think that determine a polygon having a random list of values could be a really complex study. But casually there is a chart tool that may help you very much in this work. Please, take a look at the demo at All features/Functions/Extended/Perimeter Function.
The combination of perimeter function and the map series could be your answer. I hope it will be.
I think that determine a polygon having a random list of values could be a really complex study. But casually there is a chart tool that may help you very much in this work. Please, take a look at the demo at All features/Functions/Extended/Perimeter Function.
The combination of perimeter function and the map series could be your answer. I hope it will be.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Juha,
I'm happy to see that you found a satisfactory solution.
I'm happy to see that you found a satisfactory solution.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Back again
Everything works but how can I compare a given MapSeries array instead of this ASerie map?
I mean this:
1) this is working
if (ASerie.Clicked(PSerie.CalcXPos(i), PSerie.CalcYPos(i)) = 0) then
2) this is not working
if (Series1[5].Clicked(PSerie.CalcXPos(i), PSerie.CalcYPos(i)) = 0) then
So how can I use arrays maps to select these points?
Now I have done that like this way :
with APol.Points do begin
for i:=0 to series1[5].Points.count-1 do begin
AddXY(Series1[5].Points.XValue,Series1[5].Points.YValue);
end;
end;
But this is not sophisticated way because I have already "selection array" created..
Thanks
-Juha
Everything works but how can I compare a given MapSeries array instead of this ASerie map?
I mean this:
1) this is working
if (ASerie.Clicked(PSerie.CalcXPos(i), PSerie.CalcYPos(i)) = 0) then
2) this is not working
if (Series1[5].Clicked(PSerie.CalcXPos(i), PSerie.CalcYPos(i)) = 0) then
So how can I use arrays maps to select these points?
Now I have done that like this way :
with APol.Points do begin
for i:=0 to series1[5].Points.count-1 do begin
AddXY(Series1[5].Points.XValue,Series1[5].Points.YValue);
end;
end;
But this is not sophisticated way because I have already "selection array" created..
Thanks
-Juha
Hi Juha,
We aren't sure to understand what are you exactly trying to achieve. Could you please try to explain more accurately or could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
We aren't sure to understand what are you exactly trying to achieve. Could you please try to explain more accurately or could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |