Page 1 of 1
Grid header is affected by legend shadow
Posted: Mon Nov 06, 2023 4:22 pm
by 18695778
I have a TeeChart at one panel and a TeeGrid at another panel. If the chart has a legend with shadow, the grid column headers are drawn with shadow color background! There should not be a connection.
Re: Grid header is affected by legend shadow
Posted: Tue Nov 07, 2023 8:52 am
by yeray
Hello,
I don't see that connection with this example:
Code: Select all
uses Tee.GridData.Rtti;
var Chart: TChart;
Grid: TTeeGrid;
procedure TForm1.FormCreate(Sender: TObject);
var topPanel,
botPanel: TPanel;
data: TChartValueList;
begin
topPanel:=TPanel.Create(Self);
topPanel.Parent:=Self;
topPanel.Align:=alTop;
topPanel.Height:=Self.Height div 2;
botPanel:=TPanel.Create(Self);
botPanel.Parent:=Self;
botPanel.Align:=alClient;
Chart:=TChart.Create(Self);
Chart.Parent:=topPanel;
Chart.Align:=alClient;
Grid:=TTeeGrid.Create(Self);
Grid.Parent:=botPanel;
Grid.Align:=alClient;
Chart.View3D:=False;
Chart.AddSeries(TBarSeries).FillSampleValues;
data:=Chart[0].YValues;
Grid.Data:=TVirtualData<TChartValueList>.Create(data);
Chart.Legend.Shadow.Size:=8;
Chart.Legend.Shadow.Color:=clRed;
Grid.Header.Format.Brush.Gradient.Hide;
Grid.Header.Format.Brush.Color:=clGreen;
end;
- Chart-Grid.png (16.82 KiB) Viewed 33035 times
If you still find problems with it, please modify the example above so we can reproduce the problem here, or arrange a simple example project we can run as-is here.
Thanks in advance.
Re: Grid header is affected by legend shadow
Posted: Thu Nov 16, 2023 9:39 am
by 18695778
The effect isn't visible with your example. But with modification to LineSeries I got the issue:
- My example
- Shadow.JPG (47.77 KiB) Viewed 32621 times
Re: Grid header is affected by legend shadow
Posted: Thu Nov 16, 2023 1:06 pm
by yeray
Hello,
I'm afraid changing from TBarSeries
to TLineSeries
doesn't change the Grid for me here.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Re: Grid header is affected by legend shadow
Posted: Fri Nov 17, 2023 7:54 am
by 18695778
Here is my example.
Re: Grid header is affected by legend shadow
Posted: Sat Nov 18, 2023 9:46 am
by yeray
Hello,
Thanks for the project. We could reproduce the problem and we've been able to fix it.
In the
PrepareGradient
nested method, inside the
TFMXPainter.SetBrush
method, in FMX/FMXTee.Painter.pas unit, replace this:
Code: Select all
procedure TFMXPainter.SetBrush(const ABrush: TBrush);
//...
procedure PrepareGradient(const AGradient:FMXGradient);
//...
begin
AGradient.Color:=Color0;
AGradient.Color1:=Color1;
//...
For this:
Code: Select all
procedure TFMXPainter.SetBrush(const ABrush: TBrush);
//...
procedure PrepareGradient(const AGradient:FMXGradient);
//...
// Do not use AGradient Color0 and Color1. Instead, reset Points property.
// When using a TChart and a TeeGrid together,
// the chart canvas uses 3 point gradients, so it must be reset to 2:
procedure ResetGradientPoints;
var P : TGradientPoint;
begin
AGradient.Points.Clear;
P:=TGradientPoint(AGradient.Points.Add);
P.IntColor:=Color0;
P:=TGradientPoint(AGradient.Points.Add);
P.IntColor:=Color1;
P.Offset:=1;
end;
begin
ResetGradientPoints;
//...
Re: Grid header is affected by legend shadow
Posted: Mon Nov 20, 2023 8:14 am
by 18695778
I changed the code as you suggested. But the method isn't used by the example program. Do I have to change anything else?
Re: Grid header is affected by legend shadow
Posted: Mon Nov 20, 2023 9:38 am
by yeray
Hello,
After applying the changes to the .pas unit you have two options to use the modified sources:
- Rebuild the sources with TeeGridRecompile and keep using the "[...]\Steema TeeGrid for VCL & FMX Registered version XX\Compiled\DelphiXX.win32\Lib" path.
- Change the library path to directly use the sources. To do this, remove the reference to the "[...]\Steema TeeGrid for VCL & FMX Registered versionXX\Compiled\DelphiXX.win32\Lib" path and add "[...]\Steema TeeGrid for VCL & FMX Registered versionXX\Sources" and "[...]\Steema TeeGrid for VCL & FMX Registered versionXX\Sources\FMX" paths.
Re: Grid header is affected by legend shadow
Posted: Mon Nov 20, 2023 2:19 pm
by 18695778
Thank you, now it is working