-
Notifications
You must be signed in to change notification settings - Fork 1
/
CodeBehindMainPage.cs
37 lines (35 loc) · 1.24 KB
/
CodeBehindMainPage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.Maui;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MauiSample
{
public class CodeBehindMainPage : ContentPage
{
CartesianChart chart;
public CodeBehindMainPage()
{
var label = new Label { Text = "Entry - I'm displaying" };
chart = new CartesianChart() { VerticalOptions = LayoutOptions.Center };
chart.Series = new ISeries[]
{
new LineSeries<double>
{
Values = new double[] { 2, 1, 3, 5, 3, 4, 6, 6, 6 },
Fill = null
}
};
var grid = new Grid() { Margin = 10};
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
grid.Add(label,0,0);
grid.Add(chart, 0, 1);
Content = grid;
}
}
}