beto-rodriguez/LiveCharts2

MAUI code-behind don't display chart

Closed this issue · 5 comments

Describe the bug
MAUI code-behind don't display chart similar as #481 , without any error.

internal class CodeBehindMainPage : ContentPage
{
public CodeBehindMainPage()
{
var chart = new CartesianChart();
chart.Series = new ISeries[]
{
new LineSeries
{
Values = new double[] { 2, 1, 3, 5, 3, 4, 6 },
Fill = null
}
};
var grid = new Grid();
grid.Add(chart);
Content = grid;
}
}

But when I drag the window to another display and resize the window , chart appears.

To Reproduce
Steps to reproduce the behavior:

  1. run code in debug or release model, chart don't display
  2. drag the window to another display, chart appears

Expected behavior
chart is visible .

Screenshots

Desktop (please complete the following information):

  • OS: windows 11
  • Visual studio :17.12.3
  • net : 9.0
  • LiveChartsCore.SkiaSharpView.Maui : 2.0.0-rc4.5

LiveChartsCore.SkiaSharpView.Maui Version 2.0.0-rc3 is OK.

So this maybe a repetitive issue。

No matter LiveChartsCore.SkiaSharpView.Maui : 2.0.0-rc4.5 or 2.0.0-rc3, when CartesianChart is hosted in a StackLayout using Code-Behind mode, CartesianChart will not visible, too.

@evolcano

StackLayout using Code-Behind mode, CartesianChart will not visible, too.

Probably related to: #1483

@beto-rodriguez Yes, after I set size, CartesianChart appears in StackLayout. Thanks.

Glad to read that! I will close this for now!