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 1374 - Duplicated series with Color=clTeeColor
Summary: Duplicated series with Color=clTeeColor
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: 150901
Hardware: PC Windows
: Low enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-24 06:06 EST by Bert Kreisel
Modified: 2023-03-16 15:45 EDT (History)
2 users (show)

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


Attachments
small test project (1.51 KB, application/x-zip-compressed)
2023-03-16 15:45 EDT, david berneda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bert Kreisel 2015-11-24 06:06:55 EST
A duplicated series with Color=clTeeColor gets the ISeriesColor of the original series. So the original series and the duplicated series are looking the same (color). After saving to .tee file and loading this .tee file the series are no longer looking the same because the color is not stored in the .tee file and each series gets the next FreeSeriesColor.

Changing the color of a series is not expected after saving to .tee file and then loading this file. One solution could be setting the color of the duplicated series to the next FreeSeriesColor after duplicating (I would suggest this). Another possibility would be setting the color of the duplicated series to ISeriesColor.
Comment 1 sandra pazos 2015-11-26 07:59:08 EST
The code below reproduce the problem: 

uses TeeExport,TeeStore,TeCanvas,TeeJPEG,TeePNG;
var Series1,Series2:TLineSeries;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1 :=TLineSeries.Create(self);
Chart1.AddSeries(Series1);
Series1.FillSampleValues(10);
Chart1.AddSeries(CloneChartSeries(Chart1[0]));
Chart1.Axes.Left.Title.Visible := true;
Chart1.Axes.Left.Title.Text := 'Axis Left';
Chart1.Axes.Left.Title.TextAlignment := taLeftJustify;
Chart1.Axes.Left.Title.Position := tpCenter;
Chart1.Axes.Left.Texts.Position := lpBeforeTick;
SaveChartToFile(TCustomChart(Chart1),ExtractFilePath(ParamStr(0))+'\ChartAxisPosition.tee');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LoadChartfromFile(TCustomChart(Chart1),ExtractFilePath(ParamStr(0))+'\ChartAxisPosition.tee');
end;
Comment 2 david berneda 2023-03-16 15:44:57 EDT
>>One solution could be setting the color of the 
>>duplicated series to the next FreeSeriesColor 
>>after duplicating (I would suggest this).

This is what was already been done, but unfortunately a bug was doing it again, changing back the new free color to the original one, so that's why the two series appear red.

The correct output (before saving to *.tee file) is first series red and second series green. Saving and loading does not change the default colors.
Comment 3 david berneda 2023-03-16 15:45:42 EDT
Created attachment 1039 [details]
small test project