We have an issue with TeeChart where in Delphi XE the color of one particular series is not correct, but in Delphi 2006 it is.
We ordered v2010.02.20202 two weeks ago through DSA in The Netherlands.
One of the series should be red, but it becomes blueish in the app. At design time it is red.
See attachment for how it looks on the screen: on the left, the Delphi IDE, on the right the running app.
When compiling and building the same app in Delphi 2006, everything is fine: at run-time the series displays in a nice bright red colour
Our source code does not change anything in the series: it just fills the ChartClientDataSet with fresh chart data using the code block below.
How can we get this problem resolved?
Code: Select all
procedure TMainForm.FillFromDataSet(ADataSet: TDataSet; Title : string; SubTitle: string);
procedure FillFromDataSetPrimitive(SourceDataSet: TDataSet; TargetDataSet: TDataSet);
var
Index: Integer;
FieldName: string;
Field: TField;
begin
SourceDataSet.Open;
SourceDataSet.First;
while not SourceDataSet.Eof do
begin
TargetDataSet.Append;
try
for Index := 0 to SourceDataSet.FieldCount-1 do
begin
FieldName := SourceDataSet.Fields[Index].FieldName;
Field := TargetDataSet.FindField(FieldName);
if Assigned(Field) then
Field.Value := SourceDataSet.Fields[Index].Value;
Field := TargetDataSet.FindField('LINE');
if Assigned(Field) then
Field.AsInteger := TargetDataSet.RecordCount;
end;
finally
TargetDataSet.Post;
end;
SourceDataSet.Next;
end;
end;
var
{$WARN UNSAFE_TYPE OFF}
Bookmark: TBookmark;
{$WARN UNSAFE_TYPE ON}
begin
ChartClientDataSet.DisableControls;
try
if ChartClientDataSet.Active then
begin
ChartClientDataSet.Close;
ChartClientDataSet.CreateDataSet;
end;
ADataSet.DisableControls;
try
{$WARN UNSAFE_TYPE OFF}
Bookmark := ADataSet.GetBookmark;
{$WARN UNSAFE_TYPE ON}
try
FillFromDataSetPrimitive(ADataSet, ChartClientDataSet);
{$WARN UNSAFE_TYPE OFF}
ADataSet.GotoBookmark(Bookmark);
{$WARN UNSAFE_TYPE ON}
finally
{$WARN UNSAFE_TYPE OFF}
ADataSet.FreeBookmark(Bookmark);
{$WARN UNSAFE_TYPE ON}
end;
finally
ADataSet.EnableControls;
end;
finally
ChartClientDataSet.EnableControls;
end;
BalancedScoreCardDBChart.Title.Text.Clear;
BalancedScoreCardDBChart.Title.Text.Append(Title);
BalancedScoreCardDBChart.SubTitle.Text.Clear;
BalancedScoreCardDBChart.SubTitle.Text.Append(SubTitle);
BalancedScoreCardDBChart.RefreshData;
BalancedScoreCardDBChart.Align := alClient;
Panel_Graphs.Align := alClient;
Panel_Graphs.Visible := true;
end;
Arno Verhoeven
Chromalloy Holland
Siriusstraat 55
Tilburg, 5015BT
The Netherlands
T +31 135 328 493
F +31 135 432 833
http://www.chromalloy.com