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'
4

1 回答 1

6

您需要的属性是命名的,Caption而不是Text.

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

另请注意,问题中所写作业的右侧也是不正确的。你大概的意思是阅读ComboBox1.Text

于 2013-06-10T11:12:51.640 回答