Page 1 of 1

Animation from sub-charts to charts

Posted: Wed Oct 10, 2007 8:43 pm
by 10546565
I have an idea of including several sub charts across the top of my chart--and allowing a user to click on one and making that the main chart. I would like to animate the click so that the sub chart 'expands' to the main chart.

Anyone know how this might be done? I think the effects would be great.

Posted: Thu Oct 11, 2007 9:07 am
by narcis
Hi TestAlways,

At the moment this can't be done but I've added it to our wish-list to be considered for inclusion in future releases.

In the meantime, you can put a SubChart into the main chart like this:

Code: Select all

uses TeeStore, TeeEditPro;

procedure TForm1.Button1Click(Sender: TObject);
var stream: TMemoryStream;
    tmpPos: TPoint;
    tmpW, tmpH: Integer;
begin
  stream:=TMemoryStream.Create;
  SaveChartToStream(TCustomChart(ChartTool1.Charts[0].Chart),stream, true);
  Chart1.Tools.Delete(0);

  tmpPos.X:=Chart1.Left;
  tmpPos.Y:=Chart1.Top;
  tmpW:=Chart1.Width;
  tmpH:=Chart1.Height;

  stream.Position:=0;
  LoadChartFromStream(TCustomChart(Chart1),stream);

  Chart1.Left:=tmpPos.X;
  Chart1.Top:=tmpPos.Y;
  Chart1.Width:=tmpW;
  Chart1.Height:=tmpH;

  stream.Free;
end;