Page 1 of 1

TeePreviewPanel and colored chart

Posted: Fri Jun 27, 2008 6:16 am
by 9341442
Hi guys,

I have a problem with print of colored chart using TeePreviewPanel. I set chart color and assign chart to TeePreview Panel, but default color in Tee PreviewPanel is drawn!

Is it a bug or is there any trick to draw right?

Note: I tried to check this problem in very simply test. I made new empty project, took chart and TeePreviesPanel components and placed them on to the form. I set color of the chart and then assigned chart to TeePreviewPanel. But default color is used on teePreviewPanel.

Posted: Mon Jun 30, 2008 10:18 am
by Pep
Hi Mike,

yes, you're correct, its a bug. I've added it on our defect list and a fix for it will be considered for the next maintenance releases.
In meantime a workaround is to set the Chart color using a gradient, setting the same color for startcolor and endcolor properties. This will make the color to appear into the Chart of the TeePreviewPanel.

Here a sample code :

Code: Select all

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
with Chart1.Gradient do
begin
  StartColor := clred;
  EndColor := clred;
  Visible := true;
end;

TeePreviewPanel1.Panel := Chart1;
TeePreviewPanel1.Refresh;
end;