Just found setting TextStyle to ltsPlain seem to fix it.Yeray wrote:Regarding the legend text alignment. I'll create a new ticket for it.
Code: Select all
Chart1.Legend.TextStyle:=ltsPlain;
Just found setting TextStyle to ltsPlain seem to fix it.Yeray wrote:Regarding the legend text alignment. I'll create a new ticket for it.
Code: Select all
Chart1.Legend.TextStyle:=ltsPlain;
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Code: Select all
procedure GetLegendText(Sender: TCustomAxisPanel;
LegendStyle: TLegendStyle; Index: Integer; var LegendText: string);
var
iPos: integer;
begin
iPos := Pos(Chr(6),LegendText);
if (iPos = 0) then
LegendText := ' '
else
begin
// Left-justified legend text code
LegendText := Copy(LegendText,iPos,Length(LegendText));
end;
end;
procedure GetLegendText(Sender: TCustomAxisPanel;
LegendStyle: TLegendStyle; Index: Integer; var LegendText: string);
var
iPos: integer;
begin
iPos := Pos(Chr(6),LegendText);
if (iPos = 0) then
LegendText := ' '
else
begin
// Right-justified legend text code
LegendText := Copy(LegendText,iPos+1,Length(LegendText));
end;
end;
Please, note that without a simple example we can run as is to reproduce the problem here, it's difficult for us to be accurate in our replies.Errol wrote:I use a self-stacked bar chart with a single series for the chart and another series for the legend. The field used for the legend text (Rock Type) is defined by the XLabelsSource setting, with an OnGetLegendText event to parse and edit the legend text to remove the default legend text (the bar length).
When I switch to another table in my database and draw a standard line series, I have a problem. If the line series is drawn first, the legend correctly shows the series name, but if drawn after drawing a bar chart, it displays the series name followed by the Rock Type from the bar chart. When I go from bar chart to line series, I clear all the series, etc, but clearly not clearing legend settings. Can you please suggest how I might do this.
Code: Select all
Chart1.OnGetLegendText:=nil;
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |