runtime TOrgseries and scroll and zoom

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

runtime TOrgseries and scroll and zoom

Post by mivchart » Sat Aug 14, 2010 3:32 pm

Hi ,
id work with VCL v8.04 and D2007

try to use the series TOrgSeries without success for now.
In a simple example (in PJ)
I create a chart with series TOrgSeries in IDE
I associate it TScroolbar tools

Then the code, I create multiple Node.

Q1) why the scroll and zoom does not work with the mouse on the mouse, because the nodes are well above the form??
Q2) how the mouse event for retreive the good node?
Q3) why this representation (which is very good for organizations) is not included in the Teetree rather than in the chart?

//== my code for example
procedure TForm1.BtCreateClick(Sender: TObject);
var i,j,n,x:integer;
Org:TOrgSeries;
Item,SubItem:TOrgItem;
begin
if not (chart2.Series[0] is TOrgSeries) then exit;


Org:= (chart2.Series[0] as TOrgSeries);
Org.VertAxis := aLeftAxis ;
Org.HorizAxis := aBottomAxis ;
Org.OnMouseEnter := ChartOnMouseEnter;

// Add cascade Node for exemple
for I := 0 to 20 do begin
n:=Org.Add(-1,'Node'+ inttostr(i),clLime) ;

for j := 0 to 5 do
n:= Org.Add(n,'SubNode'+ inttostr(j),clred) ;

for x := 0 to 5 do
Org.Add(n,'SubNode'+ inttostr(x),clBlue) ;

end; //for i

Org.RecalcOptions:= [ rOnInsert ]; // rOnDelete, rOnModify,rOnClear
chart2.Refresh; // test , but no result !!
ChartScrollBar1.RecalcPosition; // test , but no result !!

end;
Attachments
ProjetOrgSerie.zip
project simple Torgseries
(8.1 KiB) Downloaded 829 times

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: runtime TOrgseries and scroll and zoom

Post by mivchart » Mon Aug 16, 2010 1:46 pm

Hi

nobody uses this mode of representation (Organization) in chart ???
no suggest ?

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

Re: runtime TOrgseries and scroll and zoom

Post by Yeray » Mon Aug 16, 2010 1:56 pm

Hi mivchart,
mivchart wrote:Q1) why the scroll and zoom does not work with the mouse on the mouse, because the nodes are well above the form??
I'm afraid it's not possible with this series. I've added it to the wish list to be implemented in future releases (TV52015091)
mivchart wrote:Q2) how the mouse event for retreive the good node?
I've changed this line:

Code: Select all

Label1.Caption:=  (tmp as TOrgSeries).Items[i].ID;
for this one:

Code: Select all

Label1.Caption:=  (tmp as TOrgSeries).Items[i].Text;
And when I run your application, if I click on "BtCreate" button (to assign the event) and then I click on "Random" button, I see the correct text in the label when I move the mouse around the chart.
I can see the correct texts with your values, with "BtCreate" button.
So I'm not sure to see any problem here. Anyway, another option could be using OnMouseMove event in combination with the Clicked method to retrieve the Index below the mouse pointer.
mivchart wrote:Q3) why this representation (which is very good for organizations) is not included in the Teetree rather than in the chart?
Do you mean the automatic positioning of the nodes? With TeeTree you can create an equivalent to a TOrgSeries manually, isn't it?
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

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: runtime TOrgseries and scroll and zoom

Post by mivchart » Tue Aug 17, 2010 8:23 pm

Excuse me for the delay

Thank you for the label, I modified it works.

But the most Pb is the Chart not scroll automatic !!

I do not understand how to use the series Torgseries in this case if the node larger than graph?


Otherwise, with the examples you have teetree to place like a TorgSeries? is important for me.
I have nedd representation larger node.

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

Re: runtime TOrgseries and scroll and zoom

Post by Yeray » Thu Aug 19, 2010 3:16 pm

Hi mivchart,

In the TeeTree2.exe demo application there are many examples of how to create trees, but they won't look like the TOrgSeries.
If you want to have trees with the appearance of the TOrgSeries it should be possible to do it manually. You should create TTreeNodeShape and connect fathers and childs with TTreeConnection. But I'm afraid that calculating the positions of all the Shapes won't be easy (the position depends on the number of shapes in each level and their size).
Here is a start point:

Code: Select all

function TForm1.CreateShape(ALeft, ATop, AWidth, AHeight: Integer; AText: String; AParent: TTreeNodeShape): TTreeNodeShape;
begin
  result:=TTreeNodeShape.Create(self);
  with result do
  begin
    AutoSize:=False;
    X0:=ALeft;
    X1:=X0+AWidth;
    Y0:=ATop;
    Y1:=Y0+AHeight;
    Tree1.AddNewShape(result, X0, Y0, AText, nil);
    ImageIndex:=tiNone;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
var i, separation, tmpwidth, tmpheight: Integer;
    Item, SubItem: TTreeNodeShape;
begin
  tmpwidth:=50;
  tmpheight:=30;
  separation:=25;

  for i:=0 to 20 do
    Item:=CreateShape(10 + i*(separation+tmpwidth), 50, tmpwidth, tmpheight, 'Node'+ inttostr(i), nil);

end;
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

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: runtime TOrgseries and scroll and zoom

Post by mivchart » Thu Aug 19, 2010 3:26 pm

hi,

But you do in the TeeChart, why not provide the calculations of TeeChart? I more than to apply it manually in the TeeTree!

I do not see what use this series TorgSeries in the chart if the chart is greater than the window!

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

Re: runtime TOrgseries and scroll and zoom

Post by Yeray » Fri Aug 20, 2010 10:46 am

Hi mivchart,

Excuse me if I haven't expressed clearly enough. We'll try to add the zoom and scroll functionality to the TOrgSeries (TV52015091), but I'm trying to suggest other possibilities to obtain the same result, or similar, in the meanwhile.
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

mivchart
Newbie
Newbie
Posts: 31
Joined: Thu Dec 04, 2008 12:00 am

Re: runtime TOrgseries and scroll and zoom

Post by mivchart » Fri Aug 20, 2010 4:22 pm

Ok, Made me know when you have something for me (without the new functionnality if i understand).

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

Re: runtime TOrgseries and scroll and zoom

Post by Yeray » Mon Aug 23, 2010 10:52 am

Hi mivchart,

The suggestion is to take the code above and create your Org view with TeeTree.
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