-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c90b43e
commit fa19edd
Showing
22 changed files
with
416 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
|
||
<UserControl x:Class="AvaloniaSample.Pies.OutLabels.View" | ||
xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:lv="clr-namespace:LiveChartsCore;assembly=LiveChartsCore" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia" | ||
xmlns:vms="using:ViewModelsSamples.Pies.OutLabels"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:PieChart Series="{Binding Series}" | ||
IsClockwise="False" | ||
InitialRotation="-90"> | ||
</lvc:PieChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace AvaloniaSample.Pies.OutLabels; | ||
|
||
public partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void InitializeComponent() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@page "/Pies/OutLabels" | ||
@using LiveChartsCore.SkiaSharpView.Blazor | ||
@using ViewModelsSamples.Pies.OutLabels | ||
|
||
<PieChart | ||
Series="ViewModel.Series" | ||
IsClockwise="false" | ||
InitialRotation="-90"> | ||
</PieChart> | ||
|
||
@code { | ||
public ViewModel ViewModel { get; set; } = new(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Eto.Forms; | ||
using LiveChartsCore.SkiaSharpView.Eto; | ||
using ViewModelsSamples.Pies.OutLabels; | ||
|
||
namespace EtoFormsSample.Pies.OutLabels; | ||
|
||
public class View : Panel | ||
{ | ||
private readonly PieChart pieChart; | ||
|
||
public View() | ||
{ | ||
var viewModel = new ViewModel(); | ||
|
||
pieChart = new PieChart | ||
{ | ||
Series = viewModel.Series, | ||
IsClockwise = false, | ||
InitialRotation = -90 | ||
}; | ||
|
||
Content = pieChart; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage x:Class="MauiSample.Pies.OutLabels.View" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui" | ||
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.OutLabels;assembly=ViewModelsSamples" | ||
> | ||
<ContentPage.BindingContext> | ||
<vms:ViewModel/> | ||
</ContentPage.BindingContext> | ||
<lvc:PieChart | ||
Series="{Binding Series}" | ||
IsClockwise="False" | ||
InitialRotation="-90"> | ||
</lvc:PieChart> | ||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace MauiSample.Pies.OutLabels; | ||
|
||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
public partial class View : ContentPage | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<UserControl x:Class="UWPSample.Pies.OutLabels.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Uno" | ||
xmlns:vms="using:ViewModelsSamples.Pies.OutLabels" | ||
mc:Ignorable="d"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:PieChart | ||
Series="{Binding Series}" | ||
IsClockwise="False" | ||
InitialRotation="-90"> | ||
</lvc:PieChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace UWPSample.Pies.OutLabels | ||
{ | ||
public sealed partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
samples/UnoPlatformSample/UnoPlatformSample/LiveChartsSamples/Pies/OutLabels/View.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<UserControl x:Class="UnoWinUISample.Pies.OutLabels.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.WinUI" | ||
xmlns:vms="using:ViewModelsSamples.Pies.OutLabels" | ||
mc:Ignorable="d"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:PieChart | ||
Series="{Binding Series}" | ||
IsClockwise="False" | ||
InitialRotation="-90"> | ||
</lvc:PieChart> | ||
</UserControl> |
11 changes: 11 additions & 0 deletions
11
samples/UnoPlatformSample/UnoPlatformSample/LiveChartsSamples/Pies/OutLabels/View.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace UnoWinUISample.Pies.OutLabels; | ||
|
||
public sealed partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
using LiveChartsCore; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using LiveChartsCore.SkiaSharpView.Painting; | ||
using SkiaSharp; | ||
using LiveChartsCore.SkiaSharpView.Extensions; | ||
using System; | ||
|
||
namespace ViewModelsSamples.Pies.OutLabels; | ||
|
||
public partial class ViewModel : ObservableObject | ||
{ | ||
public IEnumerable<ISeries> Series { get; set; } = | ||
new[] { 8, 6, 5, 3, 3 }.AsPieSeries((value, series) => | ||
{ | ||
series.DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Outer; // mark | ||
series.DataLabelsSize = 15; | ||
series.DataLabelsPaint = new SolidColorPaint(new SKColor(30, 30, 30)); | ||
series.DataLabelsFormatter = | ||
point => | ||
$"This slide takes{Environment.NewLine}" + | ||
$"{point.Coordinate.PrimaryValue} out of {point.StackedValue!.Total} parts"; | ||
}); | ||
|
||
// add some margin to the chart so the labels can be drawn // mark | ||
public LiveChartsCore.Measure.Margin DrawMargin { get; set; } = | ||
new LiveChartsCore.Measure.Margin(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<UserControl x:Class="WPFSample.Pies.OutLabels.View" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" | ||
xmlns:vms="clr-namespace:ViewModelsSamples.Pies.OutLabels;assembly=ViewModelsSamples"> | ||
<UserControl.DataContext> | ||
<vms:ViewModel/> | ||
</UserControl.DataContext> | ||
<lvc:PieChart | ||
Series="{Binding Series}" | ||
IsClockwise="False" | ||
InitialRotation="-90"> | ||
</lvc:PieChart> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Windows.Controls; | ||
|
||
namespace WPFSample.Pies.OutLabels; | ||
|
||
/// <summary> | ||
/// Interaction logic for View.xaml | ||
/// </summary> | ||
public partial class View : UserControl | ||
{ | ||
public View() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Windows.Forms; | ||
using LiveChartsCore.SkiaSharpView.WinForms; | ||
using ViewModelsSamples.Pies.OutLabels; | ||
|
||
namespace WinFormsSample.Pies.OutLabels; | ||
|
||
public partial class View : UserControl | ||
{ | ||
private readonly PieChart pieChart; | ||
|
||
public View() | ||
{ | ||
InitializeComponent(); | ||
Size = new System.Drawing.Size(50, 50); | ||
|
||
var viewModel = new ViewModel(); | ||
|
||
pieChart = new PieChart | ||
{ | ||
Series = viewModel.Series, | ||
IsClockwise = false, | ||
InitialRotation = -90, | ||
|
||
// out of livecharts properties... | ||
Location = new System.Drawing.Point(0, 0), | ||
Size = new System.Drawing.Size(50, 50), | ||
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom | ||
}; | ||
|
||
Controls.Add(pieChart); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<root> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
<xsd:complexType> | ||
<xsd:choice maxOccurs="unbounded"> | ||
<xsd:element name="metadata"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" use="required" type="xsd:string" /> | ||
<xsd:attribute name="type" type="xsd:string" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="assembly"> | ||
<xsd:complexType> | ||
<xsd:attribute name="alias" type="xsd:string" /> | ||
<xsd:attribute name="name" type="xsd:string" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="data"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="resheader"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:choice> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>2.0</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
</root> |
Oops, something went wrong.