Page 1 of 1

Series themes?

Posted: Thu Jan 28, 2010 3:37 pm
by 10552894
Hello.

Is there possibility to have something like series themes?
I would like to create some predefined series configurations, so user
can choose one of them, while creating chart, depending on what he needs.

I was wondering if I can use SaveChartToFile / LoadChartFromFile,
but I think it would be difficult, because those functions save or load
the whole chart.

Thanx for any help.
Bart

Re: Series themes?

Posted: Thu Jan 28, 2010 4:16 pm
by narcis
Hi Bart,

Yes, you could use that. It would also import/export the series in the chart with your custom settings. You can also choose whether you want to include chart's data. Does this fit your needs?

Re: Series themes?

Posted: Thu Jan 28, 2010 4:50 pm
by 10552894
Each time user will have different number of series to show.
He might want to add some data to series 1, set its theme, then add data for series 2,
change some series settings, add data for series 3 and change its theme to something else.

Using LoadChartFromFile destroys all earlier added series. I don't want to delete them,
I want to change them.

Regards
Bart

Re: Series themes?

Posted: Fri Jan 29, 2010 9:08 am
by yeray
Hi Bart,

You could load the tee file to a dummy chart and copy the desired series from it to the final chart:

Code: Select all

uses teestore, teeeditpro;

procedure TForm1.Button1Click(Sender: TObject);
var tmpChart: TCustomChart;
begin
  tmpChart:=TChart.Create(Self);
  LoadChartFromFile(tmpChart,'C:\tmp\teefile.tee');
  if tmpChart.SeriesCount>0 then
    tmpChart[0].ParentChart:=Chart1;

  tmpChart:=nil;
  tmpChart.free;
end;

Re: Series themes?

Posted: Thu Feb 04, 2010 8:34 am
by 10552894
This was a great advice!
Thanx!