Skip to content
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

Chart Not loading Unless Hot Reload is Pressed #1711

Open
nourhammoury opened this issue Nov 23, 2024 · 1 comment
Open

Chart Not loading Unless Hot Reload is Pressed #1711

nourhammoury opened this issue Nov 23, 2024 · 1 comment

Comments

@nourhammoury
Copy link

nourhammoury commented Nov 23, 2024

Describe the bug
I have been trying to figure this out for over two days, but I haven't been able to. I downloaded the master version, but I still couldn't resolve the issue. It works fine on Android, but I can't figure it out on Windows.

I even tried creating a clean project, and I'm experiencing the same problem. I have attached the simple project based on the documentation. I would appreciate it if anyone could clarify what I am doing wrong.

To make the chart appear, modify any line in the XAML file, restore it, and then click on Hot Reload. Otherwise, it won't work.

Code Below
App.xaml.cs
`
namespace LiveCharts2
{
public partial class App : Application
{
public App()
{
InitializeComponent();

        //MainPage = new AppShell();
        MainPage = new Chart();
    }
}

}
`

ViewModel.cs
`using LiveChartsCore.SkiaSharpView.Drawing.Geometries;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiveCharts2
{
public class ViewModel
{
public ISeries[] Series { get; set; } = [
new ColumnSeries(3, 4, 2),
new ColumnSeries(4, 2, 6),
new ColumnSeries<double, DiamondGeometry>(4, 3, 4)
];
}
}
**Chart.xaml**

<ContentPage.BindingContext>
local:ViewModel/
</ContentPage.BindingContext>
<ContentPage.Content>

<lvc:CartesianChart
Series="{Binding Series}">
</lvc:CartesianChart>

</ContentPage.Content>
`

Chart.xaml.cs
`namespace LiveCharts2;

public partial class Chart : ContentPage
{
public Chart()
{
InitializeComponent();
}
}`

Desktop

  • OS: 22631.4460
  • Maui Latest
  • .Net8

Smartphone

  • Device: Android
  • OS: API 34
@nourhammoury
Copy link
Author

Video

2024-11-23_14-10-15.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant