beto-rodriguez / LiveCharts2

Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
https://livecharts.dev
MIT License
4.25k stars 552 forks source link

UWP install from NuGet #145

Closed polymorphicshade closed 2 years ago

polymorphicshade commented 3 years ago

Browsing https://nuget.info/packages/LiveChartsCore.SkiaSharpView.UWP/2.0.0-beta.40 shows no binaries I can use in my UWP project.

Am I missing something? When I try to use this nuget package in my Visual Studio project, I'm unable to use any LiveChart controls in the XAML and I cannot compile successfully.

beto-rodriguez commented 3 years ago

The package is missing the dependency to the core packages, I'll fix in the next release, for now please try to install the core manually.

https://www.nuget.org/packages/LiveChartsCore.SkiaSharpView/2.0.0-beta.40

Or clone this repo and add the reference to your project.

polymorphicshade commented 3 years ago

Thanks that seemed to work for now... but the designer is giving me issues (may or may not be related to me referencing the projects manually):

image

Things do show up fine at runtime.

I wasn't able to add LiveChartsCore and LiveChartsCore.SkiaSharpView to my UWP project through the Visual Studio UI, but I had to manually add them in the .csproj file.

beto-rodriguez commented 3 years ago

Should be fixed with 1c7f4ec8d39ef5e8354a9164e85189361e643a17

I will test, then close if it works.

beto-rodriguez commented 3 years ago

I made the NuGet package work following the next steps:

  1. Install at least beta.57
  2. Install manually the dependencies (I am not sure why they are not getting installed automatically)

image

  1. Finally when the app starts, in the App.xaml file, at the OnLaunched method, add the following line:

LiveCharts.Configure(config => config.AddDefaultMappers().AddSkiaSharp().AddLightTheme());

This works for now, but this should be improved in a future version.

polymorphicshade commented 3 years ago

@beto-rodriguez I tried out the latest beta.60 and everything seems to be working fine so far! 😊 No crashing or designer issues at the moment. Though like you mentioned, I needed to install LiveChartsCore and LiveChartsCore.SkiaSharpView manually.

I didn't need to add that piece of code to App.xaml.cs, but I'll keep that code in mind if I run into any issues.

humbertomoli99 commented 3 years ago

I was using the core of livecharts 1, how crazy to confuse LiveCharts.Core with LiveChartsCore

rubenseam commented 3 years ago

@beto-rodriguez I'm trying the library on a WinUI3 app, but I'm getting the "missing .xbf file" errors when building the code: error MSB3030: Could not copy the file "C:\Users\rualvesm.nuget\packages\livechartscore.skiasharpview.winui\2.0.0-beta.70\lib\net5.0-windows10.0.19041\LiveChartsCore.SkiaSharpView.WinUI\DefaultTooltip.xbf" because it was not found.

Any chance you've seen this before?

beto-rodriguez commented 3 years ago

@rubenseam for WinUI3 please install the WinUI 3 package:

LiveChartsCore.SkiaSharpView.WinUI

WinUI (WinUI3) is so different from WinUI2.

https://docs.microsoft.com/en-us/windows/apps/winui/

rubenseam commented 3 years ago

Sorry, @beto-rodriguez , I'm not sure which packages I should install. I do have WinUI3 set up for my application. image Should I try and install some specific version of LiveCharts/SkiaSharp?

beto-rodriguez commented 3 years ago

@rubenseam WinUI3 is not related to UWP.

The packages you installed seem right.

Take a look at the sample that is running on WinUI in this repo:

https://github.com/beto-rodriguez/LiveCharts2/tree/master/samples/WinUISample/WinUI

beto-rodriguez commented 2 years ago

this issue is gone in beta.80 package, for both WinUI and UWP.