项目结构调整

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,18 @@
<Page
x:Class="UWP.CartesianChart.LogarithmScale.LogarithmScaleExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWP.CartesianChart.LogarithmScale"
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="{Binding SeriesCollection}">
<lvc:CartesianChart.AxisX>
<lvc:LogarithmicAxis LabelFormatter="{Binding Formatter}" Base="10" />
</lvc:CartesianChart.AxisX>
</lvc:CartesianChart>
</Grid>
</Page>

View File

@@ -0,0 +1,51 @@
using LiveCharts;
using LiveCharts.Configurations;
using LiveCharts.Defaults;
using LiveCharts.Definitions.Charts;
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.LogarithmScale
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class LogarithmScaleExample : Page
{
public LogarithmScaleExample()
{
InitializeComponent();
SeriesCollection = new SeriesCollection(Mappers.Xy<ObservablePoint>()
.X(point => Math.Log10(point.X))
.Y(point => point.Y))
{
new LineSeries
{
Values = new ChartValues<ObservablePoint>
{
new ObservablePoint(1, 5),
new ObservablePoint(10, 6),
new ObservablePoint(100, 4),
new ObservablePoint(1000, 2),
new ObservablePoint(10000, 8),
new ObservablePoint(100000, 2),
new ObservablePoint(1000000, 9),
new ObservablePoint(10000000, 8)
}
}
};
Formatter = value => Math.Pow(10, value).ToString("N");
DataContext = this;
}
public SeriesCollection SeriesCollection { get; set; }
public Func<double, string> Formatter { get; set; }
public ISeparatorView CleanSeparator { get; set; } = DefaultAxes.CleanSeparator;
}
}