Solved

copy one tchart to another

Posted on 2014-10-06
1
551 Views
Last Modified: 2014-10-06
I have a tchart on my form. I draw it by programatically plotting points to a point series. The chart is small on the form and I would like to be able to see it appear as large as the form temporarily. Is there some easy way to make a chart on a form temporarily expand, covering the other objects without moving them ? Otherwise what i am thinking is having a child window open with a tchart on it. Then my question becomes, is there a way to copy the original tchart with the plotted points already on it, to another tchart on a child form ? Or do I need to redraw the points on the second tchart ? Or can I have two charts with the same name that mirror each other so the second tchart is automatically a clone of the first ?
0
Comment
Question by:ChLa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 40363572
You may change the parent of the chart and use standard alignment property to make it expand.

Try it somehow like that...

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, VclTee.TeeGDIPlus, Vcl.StdCtrls,
  VCLTee.TeEngine, VCLTee.Series, Vcl.ExtCtrls, VCLTee.TeeProcs, VCLTee.Chart,
  Vcl.ComCtrls;

type
  TForm1 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    Chart1: TChart;
    Series1: TPointSeries;
    procedure Chart1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

  SaveChartWidth,SaveChartHeight: Integer;
  SaveChartAlign: TAlign;

implementation

{$R *.dfm}

procedure TForm1.Chart1Click(Sender: TObject);
begin
  if Chart1.Parent=TabSheet1 then begin
    SaveChartWidth :=Chart1.Width;
    SaveChartHeight:=Chart1.Height;
    SaveChartAlign :=Chart1.Align;

    Chart1.Parent:=TabSheet2;
    Chart1.Align:=alClient;

    PageControl1.ActivePage:=TabSheet2;
  end
  else begin
    Chart1.Parent:=TabSheet1;
    Chart1.Align :=SaveChartAlign;
    Chart1.Width :=SaveChartWidth;
    Chart1.Height:=SaveChartHeight;
    PageControl1.ActivePage:=TabSheet1;
  end;
end;

end.

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question