2

I have a Delphi charting application, I want the user to select the charts they want from a dropdown menu (combobox) which is fine.

I want to be able to change the chart x-axis (bottom axis) title to that of the text in the combobox, however I cant seem to get that to work.

Here is my code that I have used that is not working:

DBChart1.Axes.Bottom.Title.Text := 'Queue: ' + ComboBox1.Selected.Text;

I am using the TDBChart from TeeChart to map my data from the database to the chart.

The error messages are as follows:

[dcc32 Error] charts.pas(56): E2003 Undeclared identifier: 'Text'
[dcc32 Fatal Error] Project2.dpr(5): F2063 Could not compile used unit 'charts.pas'
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Silentdarkness
  • 461
  • 1
  • 10
  • 30

1 Answers1

6

The property that you need is named Caption rather than Text.

DBChart1.Axes.Bottom.Title.Caption := ...

Also note that the right hand side of the assignment as written in the question is also incorrect. You presumably mean to read ComboBox1.Text.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490