Plot disappear in demo (oxyplot-a53ac6bf18cf )

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

sharethl wrote at 2014-03-12 17:28:

OxyPlot WPF Example browser,

Open any plot, click "code" tab, and click "Plot" tab again, plot disappear,
This not only happens on demo, but also in avalondock.

in avalondock, it was able to show plot if window is floated. but now cannot show plot.


bradcarman wrote at 2014-03-12 17:59:

I see this problem too. I just updated to the latest version today 2014.1.245.1 and am experiencing odd behavior with the plot disappearing randomly when displayed with the tab control in WPF. In my application I have about 10 different tabs, each with a separate OxyPlot control. All the plots display fine, but at some random point as I'm clicking through the tabs, the plot will disappear, and once this happens, all the plots disappear, even if they have already been rendered previously.

sharethl wrote at 2014-03-12 19:07:

There is another I think related problem on previous version, oxyplot_8ef807c53c7f,
WPF demo browser's "Add annotations" in "Mouse event" group, once click "Code" tab, and back to plot tab, mouse event won't update plot while mouse moving.

  1. Run oxyPlot.WPF Example,
  2. Select "Add annotations" in "Mouse events" group.
  3. Click "Code" tab,
  4. Click "Plot" tab.
  5. Use mouse to draw arrow, the arrow won't update during mouse moving.
How should we debug this and contribute?


tibel wrote at 2014-03-12 19:43:

Issue is in Plot.cs:
line 777 should be removed, then it works ;-)

sharethl wrote at 2014-03-12 19:56:

Such a big library really cannot find out why if not familiar with it.


objo wrote at 2014-03-12 22:26:

I have checked in some changes, it seems to solve all these problems. I will try to get the NuGet packages updated (having some internet connection problems, will try to push over a mobile line)

tibel: the intention with currentlyAttachedModel was to keep track of the PlotModel that is currently attached to the Plot control. This can also be the internalModel that is used when Model is null. When the control is unloaded, the currentlyAttachedModel should be null. I added a currentModel property that can be used in the UpdateModel method. Or do you see better ways to solve this?

sharethl: I think the add annotations example is working again now :-) great to hear you would like to contribute! see for more information

tibel wrote at 2014-03-13 07:32:

Look more complex to me, but it's ok.

Only one thing:
ActualModel property should also use currentModel instead of this.Model.

objo wrote at 2014-03-13 10:53:

thanks, I checked in a fix. Also see the unit tests. We should add similar tests for the Invalidate/Update functionality too.