Get x, Y coordinate values, and database related field values in Dbchart
Generally want to get dbchart x, y coordinate values are very simple, here simply say, double-click Dbchart, Pop-up dialog box, select Tools tab, add Cursor tool, and then check the cursor tool, Find the Cursor tool event (Cursor tool event total two) one is onchange () the other is Onsnapchange (), the difference between the two is the SNAP option in the cursor settings, snap is to keep the cursor on the series, The X-and y-axis coordinates are usually available in the function onchange, but what if you want to show the data segment values in the database and the x and y axes?
This is the problem I completed through the series of Xlabel, specific operations such as.
In this interface, put labels on the database's primary key (my database is ID), X, y is hanging on the curve you need to display the horizontal ordinate field. How to display the data segment values along the x and y axes?
Id:=series[0]. Xlabel[valueindex];
The statement to the right of the equal sign can get the value of the primary key ID in the database that corresponds to the sitting punctuation in the dbchart curve. This ID value allows you to find additional field data in the database through the SQL statement.
The second problem arises
If you hang the database ID into the labels, you will find that the x-axis coordinates of the image you need to display are not correct, it becomes the ID value, but it is normal to display the value of the field hanging on the x-axis, how to solve this problem?
I added a curve in the Dbchart and moved the line to the front, except for the field labels the x-axis, and the other X-and y-axis fields are the same as the other lines.
Then hide the second curve. That's it.
Get x, Y coordinate values, and database related field values in Dbchart