Page 1 of 1

Show labels by Right-Clicking a Slice or Bar in a chart

Posted: Wed Mar 22, 2017 6:07 am
by 16880166
I have two charts on one form. When I display labels, a lot of them overlap. So I created a Popup menu for both charts that lets the users hide the labels if the chart is overlapping them too much. The amounts and labels still show in the legend.

But is there a way that I could set up, let's say a pie slice, so if the user is not displaying labels, they could Right-Click the slice and have the label shown to them at the position of the mouse pointer? Though, keeping in mind I normally would have a popup menu show when the chart is right-clicked.

Or, is there a way when the labels are hidden, to show a 'hint' per slice or bar on a chart when they hover their mouse over the chart?

Thanks.

Re: Show labels by Right-Clicking a Slice or Bar in a chart

Posted: Wed Mar 22, 2017 8:37 am
by yeray
Hello,

You can use the series Clicked(X, Y) function to get the ValueIndex of the point for the given X/Y pixel position. You can call this at OnMouseDown or at OnMouseMove events to show a menu if you like.
Note Clicked function returns -1 if there's no point at the given X/Y pixel position.

Also note there's an OnClickSeries for the chart that directly gives you the Series and the ValueIndex.
realsol wrote:Or, is there a way when the labels are hidden, to show a 'hint' per slice or bar on a chart when they hover their mouse over the chart?
There's the TMarksTipTool to do precisely that (Chart Tools only available with the Pro version).