Two overlapping components

Can I have two charts on my form, both overlapping, by having only one visible at a time ? At design time I would make the first chart invisible before adding the second. At run time a button would control which is visible. Both TCharts would be completely overlapping, in the same exact position. There isn't room on my form for both charts to exist at the same time.
ChLaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gxsCommented:
Would you clarify your question a little bit?

Because my mind is telling me that this is the answer ( even though rationally it isn't ):

Creating visual components at runtime:

var
  C: TMyVisualComponent;
begin
  C := TMyVisualComponent.Create(Self);
  C.Left := 100;
  C.Top := 100;
  C.Width := 400;
  C.Height := 300;
  C.Visible := True;
  C.Parent := Self; //Any container: form, panel, ...

  C.MyProperty := MyValue,
  //...
end;

Open in new window


Or by setting the first chart visible at design time and then setting it to false by a button click event.
0
Sinisa VukSoftware architectCommented:
For such thing TPageControl is good enough. Add two pages add charts to same position on each page, hide Tabs. In design or runtime you can easily set ActivePage to be visible.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Geert GOracle dbaCommented:
using TChart, you can add multiple series

when adding the first series you typically calculate the min and max values for x and y
an example: cpu usage versus number of users connected to a database
the cpu usage is from 0% to 100%
the number of users is from 0 to ???, by day about 1000, by night about 50

in the legend an indication is required of how the 2 graphs relate to each other
the cpu usage is easy > the height of the graph is the percentage > 0 to 100
for the users an estimate of 1200 max users would be 100%

example data:
cpu: 86%
actual users: 700 > value (or height) calculated in the graph: 700/1200*100=58.33%

if you make a dependency like this, it's possible to show multiple values graphs in 1 chart
typical example: average speed and altitude over distance during bike race
http://www.steema.com/gallery/mobile/23#
0
ChLaAuthor Commented:
TPageControl looks like a great solution.  Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.