Need Advice on best approach

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Need Advice on best approach

Post by tbonejo » Mon Oct 30, 2006 3:25 pm

Hi,

I have an application that will be using up to 14 charts to display fast line series of data.

Setting them up isnt a problem, however, the same 14 charts will be used by several different users in my company. Each user represents a different customer with charts that may be similiar to anothers but maybe 1 or 2 charts may be different. So I was thinking it may be best to allow the user to add/delete charts to panel in my app. That user of course would be able to set the series info for each chart. Where one customer may have 14 charts another may only need 13. I guess everything would be done dynamically which is doable but Im not sure what my easiest and best approach would be to solve this problem. I dont really want to hardcode or bake the amount of charts and their respective series into each chart.

How doable is this?
Has anyone done something similiar?

Also, we are currently using Excel for the charts on 1 sheet and the data on the other. Working with excel can be problematic and slow especially when printing each chart sheet out and the data is about 6-7 mbs. Id really like to move away from excel and allow the customer to get the chart and its corresponding format similiar to what they get in excel now....all electronically and printed charts. Ive done some dynamic charting with TeeChart before and the quality is awesome and easy to use, however this issue kind of throws a wrench into the works.

What to use to add the charts to on a form? Ive used panels with scroll bars previously to display 7 charts at a time. Is this the best/easiest route?

Thanks for any help.

Tom
Tom

tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Post by tbonejo » Fri Nov 03, 2006 3:28 pm

No one has any ideas on this?
Tom

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 08, 2006 11:02 am

Hi Tom,

if I understood, it should not be very difficult to accomplish.
As you said the best way I can think of would be to use a Panel with scroll where you can add the created Charts. To generate the Charts dinamically you can use similar code to the following :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
  pchart : TChart;
  MySeries: TLineSeries;
begin
  // Create the chart
  pchart := TChart.Create(self);
  // Put the chart on the form
  pchart.Parent := TWinControl(Panel1);
  // Position
  pchart.Top := 140;
  pchart.Left := 10;
  // Create the series
  MySeries:=TLineSeries.Create(Self);
  // Populate the series
  pchart.AddSeries(MySeries);
  MySeries.FillSampleValues(10);
end;
In the case you don't know the Chart you need to create dinamically you could use an Array of TChart components, in this way you will be able to identifty everyone.

If you still having any question please do not hesitate to post it here and we'll try to help you.

tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Post by tbonejo » Wed Nov 08, 2006 11:41 am

Pep,

Thanks. I got it all working except allowing the user to remove a chart. They can generate as many as they want and add 1 or 2 afterwards. The removing part is hard though. Is there a solution once its on my scrollbox? I didnt use arrays of TChart.


Thanks,

Tom
Tom

Post Reply