0

Axis.MouseDown / Area Property

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

Hello,

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)

+2

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.

Hi Mark,

Is your GetGraphPart function, etc. still available? This is something I could really use.


Thanks 

Yes, though I haven't looked at it in 6 years.  It might take me a few days to retrieve.  beanmf@gmail.com if that time frame works for you.  We used Oxyplot as a graphing control for liquid chromatography and mass spectrometry.  The code is not proprietary.