I have asked related questions earlier but I am still having problems. Current one is how to control the relative sizes in the legend of the symbol and the line for a lineseries. Here is a sample of the problem:
Somewhat unrelated: in some of my charts the lines in the legend are all black even though they are different colors in the chart. I don't see much difference in my code. Might I have accidentally turned off some option to suppress the colors in the legend?
Thanks,
Jim
The red line is too short (or the symbol too large) for the first item. The second correctly has no line and the third no symbol. Same problem if I have the legend on the right. I would in general prefer the lines to be a little longer rather than reducing the symbol size in the legend. Is that possible?legend properties
Re: legend properties
I seem to have found a solution but it seems illogical. By increasing the variable chart.legend.symbol.width it makes the line (not the symbol) larger. Is that a feature or a bug?
Jim
Jim
Re: legend properties
Hello Jim,
Have you tried incrementing the symbols width?
By default, WidthUnits is set to lcsPercent and Width is set to 20. Changing WidthUnits to lcsPixels looks better for this example:
Have you tried incrementing the symbols width?
By default, WidthUnits is set to lcsPercent and Width is set to 20. Changing WidthUnits to lcsPixels looks better for this example:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.View3D:=False;
for i:=0 to 2 do
with Chart1.AddSeries(TLineSeries) as TLineSeries do
begin
FillSampleValues;
Pointer.Style:=psCircle;
Pointer.Visible:=i<2;
LinePen.Visible:=i<>1;
end;
Chart1.Legend.Symbol.Squared:=False;
Chart1.Legend.Symbol.WidthUnits:=lcsPixels;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: legend properties
That works but why does making the symbol wider make the line longer? Perhaps the "symbol" means the display of both the marker and the line and not just the marker symbol?
Re: legend properties
Yes, the legend symbol refers to the space / column in the legend reserved for the symbol to be drawn. The symbol can be a pointer (circle, square,...), a pointer with a line, or a line.JimR wrote:That works but why does making the symbol wider make the line longer? Perhaps the "symbol" means the display of both the marker and the line and not just the marker symbol?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |