-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OxyPlot.Avalonia user error #59
Comments
That should work: which OxyPlot.Avalonia package are you targetting and have you tried forcing a restore from the command line with |
This is not a solution, but for version template 0.10.18:
You can use the Content property.
From https://github.com/oxyplot/oxyplot-avalonia
MainWindow.axaml
|
Not sure what's going on there... the code-behind shouldn't be necessary: I've just installed the same template, created the project, added the nuget reference and defined a PlotView in sample and it 'just works'. Package reference is
The style include is necessary for the plot to appear, but there shouldn't be an error without it. My complete example code: https://gist.github.com/VisualMelon/26f19b2a9fed7adf41fe121d7925e49e |
thank you for reply,this is a version question,use the lower avaliona template can be solved this error!发自我的 iPhone在 2023年9月16日,01:01,VisualMelon ***@***.***> 写道:
Not sure what's going on there... the code-behind shouldn't be necessary: I've just installed the same template, created the project, added the nuget reference and defined a PlotView in sample and it 'just works'. Package reference is
<PackageReference Include="OxyPlot.Avalonia" Version="2.1.0" />
The style include is necessary for the plot to appear, but there shouldn't be an error without it.
My complete example code: https://gist.github.com/VisualMelon/26f19b2a9fed7adf41fe121d7925e49e
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
OK. If you are targeting Avalonia 11, you should use the 2.1.0-Avalonia11 nuget version of OxyPlot.Avalonia |
thanks,you are right,I am using the latest version and have already resolved this issue using a lower version发自我的 iPhone在 2023年9月16日,01:01,VisualMelon ***@***.***> 写道:
Not sure what's going on there... the code-behind shouldn't be necessary: I've just installed the same template, created the project, added the nuget reference and defined a PlotView in sample and it 'just works'. Package reference is
<PackageReference Include="OxyPlot.Avalonia" Version="2.1.0" />
The style include is necessary for the plot to appear, but there shouldn't be an error without it.
My complete example code: https://gist.github.com/VisualMelon/26f19b2a9fed7adf41fe121d7925e49e
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Because this is the first time I have been exposed to cross platform solutions, the frameworks have been rebuilt and the latest versions have been used. I didn't pay much attention to version issues. Thank you again发自我的 iPhone在 2023年9月17日,22:13,VisualMelon ***@***.***> 写道:
OK. If you are targeting Avalonia 11, you should use the 2.1.0-Avalonia11 nuget version of OxyPlot.Avalonia
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I am having the same issue. When I try to use oxyPlot I get an erro: You can find my code here . |
The link 404s for me. Double check that a restore has been run: VS can get confused sometimes, and running |
Sorry, the repo was not public. You can try again. I tired running dotnet restore but it did not work. |
This should be referencing version |
So if I understand correctly it should be working, right? So why it isn't :) |
The line in the csproj is wrong: it should be
|
Thank you. That really helped. But now I can't seem to get it working properly. Nothing is displayed in the window. Can you take a look and tell me what I am doing wrong? |
You've commented out the style inclue: https://github.com/LyubomiRadev/PieChart/blob/master/AvaloniaApplication1/App.axaml#L9C8-L9C110 |
When I include the Style I get an error: No precompiled XAML found for resm:OxyPlot.Avalonia.Themes.Default.xaml?assembly=OxyPlot.Avalonia (baseUri: avares://AvaloniaApplication1/App.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource. That is why it was commented. |
Oh yes, that's the old one. With Avalonia11 you need this style include: |
Fantastic! No building errors whatsoever. But I am not able to display the chart. All I see is the Title of the chart that I've put. I have created the Continents collection as in the example, but I am not able to display the chart. Is the view not detecting the changes in the collection? |
The documentation is pretty patchy, and none of it applies to the Avalonia provision. You are using compiled bindings, and then using an annoumous type as your data-context: this is asking for trouble. It seems to work fine if you replace it with Then it will match the declared type https://github.com/LyubomiRadev/PieChart/blob/master/AvaloniaApplication1/Views/MainWindow.axaml#L10 |
NICE! That work. Thank you for all your help. I am quite new to Avalonia and am not familiar with a lot of things, which is weird, because I worked with WPF for 7 years 😄 Anyway thank you very much :) |
build error:
runtime error
The text was updated successfully, but these errors were encountered: