Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS VCL Chart
Showing values in bars

You can accomplish this by using the following code (based on a default TAdvChartView)

procedure TForm1.DoGetBarValueText(Sender: TObject; Serie, PointIndex: integer;
  AFont: TFont; var BarText: String; var Alignment: TAlignment);
begin
  BarText := floattostr(AdvChartView1.Panes[0].Series[Serie].Points[PointIndex].SingleValue);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  AdvChartView1.BeginUpdate;
  AdvChartView1.InitSample;
  AdvChartView1.Panes[0].Series.Delete(0);
  AdvChartView1.Panes[0].Series.Delete(0);
  AdvChartView1.Panes[0].Series[0].ChartType := ctbar;
  AdvChartView1.Panes[0].Series[0].OnGetBarValueText := DoGetBarValueText;
  AdvChartView1.EndUpdate;
end;