This is what I have so far and working correctly:
A RangeBar Chart with two Series, that I fill with Points at runtime, based on the results of an Oracle query. Each Point represents a data object with a number of properties.
What I would like to add to this is the following:
For each visible Point on my chart, I want the user to be able to right click the Point in order to open a Menu with a number of options. These options should invoke certain functioncalls, with a property of the selected Point used as a parameter in that functioncall. In this function then, a new window is to be opened that would display some information based on the data object represented by the Point and the menu item that was clicked.
What have I tried so far? I started fooling around with a ContextMenu based on information in this topic: Adding a right click menu to an item:
ContextMenu cm = new System.Windows.Forms.ContextMenu();
cm.MenuItems.Add("Item 1", new EventHandler(Item1_Click));
But much to my disappointment, I discover that a ContextMenu can only be assigned to my Chart object, while I wished to assign it to an individual Point in my Series' Points collection:
chart.ContextMenu = cm; // This works
serie1.Points[DataObject.pointIndex].ContextMenu = cm; // This does not work unfortunately
Looking at the documentation of the Points collection assigned to a Chart Series, I find no mention of any sort of Menu whatsoever. Does this mean that what I'm looking for simply isn't feasible in a technical sense or am I overseeing something? And if so, would there be any other technical implementation that would deliver the functionality I'm looking for? (right now I'm thinking a ToolTip could cover some of my needs, but this wouldn't be nearly as elegant nor extensive as displaying the information in a new window)