mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-19 16:06:35 +08:00
项目结构调整
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<UserControl x:Class="Wpf.CartesianChart.LineExample"
|
||||
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"
|
||||
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:LineExample }">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<lvc:CartesianChart Grid.Row="2">
|
||||
<lvc:CartesianChart.Series>
|
||||
<lvc:VerticalLineSeries Values="{Binding Values}" DataLabels="True" />
|
||||
</lvc:CartesianChart.Series>
|
||||
<lvc:CartesianChart.DataTooltip>
|
||||
<!--The Selection mode property should be done automatically in future versions-->
|
||||
<lvc:DefaultTooltip SelectionMode="SharedYValues"></lvc:DefaultTooltip>
|
||||
</lvc:CartesianChart.DataTooltip>
|
||||
</lvc:CartesianChart>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
using LiveCharts.Defaults;
|
||||
using LiveCharts.Wpf;
|
||||
|
||||
namespace Wpf.CartesianChart
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for LineExample.xaml
|
||||
/// </summary>
|
||||
public partial class LineExample : UserControl
|
||||
{
|
||||
public LineExample()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Values = Values = new ChartValues<float>
|
||||
{
|
||||
3,
|
||||
4,
|
||||
6,
|
||||
3,
|
||||
2,
|
||||
6
|
||||
};
|
||||
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public ChartValues<float> Values { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user