Series functions lost datasource on save

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
JES
Newbie
Newbie
Posts: 5
Joined: Wed Jan 30, 2008 12:00 am

Series functions lost datasource on save

Post by JES » Tue May 06, 2008 2:14 pm

Hi,

when I save chart (SaveChartToStream) it does not save datasource for functions. So when I load same stream back datasource is lost.

Is datasource (Source Series) missing on TCurvefittingfuntion on export?

Code: Select all

  object TLineSeries
    Tag = 1
    Marks.Arrow.Visible = True
    Marks.Callout.Brush.Color = clBlack
    Marks.Callout.Arrow.Visible = True
    Marks.Visible = False
    Title = 'Series 1'
    LinePen.Width = 2
    Pointer.InflateMargins = True
    Pointer.Style = psRectangle
    Pointer.Visible = False
    XValues.DateTime = True
    XValues.Name = 'X'
    XValues.Order = loAscending
    YValues.Name = 'Y'
    YValues.Order = loNone
  end
  object TLineSeries
    Tag = 2
    Marks.Arrow.Visible = True
    Marks.Callout.Brush.Color = clBlack
    Marks.Callout.Arrow.Visible = True
    Marks.Visible = False
    Title = 'Curve fitting for Series1'
    Pointer.InflateMargins = True
    Pointer.Style = psRectangle
    Pointer.Visible = False
    XValues.DateTime = True
    XValues.Name = 'X'
    XValues.Order = loAscending
    YValues.Name = 'Y'
    YValues.Order = loNone
    YValues.ValueSource = 'Y'
    object TeeFunction1: TCurveFittingFunction
      Period = 1.000000000000000000
    end
  end
I'm using TeeChart Pro v8.03.11043 Win32 sources.

Any suggestions how to fix this, this makes functions useless after save (is it fixed on latest sources)?

Thanks,
JES

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 08, 2008 3:10 pm

Hi JES,

This works fine for me here. You may need to call CheckDataSource method after loading data, for example:

Code: Select all

Series2.CheckDataSource;
If problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

JES
Newbie
Newbie
Posts: 5
Joined: Wed Jan 30, 2008 12:00 am

Post by JES » Fri May 09, 2008 10:52 am

Hi,

I uploaded test project on your server (there is small document inside zip-file to explain what to do).

After save and load function datasource is empty (and function is not following parent trend).

Is there something missing in my code or... ?

Thanks,
JES
narcis wrote:Hi JES,

This works fine for me here. You may need to call CheckDataSource method after loading data, for example:

Code: Select all

Series2.CheckDataSource;
If problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri May 09, 2008 12:51 pm

Hi JES,

Thanks for the example project, I have been able to reproduce the problem here now and added it (TV52013042) to our bug list to be fixed for next releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri May 09, 2008 1:07 pm

Hi JES,

Just for completeness, this works fine for me here creating series and function at designtime. I'll send you the project thar works fine for me here.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

Post by Pep » Tue Sep 09, 2008 9:45 am

H JES,

just inform you that the problem you reported about missing the DataSource exporting the Chart is not a bug. The problem is that , as you create all the series at runtime ( via code ) you have to set any name for each Series, if not, when you call the export, neither the Series name and Series DataSource are saved.
Using the following code should work fine :

Code: Select all

procedure TForm1.btnAddCurveClick(Sender: TObject);
var  ser:TLineSeries;
begin
  ser := TLineSeries.Create(DBChart1);
  ser.Name := 'Series2';
  ser.SetFunction(TCurveFittingFunction.Create(DBChart1));
  ser.datasource:=DBChart1.series[0];
  ser.CheckDataSource;
  DBChart1.AddSeries(ser);
end;

procedure TForm1.btnAddTrendClick(Sender: TObject);
var ser:TLineSeries;
begin
  DBChart1.RemoveAllSeries;
  ser := TLineSeries.Create(DBChart1);
  ser.Name := 'Series1';
  ser.FillSampleValues(50);
  DBChart1.AddSeries(ser);
end;

Post Reply