I use marks in a bar chart that can be clipped by the margin--for example, see the right-most bar in the chart below.
Most of the time this does not happen. But for this scenario (and others) it does.
Is there a way of fixing this so that
(1) marks are not clipped; and
(2) it doesn't create needless margin for the charts that do not have the marks clipped?
Thank you,
Ed Dressel
Marks are cut off
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Re: Marks are cut off
Hi Ed,
I can't reproduce this in a new chart with just a Bar series and some random values. I'm not sure about what element or combination of elements could be causing this. However, you probably can fix it adding some extra margin on the top of the chart, have you tried it?
Could you please send us some project we can run as-is to reproduce the problem here?
Thanks in advance.
I can't reproduce this in a new chart with just a Bar series and some random values. I'm not sure about what element or combination of elements could be causing this. However, you probably can fix it adding some extra margin on the top of the chart, have you tried it?
Could you please send us some 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 |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Re: Marks are cut off
See the attached demo. Click on any of the "test..." buttons at the bottom of the screen--the problem is accentuated when a graphic (bitmap) of the chart is created (displayed to the right of the chart).
Also, can you clarify about adding extra margin at the top—I don’t want to create needless margin that waists space. Is there a way of knowing how much margin to add? An example?
Thank you,
Ed Dressel
Also, can you clarify about adding extra margin at the top—I don’t want to create needless margin that waists space. Is there a way of knowing how much margin to add? An example?
Thank you,
Ed Dressel
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Re: Marks are cut off
Attached is the demo.
- Attachments
-
- Marks Cut Off.zip
- (2.89 KiB) Downloaded 669 times
-
- Newbie
- Posts: 6
- Joined: Thu Mar 14, 2013 12:00 am
Re: Marks are cut off
Any comments?
Re: Marks are cut off
Hello Ed,
We are investigating it. Please stay tuned.
We are investigating it. Please stay tuned.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Marks are cut off
Hi Ed,
You could do something like this to calculate the Margins needed for the multiline labels in the bottom axis, and for the multiline marks in the series:
You could call this method in each button, after adding the values in the series.
However, the margins needed for the images are different. To fix this, you could create a temporal chart with the final size, calculate the margins for it as above, and export this temporal chart.
You could do something like this to calculate the Margins needed for the multiline labels in the bottom axis, and for the multiline marks in the series:
Code: Select all
procedure TForm1.RecalcMargins;
var i, maxHeight, tmpNum: Integer;
tmpSize: TPoint;
begin
chrtSavingsNeeded.Draw;
with chrtSavingsNeeded.Axes.Bottom do
if LabelsMultiLine then
begin
maxHeight:=0;
for i:=0 to Pred(Items.Count) do
begin
tmpSize:=chrtSavingsNeeded.MultiLineTextSize(Items[i].Text, Items[i].Format.TextFormat, tmpNum);
maxHeight:=Max(maxHeight, tmpSize.Y);
end;
chrtSavingsNeeded.MarginUnits:=muPixels;
chrtSavingsNeeded.MarginBottom:=maxHeight;
end
else
begin
chrtSavingsNeeded.MarginUnits:=muPercent;
chrtSavingsNeeded.MarginBottom:=4;
end;
chrtSavingsNeeded.Draw;
if Series1.Count>0 then
begin
maxHeight:=Series1.Marks.Positions[0].LeftTop.Y;
for i:=1 to Pred(Series1.Count) do
maxHeight:=Min(maxHeight, Series1.Marks.Positions[i].LeftTop.Y);
chrtSavingsNeeded.MarginUnits:=muPixels;
chrtSavingsNeeded.MarginTop:=(chrtSavingsNeeded.ChartRect.Top-maxHeight);
end
else
begin
chrtSavingsNeeded.MarginUnits:=muPercent;
chrtSavingsNeeded.MarginTop:=8;
end;
end;
However, the margins needed for the images are different. To fix this, you could create a temporal chart with the final size, calculate the margins for it as above, and export this temporal chart.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |