The ValueFormat property for the series is always set to either '#,##0' or '#,##0.00'. If I don't use GetLegendText, the values are formatted correctly, so I know the ValueFormat mask is set correctly.
Below is a simple example of what I am trying to do.
Code: Select all
procedure TForm.DBChart1GetLegendText(Sender: TCustomAxisPanel;
LegendStyle: TLegendStyle; Index: Integer; var LegendText: String);
var
vValueMask : String;
begin
if LegendStyle = lsValues then
begin
vValueMask := FChart.SeriesList[0].ValueFormat;
LegendText := FormatMaskText(vValueMask, FloatToStr(FChart.SeriesList[0].YValue[Index])) + #6
+ FChart.SeriesList[0].Labels[Index];
end; {if}
end;