Hi
When creating bar charts with patterned fills, the bars and legend fills look fine in a standard bar chart but in in TChartEditor or a TTeePreviewPanel the bars look OK while the legend appears as a black or white box. The problem occurs in Teechart 805 but disappears if I recompile with TeeChart 7. I am using Delphi 20006 on windows vista. Please see simple attached sample program that demonstrates the problem.
Thanks for any assistance or suggestions on how to tweak TeeChart code.
Charlie Heaps
Legend Problem when using pattern fills in barcharts
Legend Problem when using pattern fills in barcharts
- Attachments
-
- legend.zip
- Delphi prog showing legend prob
- (12.79 KiB) Downloaded 596 times
Re: Legend Problem when using pattern fills in barcharts
Hi cheaps,
I've reproduced it with your application, then I've reduced your application to the following simple code in a clean TeeChart:
Note that you can see the same with a TChartPreviewer and with a TTeePreviewPanel. So I've added it to the wish list to be fixed in future releases (TV52014348).
I've reproduced it with your application, then I've reduced your application to the following simple code in a clean TeeChart:
Code: Select all
uses series;
procedure TForm1.FormCreate(Sender: TObject);
var i: integer;
begin
for i:=0 to 1 do
begin
Chart1.AddSeries(TBarSeries.Create(self));
Chart1[i].FillSampleValues();
Chart1[i].Brush.Style := bsBDiagonal;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ChartPreviewer1.Chart := Chart1;
ChartPreviewer1.Execute;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Legend Problem when using pattern fills in barcharts
Thanks - was kinda hoping for a recommendation of a quick patch to the source code. Any chance of that?
Re: Legend Problem when using pattern fills in barcharts
Hi cheaps,
I'm afraid that I can't think on a really simple solution right now. What I've seen is that the demo at All features/Welcome!/Miscellaneous/Legend/Symbol OnDraw doesn't seem to reproduce the problem. So an idea probably could be redrawing the symbols as images over the symbols.
I'm afraid that I can't think on a really simple solution right now. What I've seen is that the demo at All features/Welcome!/Miscellaneous/Legend/Symbol OnDraw doesn't seem to reproduce the problem. So an idea probably could be redrawing the symbols as images over the symbols.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Legend Problem when using pattern fills in barcharts
Really? I am surprised since this feature works perfectly in TeeChart 7? Cant you do a quick compare of the two source codes to see what has changed that might be causing this problem. I tried but this was a bit beyond my programming skill level.
This really is a fairly serious bug and I suggest it warrants your immediate attention.
Thanks for your consideration.
This really is a fairly serious bug and I suggest it warrants your immediate attention.
Thanks for your consideration.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Legend Problem when using pattern fills in barcharts
Hi cheaps,
I found that implementing TCustomChart.DrawLegendShape in Chart.pas as shown below solves the issue.
Actually this rolls back a change made during v8 development so I'm afraid fixing TV52014348 may brake something else. So we will appreciate if you let us know about anything related that doesn't work now. In the meantime I included this modification for next maintenance release.
Thanks in advance.
I found that implementing TCustomChart.DrawLegendShape in Chart.pas as shown below solves the issue.
Code: Select all
procedure TCustomChart.DrawLegendShape(const Rect: TRect);
begin
with Legend.Symbol do
if Gradient.Visible then
Draw(Canvas.Brush.Color,Rect)
else
inherited;
end;
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |