Pie Chart Legend bug or my missing call?
Pie Chart Legend bug or my missing call?
I am using a Pie Chart and when I send some data to it the first time, it is great. It looks like:
However, when I try to limit the data, the legend entries all stay. I call the Clear function on the series, then run the data again with fewer entries and get:
Thank you,
John
However, when I try to limit the data, the legend entries all stay. I call the Clear function on the series, then run the data again with fewer entries and get:
Thank you,
John
Re: Pie Chart Legend bug or my missing call?
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: Pie Chart Legend bug or my missing call?
Thanks Yerah.
I think I have identified another small bug. Using PrintPartialCanvas, the chart titles don't seem to adjust to the given rectangle:
I was going to go tinkering around in the code, but figured I would point it out anyway.
Thanks,
John
I think I have identified another small bug. Using PrintPartialCanvas, the chart titles don't seem to adjust to the given rectangle:
I was going to go tinkering around in the code, but figured I would point it out anyway.
Thanks,
John
Re: Pie Chart Legend bug or my missing call?
Plus, what does PrintProportional do? It says it is on by default, but the charts seem to stretch if I don't set the right aspect ratio. The circular gauges ignore the Circled property.
Thanks again...
Thanks again...
Re: Pie Chart Legend bug or my missing call?
I figured maybe I could get around it by drawing to a Bitmap, then painting that to the printer. I got this:
John
John
Re: Pie Chart Legend bug or my missing call?
Hello John,
I came up with this fix:
Code: Select all
--- a/Chart.pas
+++ b/Chart.pas
@@ -418,6 +418,7 @@ type
ILegend : TCustomChartLegend;
+ procedure FontChanged(Sender: TObject);
function GetFont:TTeeFont;
procedure SetAlign(const Value:TCanvasTextAlign);
procedure SetCustom(SetPos:Boolean);
@@ -5400,6 +5401,11 @@ begin
result:=Assigned(FFont);
end;
+procedure TLegendItem.FontChanged(Sender: TObject);
+begin
+ SetCustom(False);
+end;
+
function TLegendItem.GetFont:TTeeFont;
var Old : Boolean;
begin
@@ -5417,6 +5423,7 @@ begin
else
FFont:=TTeeFont.Create(nil);
+ FFont.OnChange:=FontChanged;
result:=FFont;
end;
@@ -5516,11 +5523,6 @@ begin
result:=TLegendItem.Create;
result.ILegend:=ILegend;
- if ILegend.InternalLegendStyle=lsAuto then
- ILegend.CalcLegendStyle;
-
- result.Text:=ILegend.FormattedLegend(Index);
-
inherited Items[Index]:=result;
end;
end;
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: Pie Chart Legend bug or my missing call?
Hello, I am getting a compile error with those changes:
John
John
Re: Pie Chart Legend bug or my missing call?
Hello John,
Sorry. This is the fix for that error:
Sorry. This is the fix for that error:
Code: Select all
--- a/Chart.pas
+++ b/Chart.pas
@@ -5523,6 +5523,9 @@ end;
procedure TLegendItem.FontChanged(Sender: TObject);
begin
SetCustom(False);
+
+ if Assigned(ILegend) then
+ ILegend.CanvasChanged(Sender);
end;
function TLegendItem.GetFont:TTeeFont;
@@ -5542,7 +5545,12 @@ begin
else
FFont:=TTeeFont.Create(nil);
+ {$IFDEF FMX}
+ FFont.Brush.OnChanged:=FontChanged;
+ {$ELSE}
FFont.OnChange:=FontChanged;
+ {$ENDIF}
+
result:=FFont;
end;
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: Pie Chart Legend bug or my missing call?
Hello Yeray,
Thank you. It compiles now, and the legends work as intended.
I have another new issue (besides titles and stretching during printing), now it just stops when printing the charts (or takes a really long time...not sure):
John
Thank you. It compiles now, and the legends work as intended.
I have another new issue (besides titles and stretching during printing), now it just stops when printing the charts (or takes a really long time...not sure):
John
Re: Pie Chart Legend bug or my missing call?
It did eventually print after a few minutes.
Re: Pie Chart Legend bug or my missing call?
Hello,
I'm not sure to understand the problems you are experiencing with printing.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
I'm not sure to understand the problems you are experiencing with printing.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
![]() | Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) |
![]() ![]() ![]() ![]() ![]() ![]() |
Please read our Bug Fixing Policy |
Re: Pie Chart Legend bug or my missing call?
Sure. Here is a quick little program:
(btw, the title was set to left justified alignment)
Here is a PDF print of that:
The Sample Project Zip is attached.
It's giving me all types of hell. I just compiled a Release version and lost the center alignment on the circular gauges. it works with Debug still, though.
John
(btw, the title was set to left justified alignment)
Here is a PDF print of that:
The Sample Project Zip is attached.
It's giving me all types of hell. I just compiled a Release version and lost the center alignment on the circular gauges. it works with Debug still, though.
John
- Attachments
-
- SamplePrintError.zip
- (9.96 KiB) Downloaded 63 times
Re: Pie Chart Legend bug or my missing call?
It seems like using anything but the default center alignment for the title does odd stuff.
Re: Pie Chart Legend bug or my missing call?
I have another printing issue that I would like to resolve if possible. The pie chart really stretches and the margins look way bigger.
Here is the pie chart on the screen:
And here it is printed to PDF:
I am using the ChartPrintRect and the aspect ratios of screen vs print rect are the same, but it always squishes the image.
John
Here is the pie chart on the screen:
And here it is printed to PDF:
I am using the ChartPrintRect and the aspect ratios of screen vs print rect are the same, but it always squishes the image.
John