New version of Oxyplot with problems

A place to report problems and bugs in SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

New version of Oxyplot with problems

#1

Post by Jean-Francois »

Hello Robin,

I remark that fast all my scripts that use the Oxyplot functions are no more working properly.
Hmm ... SharpCap crashes after an error message.

I found that the Oxyplot.dll are now different.
The old version was from 19.10.2019 and the new version installed with SharpCap 4.1.11939 is from 03.12.2022.

The problem is located to the functions for the legend.

I can comment all the "legend" function in my scripts, but it is not nice.
I search how to use the "new" legend functions. But I did not find how to do.

It is really very annoying when a library changes something without having back compatibility.

Some other people are using my scripts. It would be nice to correct this problem very soon.
One simple dirty solution is to copy the Oxyplot.dll of the 2019 version in the SharpCap directory (but only if somebody secure the 2019 version before installing the last version of SharpCap).

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13349
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: New version of Oxyplot with problems

#2

Post by admin »

Hi,

yes, I ended up updating the Oxyplot DLL for another reason and had to change my code because they changed the API :(

I think the reason for the change is that the new version can support multiple legends, so having a single LegendPlacement/Position was no longer sufficient. I had to change my code like this...

old version

Code: Select all

            var model = new PlotModel()
            {
                LegendPlacement = LegendPlacement.Inside,
                LegendPosition = LegendPosition.TopLeft,
            };
new version

Code: Select all

            using OxyPlot.Legends;
            var model = new PlotModel();
            model.Legends.Add(new Legend() { LegendPlacement = LegendPlacement.Inside, LegendPosition = LegendPosition.TopLeft });
That's obviously the C# vresion, but hopefully it should point you in the right direction.

cheers,

Robin
Post Reply