Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Knowing which bar was clicked in a TBarSeries in a TChart/TDBChart

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm working with TCharts and TDBCharts in Delphi 5.
Is there a way for me to determine the bar (ie. Bar 2 of 5) that was clicked on in a chart (be it a TChart or TDBChart) ?
Suppose that I have 5 bars on a BarGraph and the user clicks the second one of these for more information (perhaps a drill down) how can I tell that it was the second one that was clicked ?
Will I need to write some (clever-ish) code to pick up the (x, y) co-ordinates of the mouse-click event and then, determine the number of bars on the graph, and calculate (using spacing of bars, etc) which was clicked ?
Is there a simple way of getting this result ?
I'm hoping someone will have an answer for me on this ....
Thanks in advance
Steve
 
Sorry - should have looked before I leapt on this one.
I'm able to achieve what I need using the 'OnClickSeries' event.
Oops.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top