Axis.MouseDown / Area Property

alex 5 years ago updated by Mark Bean 5 years ago 3


I have tried to add a Event Handler for the Axis.MouseDown Event, but it doesn't get called!

FrequencyAxis.MouseDown += (s, e) => {

IsFrequencyAxisFixed = !IsFrequencyAxisFixed;


Also, would it be possible to add a Area property to the Axis? (Like the PlotModel.LegendArea or PlotModel.PlotArea)


We resolved this by using the model.MouseDown event and testing for where the event fell. Not sure how to do code snippets in this forum...

[ model.MouseDown += (s, e) => {

if (e.ChangedButton == OxyMouseButton.Left)


graphPart = GetGraphPart(e.Position, model, _selectionStartScreen, _selectionEndScreen);]

etc. where we had to implement GetGraphPart and the selectionStartScreen etc.

I can send you code if you wish.

Hi Mark, your solution looks like something i need for my application.

How do you detect which lineseries or areaseries is clicked on with model.mouseDown event?.

Thanks in advance.

I don't think there is any concept of clicking on a series, just on a plot surface, so you would have to write code to detect which series had points closest to your mouse click. Your original post was asking for clicking on an axis.