Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1123 - When cloning a chart series with a datasource, the datasource is unlinked
Summary: When cloning a chart series with a datasource, the datasource is unlinked
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 04:00 EST by h.hasenack
Modified: 2015-02-12 11:42 EST (History)
2 users (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version: RAD XE7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description h.hasenack 2015-02-06 04:00:54 EST
this shows up eg when using the chartscrollpager with a series that is linked to a chartdatasource,

It clones the original series for display in the scrollpager, but when doing so it does not clone the datasource component. So, whap happens ist that the datasource gets linked to the seires in the scrollpager, and the original series gets unlinked from the datasource.

My patch was to change the TChartSeries.Assign method, and skip any TSeriesSource links from the original series in SelfSetDataSources:

  Procedure SelfSetDataSources(const Value:TDataSourcesList);
  var t : Integer;
    {$ifdef HH_PATCH_TC_DATASOURCEPERSISTANCE}
      ds:TComponent;
    {$endif}
  begin
    DataSources.Clear;
    {$ifdef HH_PATCH_TC_DATASOURCEPERSISTANCE}
    // fixes a problem for Tchartscrollpager where a series iscloned. The TChartSeries.Assign
    // unlinks from the original chartseries top be linked to the cloned series. Which makes the
    // original series appear empty.
      for t:=0 to Value.Count-1 do
      begin
        ds:=Value[t];
        if not (ds is TTeeSeriesSource) then
          InternalAddDataSource(ds);
      end;
    {$else}
      for t:=0 to Value.Count-1 do
          InternalAddDataSource(Value[t]);
    {$endif}
  end;