Edit and navigate in a Surfaceserie

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Edit and navigate in a Surfaceserie

Post by rojo » Wed Oct 03, 2007 8:46 pm

is there a example or tool for editing and navigate in a Surfaceserie.
The TSurfaceNearestTool selects a cell with 4 points. I want to navigate and edit the separate points with the keyboard.

Is it possible to change the color of the wireframe at the piont where you navigate or edit.

I have a screenshot from this but i don't no how add this to this topic.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Oct 04, 2007 8:24 am

Hi rojo,

This is not exactly available but you can achieve something similar using a TDragPointTool to drag the series points and a TChartGrid for seeing and editing their values as well.
Is it possible to change the color of the wireframe at the piont where you navigate or edit.


This is not possible but you can mark the cell you are one doing something like this:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if OldIndex <> -1 then
    Series1.ValueColor[OldIndex]:=OldColor;

  OldIndex:=Series1.Clicked(X,Y);

  if OldIndex <> -1 then
  begin
    OldColor:=Series1.ValueColor[OldIndex];
    Series1.ValueColor[OldIndex]:=clRed;
  end;
end;
You'll find examples about TDragPointTool at All Features\Welcome!\Tools\Drag Point in the features demo. Regarding TChartGrid, examples can be found at All Features\Welcome!\Components\Chart Grid. The demo can be found at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Post by rojo » Fri Oct 05, 2007 11:47 am

Thanks,

wenn i try your example code the cell is marked 1 cell under the place where my mouse is pointing. I changed the code but i can't get the cell high lited under the mouse position.

rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Post by rojo » Wed Oct 10, 2007 8:19 pm

Hello Narcis,

i made a workaround and add a extra series (point3d) to the chart.

I add the points with AddXYZ but how can i change the Yvalue from a 3d_point. I can't find a instruction to modify this.
For the 2d pointseries i use Chart1.Series[1].YValue[10]:= 24.

is there a instuction like this Chart1.Series[1].XZValue[6,7]:= 3;

Can you please help me.

Regards

RoJo

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

Post by Yeray » Thu Oct 11, 2007 8:18 am

Hi rojo,

To change the Y value of the first point of your first series, you should do this Chart1.Series[0].YValue[0] := xx;

And to change the X value of the same point, Chart1.Series[0].XValue[0] := xx;
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

rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Post by rojo » Thu Oct 11, 2007 10:57 am

Sorry Yeray but this is not what i asked.

i have one point3d series witch have points that have a XYand Z value.
in my case the Y value is the height of the point. So wenn i want to change the height from a point in the 3D chart the old values are:
X= 6 and Y= 2 and Z= 7

I want to change the height y= 2 to y=3

How can i do that?

RoJo

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Oct 11, 2007 2:30 pm

Hi RoJo,

Ok, if you are interested in using rows and columns to obtain a cell in a surface you can do something as in the example I posted here.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Post by rojo » Fri Oct 12, 2007 5:52 am

With the Clicked function i understand that but thats always working with mouse action. In my case i want to change the 3D-points in Runtime with the press on a button or straight out of the programm.

I hope you have a solution for this.

RoJo

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

Post by Yeray » Mon Oct 15, 2007 9:07 am

Hi rojo,

If you don't know the order of the point you want to change, you should find it doing something similar to the example Narcís pointed to you.

But if you already know the order point, you only have to change its value by Series1.YValue[PointNumber] := xx;

In the following example I have two UpDown Buttons (associated to their respective editboxes), one to navigate through the points and the other to change its Yvalue:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i, j:integer;
begin
  Chart1[0].Clear;

  for i:=0 to 3 do
  begin
    for j:=0 to 3 do
    begin
      Series1.AddXYZ(i,1,j);
    end;
  end;

  UpDown1.Max := Series1.Count-1;
  UpDown2.Position := integer (Round(Series1.YValue[UpDown1.Position]));
end;

procedure TForm1.UpDown2Click(Sender: TObject; Button: TUDBtnType);
begin
  Series1.YValue[UpDown1.Position] := UpDown2.Position;
end;

procedure TForm1.UpDown1Click(Sender: TObject; Button: TUDBtnType);
begin
  UpDown2.Position := integer (Round(Series1.YValue[UpDown1.Position]));
end;
If I understand, you would like to do something similar to that. And note that this is working directly to the surface series, without any Point3d series.
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

rojo
Newbie
Newbie
Posts: 12
Joined: Fri Aug 03, 2007 12:00 am

Post by rojo » Mon Oct 15, 2007 7:50 pm

Thanks i'am understanding it now.

Regards

RoJo

Post Reply