项目结构调整

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 @@
<UserControl x:Class="Wpf.CartesianChart.CustomZoomingAndPanning.MoveMe"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf.CartesianChart.CustomZoomingAndPanning"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:MoveMe}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<lvc:CartesianChart>
<lvc:CartesianChart.Series>
<lvc:LineSeries Values="{Binding SeriesValues}" StrokeThickness="4" PointDiameter="18" />
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
</Grid>
</UserControl>

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using LiveCharts;
namespace Wpf.CartesianChart.CustomZoomingAndPanning
{
/// <summary>
/// Interaction logic for MoveMe.xaml
/// </summary>
public partial class MoveMe : UserControl
{
public MoveMe()
{
InitializeComponent();
SeriesValues = GetData();
DataContext = this;
}
public ChartValues<double> SeriesValues { get; set; }
private ChartValues<double> GetData()
{
var r = new Random();
var trend = 100;
var values = new ChartValues<double>();
for (var i = 0; i < 160; i++)
{
var seed = r.NextDouble();
if (seed > .8) trend += seed > .9 ? 50 : -50;
values.Add(trend + r.Next(0, 10));
}
return values;
}
}
}