Click Event on particular barchart stick

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

Jivraj wrote at 2014-03-06 10:04:

First of all i want to say a lot of thanks to this oxyplot tools.
I wants to perform some task on clicking particular barchart(means its stick drawn) . Is it possible to make certain click event on clicking those barchart stick.If possible please suggest.
thanks in advance.

objo wrote at 2014-03-06 20:54:

The MouseDown event should be available on the BarSeries. Note that we consider removing the events when the new PlotController is implemented: https://oxyplot.codeplex.com/workitem/10132

Jivraj wrote at 2014-03-07 10:22:

Thanks for your kind suggestion.
i tried your suggestion, as event fire i have just displayed a message it works on clicking the whole chart area but i wants only the event on clicking the bar chart only, but the message is displaying on clicking whole chart area .
Doing on this:

plotModel1.MouseDown += (s, e) =>
        {
            if (e.ChangedButton != OxyMouseButton.Left)
            {
                return;
            }                               
            e.Handled = false;
            MessageDialog msgDialog = new MessageDialog("Welcome", "Alert!");
            msgDialog.ShowAsync();                
        };