项目结构调整

This commit is contained in:
艾竹
2023-04-16 20:11:40 +08:00
parent cbfbf96033
commit 81f91f3f35
2124 changed files with 218 additions and 5516 deletions

View File

@@ -0,0 +1,21 @@
<Page
x:Class="UWP.CartesianChart.Basic_Bars.BasicColumn"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWP.CartesianChart.Basic_Bars"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lvc="using:LiveCharts.Uwp"
mc:Ignorable="d" d:DataContext="{d:DesignInstance local:BasicColumn}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<lvc:CartesianChart Series="{x:Bind SeriesCollection}" LegendLocation="Left">
<lvc:CartesianChart.AxisX>
<lvc:Axis Title="Salesman" Labels="{x:Bind Labels}"/>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Title="Sold Apps" LabelFormatter="{x:Bind Formatter}"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Grid>
</Page>

View File

@@ -0,0 +1,48 @@
using System;
using Windows.UI.Xaml.Controls;
using LiveCharts;
using LiveCharts.Uwp;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace UWP.CartesianChart.Basic_Bars
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class BasicColumn : Page
{
public BasicColumn()
{
InitializeComponent();
SeriesCollection = new SeriesCollection
{
new ColumnSeries
{
Title = "2015",
Values = new ChartValues<double> { 10, 50, 39, 50 }
}
};
//adding series will update and animate the chart automatically
SeriesCollection.Add(new ColumnSeries
{
Title = "2016",
Values = new ChartValues<double> { 11, 56, 42 }
});
//also adding values updates and animates the chart automatically
SeriesCollection[1].Values.Add(48d);
Labels = new[] { "Maria", "Susan", "Charles", "Frida" };
Formatter = value => value.ToString("N");
DataContext = this;
}
public SeriesCollection SeriesCollection { get; set; }
public string[] Labels { get; set; }
public Func<double, string> Formatter { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
<Page
x:Class="UWP.CartesianChart.Basic_Bars.BasicRowExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWP.CartesianChart.Basic_Bars"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:lvc="using:LiveCharts.Uwp"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<lvc:CartesianChart Series="{x:Bind SeriesCollection}" LegendLocation="Bottom">
<lvc:CartesianChart.AxisX>
<lvc:Axis Title="Salesman" LabelFormatter="{x:Bind Formatter}"></lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Title="Sold Apps" Labels="{x:Bind Labels}"></lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip SelectionMode="SharedYValues"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
</lvc:CartesianChart>
</Grid>
</Page>

View File

@@ -0,0 +1,46 @@
using LiveCharts;
using LiveCharts.Uwp;
using System;
using Windows.UI.Xaml.Controls;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace UWP.CartesianChart.Basic_Bars
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class BasicRowExample : Page
{
public BasicRowExample()
{
InitializeComponent();
SeriesCollection = new SeriesCollection
{
new RowSeries
{
Title = "2015",
Values = new ChartValues<double> { 10, 50, 39, 50 }
}
};
//adding series will update and animate the chart automatically
SeriesCollection.Add(new RowSeries
{
Title = "2016",
Values = new ChartValues<double> { 11, 56, 42 }
});
//also adding values updates and animates the chart automatically
SeriesCollection[1].Values.Add(48d);
Labels = new[] { "Maria", "Susan", "Charles", "Frida" };
Formatter = value => value.ToString("N");
}
public SeriesCollection SeriesCollection { get; set; }
public string[] Labels { get; set; }
public Func<double, string> Formatter { get; set; }
}
}