mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 08:26:36 +08:00
项目结构调整
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<Page
|
||||
x:Class="UWP.CartesianChart.MultiAxes.MultiAxesChart"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:UWP.CartesianChart.MultiAxes"
|
||||
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}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" TextWrapping="Wrap">
|
||||
You can create multiple axes, just set the Series.ScalesXAt or Series.ScalesYAt properties, you must also add the axis explicitly.
|
||||
</TextBlock>
|
||||
<lvc:CartesianChart Grid.Row="2">
|
||||
<lvc:CartesianChart.AxisY>
|
||||
<lvc:Axis Foreground="DodgerBlue" Title="Blue Axis"/>
|
||||
<lvc:Axis Foreground="IndianRed" Title="Red Axis" Position="RightTop" Separator="{x:Bind CleanSeparator}"/>
|
||||
<lvc:Axis Foreground="DarkOliveGreen" Title="Green Axis" Position="RightTop" Separator="{x:Bind CleanSeparator}"/>
|
||||
</lvc:CartesianChart.AxisY>
|
||||
<lvc:CartesianChart.Series>
|
||||
<lvc:LineSeries Values="{x:Bind LineValues1}" ScalesYAt="0"/>
|
||||
<!--Scales at blue axis, Axis[0]-->
|
||||
<lvc:LineSeries Values="{x:Bind LineValues2}" ScalesYAt="1"/>
|
||||
<!--Scales at red axis, Axis[1]-->
|
||||
<lvc:LineSeries Values="{x:Bind LineValues3}" ScalesYAt="2"/>
|
||||
<!--Scales at green axis, Axis[2]-->
|
||||
</lvc:CartesianChart.Series>
|
||||
</lvc:CartesianChart>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,26 @@
|
||||
using LiveCharts;
|
||||
using LiveCharts.Definitions.Charts;
|
||||
using LiveCharts.Uwp;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
|
||||
|
||||
namespace UWP.CartesianChart.MultiAxes
|
||||
{
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class MultiAxesChart : Page
|
||||
{
|
||||
public MultiAxesChart()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
public ISeparatorView CleanSeparator { get; set; } = DefaultAxes.CleanSeparator;
|
||||
|
||||
public IChartValues LineValues1 { get; set; } = new ChartValues<int>(new int[] { 1, 5, 3, 5, 3 });
|
||||
public IChartValues LineValues2 { get; set; } = new ChartValues<int>(new int[] { 20, 30, 70, 20, 10 });
|
||||
public IChartValues LineValues3 { get; set; } = new ChartValues<int>(new int[] { 600, 300, 200, 600, 800 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user