Teie kommentaarid

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.

I'm suspecting this is related to improper usage of Updates or similar commands on our part. I'd close this bug\idea as a user error as I don't think it is general, thanks.

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.

Rephrasing. We want to label peaks on a Series but avoid having overlapping labels. We need to access Axes so we can calculate text and arrow annotation positions. If we use the PlotModel.Updating event as the trigger for this calculation, the Axes exist but have values of 0; true values are only available later (for example, if we move the mouse over the plot). If we use the PlotModel.Updated event, and add Annotations, the Axes for our added Annotations will be null (EnsureAxes() is only called during Paint / Render).

We see two solutions: force the Axes' min and max values in the initial Updating event to be the real ones, OR, is there a method we can call to force the Axes to update to reflect the new series, before the plotModel is rendered.

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.


I'm new to OxyPlot, but can't we use the approach shown in the MouseEvents examples, i.e.

model.MouseDown += (s, e) => ..... where e offers properties like e.Position.X, etc.