├── CrossPieCharts ├── CrossPieCharts.FormsPlugin.Android │ ├── Resources │ │ ├── Resource.Designer.cs │ │ └── AboutResources.txt │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── CrossPieChartRenderer.cs │ ├── CrossPieCharts.FormsPlugin.Android.csproj.bak │ └── CrossPieCharts.FormsPlugin.Android.csproj ├── CrossPieCharts.WindowsPhone81 │ ├── Assets │ │ ├── Logo.scale-240.png │ │ ├── SmallLogo.scale-240.png │ │ ├── StoreLogo.scale-240.png │ │ ├── WideLogo.scale-240.png │ │ ├── SplashScreen.scale-240.png │ │ └── Square71x71Logo.scale-240.png │ ├── packages.config │ ├── App.xaml │ ├── MainPage.xaml │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── App.xaml.cs │ └── CrossPieCharts.WindowsPhone81.csproj ├── CrossPieCharts.WindowsStore │ ├── Assets │ │ ├── Logo.scale-100.png │ │ ├── SmallLogo.scale-100.png │ │ ├── StoreLogo.scale-100.png │ │ └── SplashScreen.scale-100.png │ ├── packages.config │ ├── App.xaml │ ├── MainPage.xaml │ ├── Read_me.txt │ ├── MainPage.xaml.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Package.appxmanifest │ ├── App.xaml.cs │ ├── CrossPieCharts.WindowsStore.csproj │ └── PieChart.cs ├── CrossPieCharts.FormsPlugin.Windows10 │ ├── Assets │ │ ├── StoreLogo.png │ │ ├── SplashScreen.scale-200.png │ │ ├── LockScreenLogo.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── App.xaml │ ├── project.json │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── Package.appxmanifest │ ├── App.xaml.cs │ └── CrossPieCharts.FormsPlugin.Windows10.csproj ├── CrossPieCharts.FormsPlugin.iOSUnified │ ├── packages.config │ ├── CrossPieChartRenderer.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── CrossPieCharts.FormsPlugin.iOSUnified.csproj ├── CrossPieCharts.FormsPlugin.Abstractions │ ├── packages.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── CrossPieChartView.cs │ ├── CrossPieCharts.FormsPlugin.Abstractions.csproj │ └── CrossPieChartSample.cs └── CrossPieCharts.FormsPlugin.WindowsPhone │ ├── Toolkit.Content │ ├── ApplicationBar.Add.png │ ├── ApplicationBar.Check.png │ ├── ApplicationBar.Cancel.png │ ├── ApplicationBar.Delete.png │ └── ApplicationBar.Select.png │ ├── README_FIRST.txt │ ├── packages.config │ ├── Properties │ └── AssemblyInfo.cs │ ├── CrossPieChartRenderer.cs │ └── CrossPieCharts.FormsPlugin.WindowsPhone.csproj ├── nuget.exe ├── Screenshots ├── pie.PNG ├── charts_logo.PNG ├── piecharts-uwp-icon.png ├── piecharts-uwp-icon-200.png └── CrossPieCharts_screenshot.png ├── CrossPieCharts.Vsix ├── CrossPieChart_wp3.png ├── piecharts-uwp-icon.png ├── ProjectTemplates │ └── Windows │ │ └── Universal │ │ └── PieCharts for Windows UWP.zip ├── Properties │ └── AssemblyInfo.cs ├── source.extension.vsixmanifest ├── stylesheet.css ├── index.html └── CrossPieCharts.Vsix.csproj ├── Xam.FormsPlugin.CrossPieChart.1.0.0.nupkg ├── CrossPieChartsTemplate ├── CrossPieChart_wp3.png ├── piecharts-uwp-icon.png ├── ProjectTemplates │ └── Windows │ │ └── Universal │ │ └── PieCharts for Windows UWP.zip ├── source.extension.vsixmanifest ├── Properties │ └── AssemblyInfo.cs ├── stylesheet.css ├── index.html └── CrossPieChartsTemplate.csproj ├── UWP └── CrossPieCharts.UWP │ ├── Assets │ ├── StoreLogo.png │ ├── SplashScreen.scale-200.png │ ├── LockScreenLogo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Wide310x150Logo.scale-200.png │ ├── Square150x150Logo.scale-200.png │ └── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── App.xaml │ ├── project.json │ ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── App.xaml.cs │ ├── MainPage.xaml │ ├── CrossPieCharts.UWP.csproj │ └── PieCharts │ └── PieChart.cs ├── README.md ├── PieCharts.WinRT.nuspec ├── .gitattributes ├── .gitignore └── CrossPieCharts.FormsPlugin.nuspec /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/Resources/Resource.Designer.cs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /nuget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/nuget.exe -------------------------------------------------------------------------------- /Screenshots/pie.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Screenshots/pie.PNG -------------------------------------------------------------------------------- /Screenshots/charts_logo.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Screenshots/charts_logo.PNG -------------------------------------------------------------------------------- /Screenshots/piecharts-uwp-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Screenshots/piecharts-uwp-icon.png -------------------------------------------------------------------------------- /Screenshots/piecharts-uwp-icon-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Screenshots/piecharts-uwp-icon-200.png -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/CrossPieChart_wp3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts.Vsix/CrossPieChart_wp3.png -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/piecharts-uwp-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts.Vsix/piecharts-uwp-icon.png -------------------------------------------------------------------------------- /Screenshots/CrossPieCharts_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Screenshots/CrossPieCharts_screenshot.png -------------------------------------------------------------------------------- /Xam.FormsPlugin.CrossPieChart.1.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/Xam.FormsPlugin.CrossPieChart.1.0.0.nupkg -------------------------------------------------------------------------------- /CrossPieChartsTemplate/CrossPieChart_wp3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieChartsTemplate/CrossPieChart_wp3.png -------------------------------------------------------------------------------- /CrossPieChartsTemplate/piecharts-uwp-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieChartsTemplate/piecharts-uwp-icon.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/Logo.scale-240.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsStore/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/StoreLogo.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/SmallLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/SmallLogo.scale-240.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/StoreLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/StoreLogo.scale-240.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/WideLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/WideLogo.scale-240.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsStore/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsStore/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.iOSUnified/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsStore/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/SplashScreen.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/SplashScreen.scale-240.png -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/UWP/CrossPieCharts.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/Square71x71Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.WindowsPhone81/Assets/Square71x71Logo.scale-240.png -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/ProjectTemplates/Windows/Universal/PieCharts for Windows UWP.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts.Vsix/ProjectTemplates/Windows/Universal/PieCharts for Windows UWP.zip -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Abstractions/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /CrossPieChartsTemplate/ProjectTemplates/Windows/Universal/PieCharts for Windows UWP.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieChartsTemplate/ProjectTemplates/Windows/Universal/PieCharts for Windows UWP.zip -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Add.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Check.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/README_FIRST.txt: -------------------------------------------------------------------------------- 1 | For the Windows Phone toolkit make sure that you have 2 | marked the icons in the "Toolkit.Content" folder as content. That way they 3 | can be used as the icons for the ApplicationBar control. -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Cancel.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Delete.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Toolkit.Content/ApplicationBar.Select.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/HEAD/CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" 4 | }, 5 | "frameworks": { 6 | "uap10.0": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.iOSUnified/CrossPieChartRenderer.cs: -------------------------------------------------------------------------------- 1 | using CrossPieCharts.FormsPlugin.Abstractions; 2 | using System; 3 | using Xamarin.Forms; 4 | using CrossPieCharts.FormsPlugin.iOSUnified; 5 | using Xamarin.Forms.Platform.iOS; 6 | 7 | [assembly: ExportRenderer(typeof(CrossPieChartView), typeof(CrossPieChartRenderer))] 8 | namespace CrossPieCharts.FormsPlugin.iOSUnified 9 | { 10 | /// 11 | /// CrossPieCharts Renderer 12 | /// 13 | public class CrossPieChartRenderer //: TRender (replace with renderer type 14 | { 15 | /// 16 | /// Used for registration with dependency service 17 | /// 18 | public static void Init() 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Read_me.txt: -------------------------------------------------------------------------------- 1 | Two steps to add a pie chart to your xaml page : 2 | 3 | 1) Add the following attribute to your Page node : 4 | 5 | xmlns:pieChartWinRT="using:CrossPieCharts.WinRT" 6 | 7 | 8 | 2) Add the following XAML code to your MainPage.cs.xaml : 9 | 10 | 16 | 17 | Optionally, you can add a TextBlock to display percentage : 18 | 19 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 17 | 18 | namespace CrossPieCharts.WindowsStore 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage : Page 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 17 | 18 | namespace CrossPieCharts.FormsPlugin.Windows10 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage : Page 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.WindowsStore")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.WindowsStore")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.WindowsPhone81")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.WindowsPhone81")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /CrossPieChartsTemplate/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pie Charts for Windows UWP template 6 | Pie Charts for Windows UWP Template. 7 | piecharts-uwp-icon.png 8 | CrossPieChart_wp3.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.FormsPlugin.Windows10")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.FormsPlugin.Windows10")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("CrossPieCharts.FormsPlugin.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("CrossPieCharts.FormsPlugin.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Abstractions/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("CrossPieCharts.FormsPlugin.Abstractions")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("CrossPieCharts.FormsPlugin.Abstractions")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.Vsix")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.Vsix")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CrossPieChartsTemplate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieChartsTemplate")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieChartsTemplate")] 13 | [assembly: AssemblyCopyright("")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the values or you can default the Build and Revision Numbers 30 | // by using the '*' as shown below: 31 | // [assembly: AssemblyVersion("1.0.*")] 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Xamarin-Forms-Pie-Chart 2 | 3 | Enrich your mobile application with Pie Charts. 4 | 5 | Supported platforms: 6 | 7 | 1) Xamarin for Android 8 | 2) Windows Phone Silverlight 9 | 3) Windows Phone RT 10 | 4) Windows Store 11 | iOS is not supported yet! 12 | 13 | 14 | 15 | To add a Pie Chart control from your Xamarin Forms project (XAML or CSharp): 16 | 17 | var crossPieChartView = new CrossPieChartView
18 | {
19 |   Progress = 60,
20 |   ProgressColor = Color.Green,
21 |   ProgressBackgroundColor = Color.Gray,
22 |   StrokeThickness = Device.OnPlatform(10, 20, 80),
23 |   Radius = Device.OnPlatform(100, 180, 160),
24 |   BackgroundColor = Color.White
25 | };
26 | 27 | Here is a video that shows how to install and use the plugin : https://www.youtube.com/watch?v=9alb3AFHkRs 28 | 29 | The nuget package is available at : https://www.nuget.org/packages/Xam.FormsPlugin.CrossPieChart/ 30 | 31 | This plugin was built developed using existing work from: 32 | 33 | James Montemagno : https://github.com/jamesmontemagno/MonoDroidToolkit/wiki/HoloCircularProgressBar/ 34 | 35 | Timo Korinth : http://timokorinth.de/creating-circular-progress-bar-wpf-silverlight/ 36 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI; 9 | using Windows.UI.Xaml; 10 | using Windows.UI.Xaml.Controls; 11 | using Windows.UI.Xaml.Controls.Primitives; 12 | using Windows.UI.Xaml.Data; 13 | using Windows.UI.Xaml.Input; 14 | using Windows.UI.Xaml.Media; 15 | using Windows.UI.Xaml.Navigation; 16 | using CrossPieCharts.UWP.PieCharts; 17 | 18 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 19 | 20 | namespace CrossPieCharts.UWP 21 | { 22 | /// 23 | /// An empty page that can be used on its own or navigated to within a Frame. 24 | /// 25 | public sealed partial class MainPage : Page 26 | { 27 | public MainPage() 28 | { 29 | this.InitializeComponent(); 30 | 31 | //var pieChart = new PieChart 32 | //{ 33 | // Percentage = 70, 34 | // Radius = 200, 35 | // BackgroundColor = new SolidColorBrush(Colors.AliceBlue), 36 | // Segment360Color = new SolidColorBrush(Colors.DeepSkyBlue), 37 | // SegmentColor = new SolidColorBrush(Colors.Teal), 38 | // StrokeThickness = 30 39 | //}; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | CrossPieCharts.WindowsStore 10 | Houssem 11 | Assets\StoreLogo.png 12 | 13 | 14 | 15 | 6.3.0 16 | 6.3.0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/source.extension.vsixmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pie Charts for Windows UWP template 6 | Pie Charts for Windows UWP Template. 7 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 8 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 9 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 10 | piecharts-uwp-icon.png 11 | CrossPieChart_wp3.png 12 | uap; uwp; chart; charts; pie; doghnut; 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.iOSUnified/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CrossPieCharts.FormsPlugin.iOSUnified")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CrossPieCharts.FormsPlugin.iOSUnified")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a41090b7-b41d-469a-99d0-c35666b573d0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Resources; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("CrossPieCharts.FormsPlugin.WindowsPhone")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("CrossPieCharts.FormsPlugin.WindowsPhone")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("983b7eff-7e75-4a87-890a-744a0b4c5232")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Revision and Build Numbers 34 | // by using the '*' as shown below: 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | [assembly: NeutralResourcesLanguageAttribute("en-US")] 38 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | CrossPieCharts.UWP 18 | Houssem 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=391641 17 | 18 | namespace CrossPieCharts.WindowsPhone81 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage : Page 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | 29 | this.NavigationCacheMode = NavigationCacheMode.Required; 30 | } 31 | 32 | /// 33 | /// Invoked when this page is about to be displayed in a Frame. 34 | /// 35 | /// Event data that describes how this page was reached. 36 | /// This parameter is typically used to configure the page. 37 | protected override void OnNavigatedTo(NavigationEventArgs e) 38 | { 39 | // TODO: Prepare page for display here. 40 | 41 | // TODO: If your application contains multiple pages, ensure that you are 42 | // handling the hardware Back button by registering for the 43 | // Windows.Phone.UI.Input.HardwareButtons.BackPressed event. 44 | // If you are using the NavigationHelper provided by some templates, 45 | // this event is handled for you. 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | CrossPieCharts.FormsPlugin.Windows10 18 | Houssem 19 | Assets\StoreLogo.png 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /PieCharts.WinRT.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PieCharts.WinRT 5 | 1.0.4 6 | Pie Chart Control for WinRT 7 | Houssem Dellai 8 | Houssem Dellai 9 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 10 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 11 | 12 | https://raw.githubusercontent.com/HoussemDellai/Xamarin-Forms-Pie-Chart/master/Screenshots/piecharts-uwp-icon-200.png 13 | false 14 | 15 | Enrich your Windows Phone 8.1 and Windows 8.1 applications with Pie Charts. 16 | 17 | Enrich your Windows Phone 8.1 and Windows 8.1 applications with Pie Charts. 18 | charts, windows phone, windows, winrt 19 | 20 | 21 | 22 | 23 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | CrossPieCharts.WindowsPhone81 12 | Houssem 13 | Assets\StoreLogo.png 14 | 15 | 16 | 17 | 6.3.1 18 | 6.3.1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | color: #1E1E1E; 6 | font-size: 13px; 7 | font-family: "Segoe UI", Helvetica, Arial, sans-serif; 8 | line-height: 1.45; 9 | word-wrap: break-word; 10 | } 11 | 12 | /* General & 'Reset' Stuff */ 13 | 14 | 15 | .container { 16 | width: 980px; 17 | margin: 0 auto; 18 | } 19 | 20 | section { 21 | display: block; 22 | margin: 0; 23 | } 24 | 25 | h1, h2, h3, h4, h5, h6 { 26 | margin: 0; 27 | } 28 | 29 | /* Header,
30 | header - container 31 | h1 - project name 32 | h2 - project description 33 | */ 34 | 35 | #header { 36 | color: #FFF; 37 | background: #68217a; 38 | position:relative; 39 | } 40 | #hangcloud { 41 | width: 190px; 42 | height: 160px; 43 | background: url("../images/bannerart03.png"); 44 | position: absolute; 45 | top: 0; 46 | right: -30px; 47 | } 48 | h1, h2 { 49 | font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif; 50 | line-height: 1; 51 | margin: 0 18px; 52 | padding: 0; 53 | } 54 | #header h1 { 55 | font-size: 3.4em; 56 | padding-top: 18px; 57 | font-weight: normal; 58 | margin-left: 15px; 59 | } 60 | 61 | #header h2 { 62 | font-size: 1.5em; 63 | margin-top: 10px; 64 | padding-bottom: 18px; 65 | font-weight: normal; 66 | } 67 | 68 | 69 | #main_content { 70 | width: 100%; 71 | display: flex; 72 | flex-direction: row; 73 | } 74 | 75 | 76 | h1, h2, h3, h4, h5, h6 { 77 | font-weight: bolder; 78 | } 79 | 80 | #main_content h1 { 81 | font-size: 1.8em; 82 | margin-top: 34px; 83 | } 84 | 85 | #main_content h1:first-child { 86 | margin-top: 30px; 87 | } 88 | 89 | #main_content h2 { 90 | font-size: 1.4em; 91 | font-weight: bold; 92 | } 93 | p, ul { 94 | margin: 11px 18px; 95 | } 96 | 97 | #main_content a { 98 | color: #06C; 99 | text-decoration: none; 100 | } 101 | ul { 102 | margin-top: 13px; 103 | margin-left: 18px; 104 | padding-left: 0; 105 | } 106 | ul li { 107 | margin-left: 18px; 108 | padding-left: 0; 109 | } 110 | #lpanel { 111 | width: 620px; 112 | float: left; 113 | } 114 | #rpanel ul { 115 | list-style-type: none; 116 | width: 300px; 117 | } 118 | #rpanel ul li { 119 | line-height: 1.8em; 120 | } 121 | #rpanel { 122 | background: #e7e7e7; 123 | width: 360px; 124 | float: right; 125 | } 126 | 127 | #rpanel div { 128 | width: 300px; 129 | } 130 | -------------------------------------------------------------------------------- /CrossPieChartsTemplate/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | color: #1E1E1E; 6 | font-size: 13px; 7 | font-family: "Segoe UI", Helvetica, Arial, sans-serif; 8 | line-height: 1.45; 9 | word-wrap: break-word; 10 | } 11 | 12 | /* General & 'Reset' Stuff */ 13 | 14 | 15 | .container { 16 | width: 980px; 17 | margin: 0 auto; 18 | } 19 | 20 | section { 21 | display: block; 22 | margin: 0; 23 | } 24 | 25 | h1, h2, h3, h4, h5, h6 { 26 | margin: 0; 27 | } 28 | 29 | /* Header,
30 | header - container 31 | h1 - project name 32 | h2 - project description 33 | */ 34 | 35 | #header { 36 | color: #FFF; 37 | background: #68217a; 38 | position:relative; 39 | } 40 | #hangcloud { 41 | width: 190px; 42 | height: 160px; 43 | background: url("../images/bannerart03.png"); 44 | position: absolute; 45 | top: 0; 46 | right: -30px; 47 | } 48 | h1, h2 { 49 | font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif; 50 | line-height: 1; 51 | margin: 0 18px; 52 | padding: 0; 53 | } 54 | #header h1 { 55 | font-size: 3.4em; 56 | padding-top: 18px; 57 | font-weight: normal; 58 | margin-left: 15px; 59 | } 60 | 61 | #header h2 { 62 | font-size: 1.5em; 63 | margin-top: 10px; 64 | padding-bottom: 18px; 65 | font-weight: normal; 66 | } 67 | 68 | 69 | #main_content { 70 | width: 100%; 71 | display: flex; 72 | flex-direction: row; 73 | } 74 | 75 | 76 | h1, h2, h3, h4, h5, h6 { 77 | font-weight: bolder; 78 | } 79 | 80 | #main_content h1 { 81 | font-size: 1.8em; 82 | margin-top: 34px; 83 | } 84 | 85 | #main_content h1:first-child { 86 | margin-top: 30px; 87 | } 88 | 89 | #main_content h2 { 90 | font-size: 1.4em; 91 | font-weight: bold; 92 | } 93 | p, ul { 94 | margin: 11px 18px; 95 | } 96 | 97 | #main_content a { 98 | color: #06C; 99 | text-decoration: none; 100 | } 101 | ul { 102 | margin-top: 13px; 103 | margin-left: 18px; 104 | padding-left: 0; 105 | } 106 | ul li { 107 | margin-left: 18px; 108 | padding-left: 0; 109 | } 110 | #lpanel { 111 | width: 620px; 112 | float: left; 113 | } 114 | #rpanel ul { 115 | list-style-type: none; 116 | width: 300px; 117 | } 118 | #rpanel ul li { 119 | line-height: 1.8em; 120 | } 121 | #rpanel { 122 | background: #e7e7e7; 123 | width: 360px; 124 | float: right; 125 | } 126 | 127 | #rpanel div { 128 | width: 300px; 129 | } 130 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/CrossPieChartRenderer.cs: -------------------------------------------------------------------------------- 1 | using CrossPieCharts.FormsPlugin.Abstractions; 2 | using System.Windows.Media; 3 | using Xamarin.Forms; 4 | using CrossPieCharts.FormsPlugin.WindowsPhone; 5 | using Xamarin.Forms.Platform.WinPhone; 6 | 7 | [assembly: ExportRenderer(typeof(CrossPieChartView), typeof(CrossPieChartRenderer))] 8 | namespace CrossPieCharts.FormsPlugin.WindowsPhone 9 | { 10 | /// 11 | /// CrossPieChart Renderer 12 | /// 13 | public class CrossPieChartRenderer : ViewRenderer 14 | { 15 | /// 16 | /// Used for registration with dependency service 17 | /// 18 | public static void Init() 19 | { 20 | } 21 | 22 | protected override void OnElementChanged(ElementChangedEventArgs e) 23 | { 24 | 25 | base.OnElementChanged(e); 26 | 27 | var circularProgress = Element as CrossPieChartView; 28 | 29 | if ((circularProgress != null) && (e.OldElement == null)) 30 | { 31 | 32 | var circularProgressBarRenderer = new PieChart 33 | { 34 | 35 | StrokeThickness = circularProgress.StrokeThickness, 36 | Percentage = circularProgress.Progress, 37 | Radius = circularProgress.Radius, 38 | SegmentColor = new SolidColorBrush(System.Windows.Media.Color.FromArgb( 39 | (byte)(circularProgress.ProgressColor.A * 255), 40 | (byte)(circularProgress.ProgressColor.R * 255), 41 | (byte)(circularProgress.ProgressColor.G * 255), 42 | (byte)(circularProgress.ProgressColor.B * 255))), 43 | Segment360Color = new SolidColorBrush(System.Windows.Media.Color.FromArgb( 44 | (byte)(circularProgress.ProgressBackgroundColor.A * 255), 45 | (byte)(circularProgress.ProgressBackgroundColor.R * 255), 46 | (byte)(circularProgress.ProgressBackgroundColor.G * 255), 47 | (byte)(circularProgress.ProgressBackgroundColor.B * 255))), 48 | BackgroundColor = new SolidColorBrush(System.Windows.Media.Color.FromArgb( 49 | (byte)(circularProgress.BackgroundColor.A * 255), 50 | (byte)(circularProgress.BackgroundColor.R * 255), 51 | (byte)(circularProgress.BackgroundColor.G * 255), 52 | (byte)(circularProgress.BackgroundColor.B * 255))), 53 | }; 54 | 55 | Children.Add(circularProgressBarRenderer); 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/CrossPieChartRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using com.refractored.monodroidtoolkit; 3 | using CrossPieCharts.FormsPlugin.Abstractions; 4 | using CrossPieCharts.FormsPlugin.Android; 5 | using Xamarin.Forms; 6 | using Xamarin.Forms.Platform.Android; 7 | 8 | [assembly: ExportRenderer(typeof(CrossPieChartView), typeof(CrossPieChartRenderer))] 9 | 10 | namespace CrossPieCharts.FormsPlugin.Android 11 | { 12 | /// 13 | /// CrossPieChart Renderer 14 | /// 15 | public class CrossPieChartRenderer : ViewRenderer 16 | { 17 | /// 18 | /// Used for registration with dependency service 19 | /// 20 | public static void Init() 21 | { 22 | } 23 | 24 | protected override void OnElementChanged(ElementChangedEventArgs e) 25 | { 26 | 27 | base.OnElementChanged(e); 28 | 29 | var progressBar = Element as CrossPieChartView; 30 | 31 | if (e.OldElement != null || progressBar == null) 32 | { 33 | return; 34 | } 35 | 36 | var progress = new HoloCircularProgressBar(Forms.Context) 37 | { 38 | 39 | Progress = progressBar.Progress, 40 | ProgressColor = progressBar.ProgressColor.ToAndroid(), 41 | ProgressBackgroundColor = progressBar.ProgressBackgroundColor.ToAndroid(), 42 | CircleStrokeWidth = progressBar.StrokeThickness, 43 | }; 44 | 45 | //var display = Resources.DisplayMetrics; 46 | 47 | progressBar.HeightRequest = progressBar.Radius * 2; 48 | progressBar.WidthRequest = progressBar.Radius * 2; 49 | 50 | SetNativeControl(progress); 51 | } 52 | 53 | protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) 54 | { 55 | 56 | base.OnElementPropertyChanged(sender, e); 57 | 58 | if (Control == null || Element == null) 59 | return; 60 | 61 | if (e.PropertyName == CrossPieChartView.ProgressProperty.PropertyName) 62 | { 63 | Control.Progress = Element.Progress; 64 | } 65 | else if (e.PropertyName == CrossPieChartView.ProgressBackgroundColorProperty.PropertyName) 66 | { 67 | Control.ProgressBackgroundColor = Element.ProgressBackgroundColor.ToAndroid(); 68 | } 69 | else if (e.PropertyName == CrossPieChartView.ProgressColorProperty.PropertyName) 70 | { 71 | Control.ProgressColor = Element.ProgressColor.ToAndroid(); 72 | } 73 | else if (e.PropertyName == CrossPieChartView.StrokeThicknessProperty.PropertyName) 74 | { 75 | Control.IndeterminateInterval = Element.StrokeThickness; 76 | } 77 | else if (e.PropertyName == CrossPieChartView.RadiusProperty.PropertyName) 78 | { 79 | Control.IndeterminateInterval = Element.Radius; 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/CrossPieCharts.FormsPlugin.Android.csproj.bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {AD2D2DB4-E781-4CF1-9B62-3AAD264F196D} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | CrossPieCharts.FormsPlugin.Droid 13 | CrossPieCharts.FormsPlugin.Android 14 | 512 15 | Resources\Resource.Designer.cs 16 | Off 17 | True 18 | True 19 | 8c03fc69 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | bin\Release\CrossPieCharts.FormsPlugin.Android.XML 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | {14c534b6-1984-41a9-a384-d3a5508588e3} 58 | CrossPieCharts.FormsPlugin.Abstractions 59 | 60 | 61 | 62 | 69 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Abstractions/CrossPieChartView.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.Forms; 2 | 3 | namespace CrossPieCharts.FormsPlugin.Abstractions 4 | { 5 | /// 6 | /// A view that shows a Pie chart with a given percentage and colors. 7 | /// 8 | public class CrossPieChartView : View 9 | { 10 | 11 | public static readonly BindableProperty ProgressProperty = 12 | BindableProperty.Create( 13 | p => p.Progress, 0); 14 | 15 | public static readonly BindableProperty RadiusProperty = 16 | BindableProperty.Create( 17 | p => p.Radius, 50); 18 | 19 | public static readonly BindableProperty StrokeThicknessProperty = 20 | BindableProperty.Create( 21 | p => p.StrokeThickness, 10); 22 | 23 | public static readonly BindableProperty ProgressBackgroundColorProperty = 24 | BindableProperty.Create( 25 | p => p.ProgressBackgroundColor, Color.White); 26 | 27 | public static readonly BindableProperty ProgressColorProperty = 28 | BindableProperty.Create( 29 | p => p.ProgressColor, Color.Red); 30 | 31 | /// 32 | /// Gets or sets the progress color 33 | /// 34 | /// The color of the progress. 35 | public Color ProgressColor 36 | { 37 | get 38 | { 39 | return (Color)GetValue(ProgressColorProperty); 40 | } 41 | set 42 | { 43 | SetValue(ProgressColorProperty, value); 44 | } 45 | } 46 | 47 | /// 48 | /// Gets or sets the ProgressBackgroundColorProperty 49 | /// 50 | /// The color of the ProgressBackgroundColorProperty. 51 | public Color ProgressBackgroundColor 52 | { 53 | get 54 | { 55 | return (Color)GetValue(ProgressBackgroundColorProperty); 56 | } 57 | set 58 | { 59 | SetValue(ProgressBackgroundColorProperty, value); 60 | } 61 | } 62 | 63 | /// 64 | /// Gets or sets the current progress 65 | /// 66 | /// The progress. 67 | public float Progress 68 | { 69 | get 70 | { 71 | return (float)GetValue(ProgressProperty); 72 | } 73 | set 74 | { 75 | SetValue(ProgressProperty, value); 76 | } 77 | } 78 | 79 | /// 80 | /// Gets or sets the thikness of the stroke 81 | /// 82 | public int StrokeThickness 83 | { 84 | get 85 | { 86 | return (int)GetValue(StrokeThicknessProperty); 87 | } 88 | set 89 | { 90 | SetValue(StrokeThicknessProperty, value); 91 | } 92 | } 93 | 94 | public int Radius 95 | { 96 | get 97 | { 98 | return (int)GetValue(RadiusProperty); 99 | } 100 | set 101 | { 102 | SetValue(RadiusProperty, value); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Getting Started 9 | 10 | 11 | 12 |
13 | 17 | 18 |
19 |
20 |

Creating a Visual Studio Extension

21 | 22 |

This project enables developers to create an extension for Visual Studio. The solution contains a VSIX project that packages the extension into a VSIX file. This file is used to install an extension for Visual Studio.

23 |

Add new features

24 | 25 |
    26 |
  1. Right-click the project node in Solution Explorer and select Add>New Item.
  2. 27 |
  3. In the Add New Item dialog box, expand the Extensibility node under Visual C# or Visual Basic.
  4. 28 |
  5. Choose from the available item templates: Visual Studio Package, Editor Items (Classifier, Margin, Text Adornment, Viewport Adornment), Command, Tool Window, Toolbox Control, and then click Add.
  6. 29 |
30 | 31 |

The files for the template that you selected are added to the project. You can start adding functionality to your item template, press F5 to run the project, or add additional item templates.

32 | 33 |

Run and debug

34 |

To run the project, press F5. Visual Studio will:

35 | 36 |
    37 |
  • Build the extension from the VSIX project.
  • 38 |
  • Create a VSIX package from the VSIX project.
  • 39 |
  • When debugging, start an experimental instance of Visual Studio with the VSIX package installed.
  • 40 |
41 | 42 |

In the experimental instance of Visual Studio you can test out the functionality of your extension without affecting your Visual Studio installation.

43 | 44 |
45 |
46 |
47 |

Visual Studio Extensibility Resources

48 | 49 |
    50 |
  1. MSDN documentation
    Detailed documentation and API reference material for building extensions.
  2. 51 |
  3. Extension samples on GitHub
    Use a sample project to kickstart your development.
  4. 52 |
  5. Extensibility chat room on Gitter
    Meet other extension developers and exchange tips and tricks for extension development.
  6. 53 |
  7. Channel 9 videos on extensibility
    Watch videos from the product team on Visual Studio extensibility.
  8. 54 |
  9. Extensibility Tools 2015
    Install an optional helper tool that adds extra IDE support for extension authors.
  10. 55 |
56 |

Give us feedback

57 | 60 |
61 |
62 |
63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /CrossPieChartsTemplate/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Getting Started 9 | 10 | 11 | 12 |
13 | 17 | 18 |
19 |
20 |

Creating a Visual Studio Extension

21 | 22 |

This project enables developers to create an extension for Visual Studio. The solution contains a VSIX project that packages the extension into a VSIX file. This file is used to install an extension for Visual Studio.

23 |

Add new features

24 | 25 |
    26 |
  1. Right-click the project node in Solution Explorer and select Add>New Item.
  2. 27 |
  3. In the Add New Item dialog box, expand the Extensibility node under Visual C# or Visual Basic.
  4. 28 |
  5. Choose from the available item templates: Visual Studio Package, Editor Items (Classifier, Margin, Text Adornment, Viewport Adornment), Command, Tool Window, Toolbox Control, and then click Add.
  6. 29 |
30 | 31 |

The files for the template that you selected are added to the project. You can start adding functionality to your item template, press F5 to run the project, or add additional item templates.

32 | 33 |

Run and debug

34 |

To run the project, press F5. Visual Studio will:

35 | 36 |
    37 |
  • Build the extension from the VSIX project.
  • 38 |
  • Create a VSIX package from the VSIX project.
  • 39 |
  • When debugging, start an experimental instance of Visual Studio with the VSIX package installed.
  • 40 |
41 | 42 |

In the experimental instance of Visual Studio you can test out the functionality of your extension without affecting your Visual Studio installation.

43 | 44 |
45 |
46 |
47 |

Visual Studio Extensibility Resources

48 | 49 |
    50 |
  1. MSDN documentation
    Detailed documentation and API reference material for building extensions.
  2. 51 |
  3. Extension samples on GitHub
    Use a sample project to kickstart your development.
  4. 52 |
  5. Extensibility chat room on Gitter
    Meet other extension developers and exchange tips and tricks for extension development.
  6. 53 |
  7. Channel 9 videos on extensibility
    Watch videos from the product team on Visual Studio extensibility.
  8. 54 |
  9. Extensibility Tools 2015
    Install an optional helper tool that adds extra IDE support for extension authors.
  10. 55 |
56 |

Give us feedback

57 | 60 |
61 |
62 |
63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /CrossPieCharts.Vsix/CrossPieCharts.Vsix.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | Debug 10 | AnyCPU 11 | 2.0 12 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 13 | {E186CBA3-AC7D-4096-9912-E6EAA365A020} 14 | Library 15 | Properties 16 | CrossPieCharts.Vsix 17 | CrossPieCharts.Vsix 18 | v4.5.2 19 | false 20 | false 21 | false 22 | false 23 | false 24 | false 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | 35 | 36 | pdbonly 37 | true 38 | bin\Release\ 39 | TRACE 40 | prompt 41 | 4 42 | 43 | 44 | 45 | 46 | 47 | 48 | Always 49 | true 50 | 51 | 52 | Always 53 | true 54 | 55 | 56 | Always 57 | true 58 | 59 | 60 | Designer 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 76 | -------------------------------------------------------------------------------- /CrossPieChartsTemplate/CrossPieChartsTemplate.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | Debug 10 | AnyCPU 11 | 2.0 12 | {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 13 | {BC7EB34B-2881-45AC-88EC-FEA78B1D691A} 14 | Library 15 | Properties 16 | CrossPieChartsTemplate 17 | CrossPieChartsTemplate 18 | v4.5.2 19 | false 20 | false 21 | false 22 | false 23 | false 24 | false 25 | 26 | 27 | true 28 | full 29 | false 30 | bin\Debug\ 31 | DEBUG;TRACE 32 | prompt 33 | 4 34 | 35 | 36 | pdbonly 37 | true 38 | bin\Release\ 39 | TRACE 40 | prompt 41 | 4 42 | 43 | 44 | 45 | 46 | 47 | 48 | Always 49 | true 50 | 51 | 52 | Always 53 | true 54 | 55 | 56 | Always 57 | true 58 | 59 | 60 | Designer 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 76 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | #*.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace CrossPieCharts.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | #if DEBUG 44 | if (System.Diagnostics.Debugger.IsAttached) 45 | { 46 | this.DebugSettings.EnableFrameRateCounter = true; 47 | } 48 | #endif 49 | 50 | Frame rootFrame = Window.Current.Content as Frame; 51 | 52 | // Do not repeat app initialization when the Window already has content, 53 | // just ensure that the window is active 54 | if (rootFrame == null) 55 | { 56 | // Create a Frame to act as the navigation context and navigate to the first page 57 | rootFrame = new Frame(); 58 | 59 | rootFrame.NavigationFailed += OnNavigationFailed; 60 | 61 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 62 | { 63 | //TODO: Load state from previously suspended application 64 | } 65 | 66 | // Place the frame in the current Window 67 | Window.Current.Content = rootFrame; 68 | } 69 | 70 | if (rootFrame.Content == null) 71 | { 72 | // When the navigation stack isn't restored navigate to the first page, 73 | // configuring the new page by passing required information as a navigation 74 | // parameter 75 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 76 | } 77 | // Ensure the current window is active 78 | Window.Current.Activate(); 79 | } 80 | 81 | /// 82 | /// Invoked when Navigation to a certain page fails 83 | /// 84 | /// The Frame which failed navigation 85 | /// Details about the navigation failure 86 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 87 | { 88 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 89 | } 90 | 91 | /// 92 | /// Invoked when application execution is being suspended. Application state is saved 93 | /// without knowing whether the application will be terminated or resumed with the contents 94 | /// of memory still intact. 95 | /// 96 | /// The source of the suspend request. 97 | /// Details about the suspend request. 98 | private void OnSuspending(object sender, SuspendingEventArgs e) 99 | { 100 | var deferral = e.SuspendingOperation.GetDeferral(); 101 | //TODO: Save application state and stop any background activity 102 | deferral.Complete(); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace CrossPieCharts.FormsPlugin.Windows10 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | #if DEBUG 44 | if (System.Diagnostics.Debugger.IsAttached) 45 | { 46 | this.DebugSettings.EnableFrameRateCounter = true; 47 | } 48 | #endif 49 | 50 | Frame rootFrame = Window.Current.Content as Frame; 51 | 52 | // Do not repeat app initialization when the Window already has content, 53 | // just ensure that the window is active 54 | if (rootFrame == null) 55 | { 56 | // Create a Frame to act as the navigation context and navigate to the first page 57 | rootFrame = new Frame(); 58 | 59 | rootFrame.NavigationFailed += OnNavigationFailed; 60 | 61 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 62 | { 63 | //TODO: Load state from previously suspended application 64 | } 65 | 66 | // Place the frame in the current Window 67 | Window.Current.Content = rootFrame; 68 | } 69 | 70 | if (rootFrame.Content == null) 71 | { 72 | // When the navigation stack isn't restored navigate to the first page, 73 | // configuring the new page by passing required information as a navigation 74 | // parameter 75 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 76 | } 77 | // Ensure the current window is active 78 | Window.Current.Activate(); 79 | } 80 | 81 | /// 82 | /// Invoked when Navigation to a certain page fails 83 | /// 84 | /// The Frame which failed navigation 85 | /// Details about the navigation failure 86 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 87 | { 88 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 89 | } 90 | 91 | /// 92 | /// Invoked when application execution is being suspended. Application state is saved 93 | /// without knowing whether the application will be terminated or resumed with the contents 94 | /// of memory still intact. 95 | /// 96 | /// The source of the suspend request. 97 | /// Details about the suspend request. 98 | private void OnSuspending(object sender, SuspendingEventArgs e) 99 | { 100 | var deferral = e.SuspendingOperation.GetDeferral(); 101 | //TODO: Save application state and stop any background activity 102 | deferral.Complete(); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 19 | 20 | namespace CrossPieCharts.WindowsStore 21 | { 22 | /// 23 | /// Provides application-specific behavior to supplement the default Application class. 24 | /// 25 | sealed partial class App : Application 26 | { 27 | /// 28 | /// Initializes the singleton application object. This is the first line of authored code 29 | /// executed, and as such is the logical equivalent of main() or WinMain(). 30 | /// 31 | public App() 32 | { 33 | this.InitializeComponent(); 34 | this.Suspending += OnSuspending; 35 | } 36 | 37 | /// 38 | /// Invoked when the application is launched normally by the end user. Other entry points 39 | /// will be used such as when the application is launched to open a specific file. 40 | /// 41 | /// Details about the launch request and process. 42 | protected override void OnLaunched(LaunchActivatedEventArgs e) 43 | { 44 | 45 | #if DEBUG 46 | if (System.Diagnostics.Debugger.IsAttached) 47 | { 48 | this.DebugSettings.EnableFrameRateCounter = true; 49 | } 50 | #endif 51 | 52 | Frame rootFrame = Window.Current.Content as Frame; 53 | 54 | // Do not repeat app initialization when the Window already has content, 55 | // just ensure that the window is active 56 | if (rootFrame == null) 57 | { 58 | // Create a Frame to act as the navigation context and navigate to the first page 59 | rootFrame = new Frame(); 60 | // Set the default language 61 | rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; 62 | 63 | rootFrame.NavigationFailed += OnNavigationFailed; 64 | 65 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 66 | { 67 | //TODO: Load state from previously suspended application 68 | } 69 | 70 | // Place the frame in the current Window 71 | Window.Current.Content = rootFrame; 72 | } 73 | 74 | if (rootFrame.Content == null) 75 | { 76 | // When the navigation stack isn't restored navigate to the first page, 77 | // configuring the new page by passing required information as a navigation 78 | // parameter 79 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 80 | } 81 | // Ensure the current window is active 82 | Window.Current.Activate(); 83 | } 84 | 85 | /// 86 | /// Invoked when Navigation to a certain page fails 87 | /// 88 | /// The Frame which failed navigation 89 | /// Details about the navigation failure 90 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 91 | { 92 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 93 | } 94 | 95 | /// 96 | /// Invoked when application execution is being suspended. Application state is saved 97 | /// without knowing whether the application will be terminated or resumed with the contents 98 | /// of memory still intact. 99 | /// 100 | /// The source of the suspend request. 101 | /// Details about the suspend request. 102 | private void OnSuspending(object sender, SuspendingEventArgs e) 103 | { 104 | var deferral = e.SuspendingOperation.GetDeferral(); 105 | //TODO: Save application state and stop any background activity 106 | deferral.Complete(); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 56 | 57 | 59 | 65 | 66 | 72 | 73 | 75 | 81 | 82 | 88 | 89 | 91 | 97 | 98 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Abstractions/CrossPieCharts.FormsPlugin.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10.0 6 | Debug 7 | AnyCPU 8 | {14C534B6-1984-41A9-A384-D3A5508588E3} 9 | Library 10 | Properties 11 | CrossPieCharts.FormsPlugin.Abstractions 12 | CrossPieCharts.FormsPlugin.Abstractions 13 | en-US 14 | 512 15 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 16 | Profile78 17 | v4.5 18 | 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | bin\Release\CrossPieCharts.FormsPlugin.Abstractions.XML 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll 47 | True 48 | 49 | 50 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll 51 | True 52 | 53 | 54 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll 55 | True 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 66 | 67 | 68 | 69 | 76 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.iOSUnified/CrossPieCharts.FormsPlugin.iOSUnified.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 8.0.30703 7 | 2.0 8 | {D525F236-6A2D-4010-B1CC-4A4B8581C90B} 9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | CrossPieCharts.FormsPlugin.iOSUnified 12 | Resources 13 | CrossPieCharts.FormsPlugin.iOSUnified 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\iPhone\Debug 22 | DEBUG 23 | prompt 24 | 4 25 | false 26 | true 27 | iPhone Developer 28 | 29 | 30 | none 31 | true 32 | bin\iPhone\Release 33 | prompt 34 | 4 35 | false 36 | iPhone Developer 37 | bin\iPhone\Release\CrossPieCharts.FormsPlugin.iOSUnified.XML 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | {14c534b6-1984-41a9-a384-d3a5508588e3} 46 | CrossPieCharts.FormsPlugin.Abstractions 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll 55 | True 56 | 57 | 58 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll 59 | True 60 | 61 | 62 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll 63 | True 64 | 65 | 66 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll 67 | True 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Media.Animation; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=391641 20 | 21 | namespace CrossPieCharts.WindowsPhone81 22 | { 23 | /// 24 | /// Provides application-specific behavior to supplement the default Application class. 25 | /// 26 | public sealed partial class App : Application 27 | { 28 | private TransitionCollection transitions; 29 | 30 | /// 31 | /// Initializes the singleton application object. This is the first line of authored code 32 | /// executed, and as such is the logical equivalent of main() or WinMain(). 33 | /// 34 | public App() 35 | { 36 | this.InitializeComponent(); 37 | this.Suspending += this.OnSuspending; 38 | } 39 | 40 | /// 41 | /// Invoked when the application is launched normally by the end user. Other entry points 42 | /// will be used when the application is launched to open a specific file, to display 43 | /// search results, and so forth. 44 | /// 45 | /// Details about the launch request and process. 46 | protected override void OnLaunched(LaunchActivatedEventArgs e) 47 | { 48 | #if DEBUG 49 | if (System.Diagnostics.Debugger.IsAttached) 50 | { 51 | this.DebugSettings.EnableFrameRateCounter = true; 52 | } 53 | #endif 54 | 55 | Frame rootFrame = Window.Current.Content as Frame; 56 | 57 | // Do not repeat app initialization when the Window already has content, 58 | // just ensure that the window is active 59 | if (rootFrame == null) 60 | { 61 | // Create a Frame to act as the navigation context and navigate to the first page 62 | rootFrame = new Frame(); 63 | 64 | // TODO: change this value to a cache size that is appropriate for your application 65 | rootFrame.CacheSize = 1; 66 | 67 | // Set the default language 68 | rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; 69 | 70 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 71 | { 72 | // TODO: Load state from previously suspended application 73 | } 74 | 75 | // Place the frame in the current Window 76 | Window.Current.Content = rootFrame; 77 | } 78 | 79 | if (rootFrame.Content == null) 80 | { 81 | // Removes the turnstile navigation for startup. 82 | if (rootFrame.ContentTransitions != null) 83 | { 84 | this.transitions = new TransitionCollection(); 85 | foreach (var c in rootFrame.ContentTransitions) 86 | { 87 | this.transitions.Add(c); 88 | } 89 | } 90 | 91 | rootFrame.ContentTransitions = null; 92 | rootFrame.Navigated += this.RootFrame_FirstNavigated; 93 | 94 | // When the navigation stack isn't restored navigate to the first page, 95 | // configuring the new page by passing required information as a navigation 96 | // parameter 97 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) 98 | { 99 | throw new Exception("Failed to create initial page"); 100 | } 101 | } 102 | 103 | // Ensure the current window is active 104 | Window.Current.Activate(); 105 | } 106 | 107 | /// 108 | /// Restores the content transitions after the app has launched. 109 | /// 110 | /// The object where the handler is attached. 111 | /// Details about the navigation event. 112 | private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) 113 | { 114 | var rootFrame = sender as Frame; 115 | rootFrame.ContentTransitions = this.transitions ?? new TransitionCollection() { new NavigationThemeTransition() }; 116 | rootFrame.Navigated -= this.RootFrame_FirstNavigated; 117 | } 118 | 119 | /// 120 | /// Invoked when application execution is being suspended. Application state is saved 121 | /// without knowing whether the application will be terminated or resumed with the contents 122 | /// of memory still intact. 123 | /// 124 | /// The source of the suspend request. 125 | /// Details about the suspend request. 126 | private void OnSuspending(object sender, SuspendingEventArgs e) 127 | { 128 | var deferral = e.SuspendingOperation.GetDeferral(); 129 | 130 | // TODO: Save application state and stop any background activity 131 | deferral.Complete(); 132 | } 133 | } 134 | } -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Android/CrossPieCharts.FormsPlugin.Android.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {AD2D2DB4-E781-4CF1-9B62-3AAD264F196D} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | CrossPieCharts.FormsPlugin.Droid 13 | CrossPieCharts.FormsPlugin.Android 14 | 512 15 | Resources\Resource.Designer.cs 16 | Off 17 | True 18 | True 19 | 20 | 21 | v6.0 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | bin\Release\CrossPieCharts.FormsPlugin.Android.XML 40 | 41 | 42 | 43 | ..\..\packages\MonoDroid.Toolkit.1.1.0.0\lib\MonoAndroid10\com.refractored.monodroidtoolkit.dll 44 | True 45 | 46 | 47 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\FormsViewGroup.dll 48 | True 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | ..\..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll 58 | True 59 | 60 | 61 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Core.dll 62 | True 63 | 64 | 65 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 66 | True 67 | 68 | 69 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 70 | True 71 | 72 | 73 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 74 | True 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | {14c534b6-1984-41a9-a384-d3a5508588e3} 89 | CrossPieCharts.FormsPlugin.Abstractions 90 | 91 | 92 | 93 | 94 | 95 | 96 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 97 | 98 | 99 | 100 | 107 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Abstractions/CrossPieChartSample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Xamarin.Forms; 7 | 8 | namespace CrossPieCharts.FormsPlugin.Abstractions 9 | { 10 | /// 11 | /// Shows how to use the PieCharts controls. 12 | /// 13 | public class CrossPieChartSample 14 | { 15 | /// 16 | /// Makes a ContentPage with samples of PieCharts. 17 | /// 18 | /// 19 | public ContentPage GetPageWithPieChart() 20 | { 21 | // The root page of your application 22 | var contentPage = new ContentPage 23 | { 24 | Content = new Grid 25 | { 26 | Children = 27 | { 28 | new Grid // a trick to set the BackgroundColor of the ContentPage to white 29 | { 30 | BackgroundColor = Color.White, 31 | }, 32 | new StackLayout 33 | { 34 | Children = 35 | { 36 | new Label 37 | { 38 | XAlign = TextAlignment.Center, 39 | Text = "Welcome to Xamarin Forms!", 40 | TextColor = Color.Black 41 | }, 42 | new Grid 43 | { 44 | Children = 45 | { 46 | new CrossPieChartView 47 | { 48 | Progress = 60, 49 | ProgressColor = Color.Green, 50 | ProgressBackgroundColor = Color.FromHex("#EEEEEEEE"), 51 | StrokeThickness = Device.OnPlatform(10, 20, 80), 52 | Radius = Device.OnPlatform(100, 180, 160), 53 | BackgroundColor = Color.White 54 | }, 55 | new Label 56 | { 57 | Text = "60%", 58 | Font = Font.BoldSystemFontOfSize(NamedSize.Large), 59 | FontSize = 70, 60 | VerticalOptions = LayoutOptions.Center, 61 | HorizontalOptions = LayoutOptions.Center, 62 | TextColor = Color.Black 63 | } 64 | } 65 | }, 66 | new StackLayout 67 | { 68 | Orientation = StackOrientation.Horizontal, 69 | HorizontalOptions = LayoutOptions.Center, 70 | Children = 71 | { 72 | new CrossPieChartView 73 | { 74 | Progress = 80, 75 | ProgressColor = Color.Blue, 76 | ProgressBackgroundColor = Color.Gray, 77 | StrokeThickness = Device.OnPlatform(10, 10, 20), 78 | Radius = Device.OnPlatform(100, 50, 36), 79 | BackgroundColor = Color.White 80 | }, 81 | new CrossPieChartView 82 | { 83 | Progress = 55, 84 | ProgressColor = Color.Olive, 85 | ProgressBackgroundColor = Color.Gray, 86 | StrokeThickness = Device.OnPlatform(10, 10, 20), 87 | Radius = Device.OnPlatform(100, 50, 36), 88 | BackgroundColor = Color.White 89 | }, 90 | new CrossPieChartView 91 | { 92 | Progress = 33, 93 | ProgressColor = Color.Red, 94 | ProgressBackgroundColor = Color.Gray, 95 | StrokeThickness = Device.OnPlatform(10, 10, 20), 96 | Radius = Device.OnPlatform(100, 50, 36), 97 | BackgroundColor = Color.White 98 | }, 99 | new CrossPieChartView 100 | { 101 | Progress = 70, 102 | ProgressColor = Color.Teal, 103 | ProgressBackgroundColor = Color.Gray, 104 | StrokeThickness = Device.OnPlatform(10, 10, 20), 105 | Radius = Device.OnPlatform(100, 50, 36), 106 | BackgroundColor = Color.White 107 | }, 108 | } 109 | }, 110 | new Label 111 | { 112 | Text = "Xamarin Forms Pie Charts", 113 | TextColor = Color.Black, 114 | HorizontalOptions = LayoutOptions.Center, 115 | Font = Font.BoldSystemFontOfSize(NamedSize.Large) 116 | } 117 | } 118 | } 119 | } 120 | } 121 | }; 122 | 123 | return contentPage; 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/CrossPieCharts.UWP.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x86 7 | {B54BC88D-B9A8-4149-93E3-204B2809024E} 8 | AppContainerExe 9 | Properties 10 | CrossPieCharts.UWP 11 | CrossPieCharts.UWP 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10240.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | CrossPieCharts.UWP_TemporaryKey.pfx 20 | 21 | 22 | true 23 | bin\x86\Debug\ 24 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 25 | ;2008 26 | full 27 | x86 28 | false 29 | prompt 30 | true 31 | 32 | 33 | bin\x86\Release\ 34 | TRACE;NETFX_CORE;WINDOWS_UWP 35 | true 36 | ;2008 37 | pdbonly 38 | x86 39 | false 40 | prompt 41 | true 42 | true 43 | 44 | 45 | true 46 | bin\ARM\Debug\ 47 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 48 | ;2008 49 | full 50 | ARM 51 | false 52 | prompt 53 | true 54 | 55 | 56 | bin\ARM\Release\ 57 | TRACE;NETFX_CORE;WINDOWS_UWP 58 | true 59 | ;2008 60 | pdbonly 61 | ARM 62 | false 63 | prompt 64 | true 65 | true 66 | 67 | 68 | true 69 | bin\x64\Debug\ 70 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 71 | ;2008 72 | full 73 | x64 74 | false 75 | prompt 76 | true 77 | 78 | 79 | bin\x64\Release\ 80 | TRACE;NETFX_CORE;WINDOWS_UWP 81 | true 82 | ;2008 83 | pdbonly 84 | x64 85 | false 86 | prompt 87 | true 88 | true 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | App.xaml 97 | 98 | 99 | MainPage.xaml 100 | 101 | 102 | 103 | 104 | 105 | 106 | Designer 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | MSBuild:Compile 123 | Designer 124 | 125 | 126 | MSBuild:Compile 127 | Designer 128 | 129 | 130 | 131 | 14.0 132 | 133 | 134 | 141 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.Windows10/CrossPieCharts.FormsPlugin.Windows10.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | x86 7 | {BA5D1B34-341E-421A-BBA2-C65974E076E1} 8 | AppContainerExe 9 | Properties 10 | CrossPieCharts.FormsPlugin.Windows10 11 | CrossPieCharts.FormsPlugin.Windows10 12 | en-US 13 | UAP 14 | 10.0.10240.0 15 | 10.0.10240.0 16 | 14 17 | true 18 | 512 19 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 20 | CrossPieCharts.FormsPlugin.Windows10_TemporaryKey.pfx 21 | 22 | 23 | true 24 | bin\ARM\Debug\ 25 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 26 | ;2008 27 | full 28 | ARM 29 | false 30 | prompt 31 | true 32 | 33 | 34 | bin\ARM\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_UWP 36 | true 37 | ;2008 38 | pdbonly 39 | ARM 40 | false 41 | prompt 42 | true 43 | true 44 | 45 | 46 | true 47 | bin\x64\Debug\ 48 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 49 | ;2008 50 | full 51 | x64 52 | false 53 | prompt 54 | true 55 | 56 | 57 | bin\x64\Release\ 58 | TRACE;NETFX_CORE;WINDOWS_UWP 59 | true 60 | ;2008 61 | pdbonly 62 | x64 63 | false 64 | prompt 65 | true 66 | true 67 | 68 | 69 | true 70 | bin\x86\Debug\ 71 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 72 | ;2008 73 | full 74 | x86 75 | false 76 | prompt 77 | true 78 | 79 | 80 | bin\x86\Release\ 81 | TRACE;NETFX_CORE;WINDOWS_UWP 82 | true 83 | ;2008 84 | pdbonly 85 | x86 86 | false 87 | prompt 88 | true 89 | true 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | App.xaml 98 | 99 | 100 | 101 | MainPage.xaml 102 | 103 | 104 | 105 | 106 | 107 | 108 | Designer 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | MSBuild:Compile 125 | Designer 126 | 127 | 128 | MSBuild:Compile 129 | Designer 130 | 131 | 132 | 133 | 14.0 134 | 135 | 136 | 143 | -------------------------------------------------------------------------------- /CrossPieCharts.FormsPlugin.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xam.FormsPlugin.CrossPieChart 5 | 1.0.1 6 | Pie Chart Control Plugin for Xamarin.Forms 7 | Houssem Dellai 8 | Houssem Dellai 9 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 10 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart 11 | 12 | https://github.com/HoussemDellai/Xamarin-Forms-Pie-Chart/blob/master/Screenshots/charts_logo.PNG 13 | false 14 | 15 | Enrich your mobile application with Pie Charts that supports multiple platforms. 16 | Supported platforms: 17 | 1) Xamarin for Android 18 | 2) Windows Phone Silverlight 19 | 3) Windows Phone RT 20 | 4) Windows Store 21 | iOS is not supported yet! 22 | 23 | Enrich your mobile application with Pie Charts. 24 | xamarin, pcl, xam.pcl, plugin, plugin for xamarin.forms, cross platform, charts, windows phone, winphone, wp8, wpa81, android, xamarin.forms 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 36 | 37 | 38 | 40 | 41 | 43 | 44 | 45 | 47 | 48 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | 59 | 60 | 62 | 63 | 64 | 66 | 67 | 69 | 70 | 71 | 72 | 78 | 79 | 89 | 90 | 99 | 100 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.FormsPlugin.WindowsPhone/CrossPieCharts.FormsPlugin.WindowsPhone.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {983B7EFF-7E75-4A87-890A-744A0B4C5232} 9 | {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 10 | Library 11 | Properties 12 | CrossPieCharts.FormsPlugin.WindowsPhone 13 | CrossPieCharts.FormsPlugin.WindowsPhone 14 | WindowsPhone 15 | v8.0 16 | $(TargetFrameworkVersion) 17 | false 18 | true 19 | 11.0 20 | true 21 | 22 | 23 | 24 | 25 | true 26 | full 27 | false 28 | Bin\Debug 29 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 30 | true 31 | true 32 | prompt 33 | 4 34 | 35 | 36 | pdbonly 37 | true 38 | Bin\Release 39 | TRACE;SILVERLIGHT;WINDOWS_PHONE 40 | true 41 | true 42 | prompt 43 | 4 44 | bin\Release\CrossPieCharts.FormsPlugin.WindowsPhone.XML 45 | 46 | 47 | true 48 | full 49 | false 50 | Bin\x86\Debug 51 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 52 | true 53 | true 54 | prompt 55 | 4 56 | 57 | 58 | pdbonly 59 | true 60 | Bin\x86\Release 61 | TRACE;SILVERLIGHT;WINDOWS_PHONE 62 | true 63 | true 64 | prompt 65 | 4 66 | 67 | 68 | true 69 | full 70 | false 71 | Bin\ARM\Debug 72 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 73 | true 74 | true 75 | prompt 76 | 4 77 | 78 | 79 | pdbonly 80 | true 81 | Bin\ARM\Release 82 | TRACE;SILVERLIGHT;WINDOWS_PHONE 83 | true 84 | true 85 | prompt 86 | 4 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | {14c534b6-1984-41a9-a384-d3a5508588e3} 96 | CrossPieCharts.FormsPlugin.Abstractions 97 | 98 | 99 | 100 | 101 | ..\..\packages\WPtoolkit.4.2013.08.16\lib\wp8\Microsoft.Phone.Controls.Toolkit.dll 102 | True 103 | 104 | 105 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\WP80\Xamarin.Forms.Core.dll 106 | True 107 | 108 | 109 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\WP80\Xamarin.Forms.Platform.dll 110 | True 111 | 112 | 113 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\WP80\Xamarin.Forms.Platform.WP8.dll 114 | True 115 | 116 | 117 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\WP80\Xamarin.Forms.Xaml.dll 118 | True 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 139 | 140 | 141 | 142 | 149 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsPhone81/CrossPieCharts.WindowsPhone81.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1C265B42-211C-4958-B5CD-9A0DF7260CD7} 8 | AppContainerExe 9 | Properties 10 | CrossPieCharts.WindowsPhone81 11 | CrossPieCharts.WindowsPhone81 12 | en-US 13 | 8.1 14 | 12 15 | 512 16 | {76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 18 | 19 | 20 | 21 | AnyCPU 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 27 | prompt 28 | 4 29 | 30 | 31 | AnyCPU 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 36 | prompt 37 | 4 38 | 39 | 40 | true 41 | bin\ARM\Debug\ 42 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 43 | ;2008 44 | full 45 | ARM 46 | false 47 | prompt 48 | true 49 | 50 | 51 | bin\ARM\Release\ 52 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 53 | true 54 | ;2008 55 | pdbonly 56 | ARM 57 | false 58 | prompt 59 | true 60 | 61 | 62 | true 63 | bin\x86\Debug\ 64 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 65 | ;2008 66 | full 67 | x86 68 | false 69 | prompt 70 | true 71 | 72 | 73 | bin\x86\Release\ 74 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 75 | true 76 | ;2008 77 | pdbonly 78 | x86 79 | false 80 | prompt 81 | true 82 | 83 | 84 | 85 | App.xaml 86 | 87 | 88 | 89 | MainPage.xaml 90 | 91 | 92 | 93 | 94 | 95 | 96 | Designer 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | MSBuild:Compile 110 | Designer 111 | 112 | 113 | MSBuild:Compile 114 | Designer 115 | 116 | 117 | 118 | 119 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\wpa81\Xamarin.Forms.Core.dll 120 | True 121 | 122 | 123 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\wpa81\Xamarin.Forms.Platform.WinRT.dll 124 | True 125 | 126 | 127 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone.dll 128 | True 129 | 130 | 131 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\wpa81\Xamarin.Forms.Xaml.dll 132 | True 133 | 134 | 135 | 136 | 137 | 138 | 139 | 12.0 140 | 141 | 142 | WindowsPhoneApp 143 | 144 | 145 | 146 | 147 | 148 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 149 | 150 | 151 | 152 | 159 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/CrossPieCharts.WindowsStore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8AF12F7C-FF92-4BDF-9BF2-F900DF30F998} 8 | AppContainerExe 9 | Properties 10 | CrossPieCharts.WindowsStore 11 | CrossPieCharts.WindowsStore 12 | en-US 13 | 8.1 14 | 12 15 | 512 16 | {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | CrossPieCharts.WindowsStore_TemporaryKey.pfx 18 | 19 | 20 | 21 | 22 | AnyCPU 23 | true 24 | full 25 | false 26 | bin\Debug\ 27 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 28 | prompt 29 | 4 30 | 31 | 32 | AnyCPU 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE;NETFX_CORE;WINDOWS_APP 37 | prompt 38 | 4 39 | 40 | 41 | true 42 | bin\ARM\Debug\ 43 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 44 | ;2008 45 | full 46 | ARM 47 | false 48 | prompt 49 | true 50 | 51 | 52 | bin\ARM\Release\ 53 | TRACE;NETFX_CORE;WINDOWS_APP 54 | true 55 | ;2008 56 | pdbonly 57 | ARM 58 | false 59 | prompt 60 | true 61 | 62 | 63 | true 64 | bin\x64\Debug\ 65 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 66 | ;2008 67 | full 68 | x64 69 | false 70 | prompt 71 | true 72 | 73 | 74 | bin\x64\Release\ 75 | TRACE;NETFX_CORE;WINDOWS_APP 76 | true 77 | ;2008 78 | pdbonly 79 | x64 80 | false 81 | prompt 82 | true 83 | 84 | 85 | true 86 | bin\x86\Debug\ 87 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 88 | ;2008 89 | full 90 | x86 91 | false 92 | prompt 93 | true 94 | 95 | 96 | bin\x86\Release\ 97 | TRACE;NETFX_CORE;WINDOWS_APP 98 | true 99 | ;2008 100 | pdbonly 101 | x86 102 | false 103 | prompt 104 | true 105 | 106 | 107 | 108 | App.xaml 109 | 110 | 111 | 112 | MainPage.xaml 113 | 114 | 115 | 116 | 117 | 118 | 119 | Designer 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | MSBuild:Compile 134 | Designer 135 | 136 | 137 | MSBuild:Compile 138 | Designer 139 | 140 | 141 | 142 | 143 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\win81\Xamarin.Forms.Core.dll 144 | True 145 | 146 | 147 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\win81\Xamarin.Forms.Platform.WinRT.dll 148 | True 149 | 150 | 151 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\win81\Xamarin.Forms.Platform.WinRT.Tablet.dll 152 | True 153 | 154 | 155 | ..\..\packages\Xamarin.Forms.1.4.2.6359\lib\win81\Xamarin.Forms.Xaml.dll 156 | True 157 | 158 | 159 | 160 | 161 | {14c534b6-1984-41a9-a384-d3a5508588e3} 162 | CrossPieCharts.FormsPlugin.Abstractions 163 | 164 | 165 | 166 | 12.0 167 | 168 | 169 | 170 | 171 | 172 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 173 | 174 | 175 | 176 | 183 | -------------------------------------------------------------------------------- /CrossPieCharts/CrossPieCharts.WindowsStore/PieChart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.Foundation; 3 | using Windows.UI; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Controls; 6 | using Windows.UI.Xaml.Media; 7 | using Windows.UI.Xaml.Shapes; 8 | 9 | namespace CrossPieCharts.WinRT 10 | { 11 | 12 | /// 13 | /// Pie Chart control for WinRT. 14 | /// 15 | public class PieChart : UserControl 16 | { 17 | 18 | private double _angle = 120; 19 | private ArcSegment _arcSegment = new ArcSegment(); 20 | private ArcSegment _arcSegment360 = new ArcSegment(); 21 | private PathFigure _pathFigure = new PathFigure(); 22 | private PathFigure _pathFigure360 = new PathFigure(); 23 | private Path _pathRoot = new Path(); 24 | private Path _pathRoot360 = new Path(); 25 | 26 | public int Radius 27 | { 28 | get 29 | { 30 | return (int)GetValue(RadiusProperty); 31 | } 32 | set 33 | { 34 | SetValue(RadiusProperty, value); 35 | } 36 | } 37 | 38 | public Brush SegmentColor 39 | { 40 | get 41 | { 42 | return (Brush)GetValue(SegmentColorProperty); 43 | } 44 | set 45 | { 46 | SetValue(SegmentColorProperty, value); 47 | } 48 | } 49 | 50 | public Brush Segment360Color 51 | { 52 | get 53 | { 54 | return (Brush)GetValue(Segment360ColorProperty); 55 | } 56 | set 57 | { 58 | SetValue(Segment360ColorProperty, value); 59 | } 60 | } 61 | 62 | public Brush BackgroundColor 63 | { 64 | get 65 | { 66 | return (Brush)GetValue(BackgroundColorProperty); 67 | } 68 | set 69 | { 70 | SetValue(BackgroundColorProperty, value); 71 | } 72 | } 73 | 74 | public int StrokeThickness 75 | { 76 | get 77 | { 78 | return (int)GetValue(StrokeThicknessProperty); 79 | } 80 | set 81 | { 82 | SetValue(StrokeThicknessProperty, value); 83 | } 84 | } 85 | 86 | public double Percentage 87 | { 88 | get 89 | { 90 | return (double)GetValue(PercentageProperty); 91 | } 92 | set 93 | { 94 | SetValue(PercentageProperty, value); 95 | } 96 | } 97 | 98 | // Using a DependencyProperty as the backing store for Percentage. This enables animation, styling, binding, etc... 99 | public static readonly DependencyProperty PercentageProperty = 100 | DependencyProperty.Register("Percentage", typeof(double), typeof(PieChart), new PropertyMetadata(65d, OnPropertyChanged)); 101 | 102 | // Using a DependencyProperty as the backing store for StrokeThickness. This enables animation, styling, binding, etc... 103 | public static readonly DependencyProperty StrokeThicknessProperty = 104 | DependencyProperty.Register("StrokeThickness", typeof(int), typeof(PieChart), new PropertyMetadata(10, OnPropertyChanged)); 105 | 106 | // Using a DependencyProperty as the backing store for SegmentColor. This enables animation, styling, binding, etc... 107 | public static readonly DependencyProperty SegmentColorProperty = 108 | DependencyProperty.Register("SegmentColor", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.Green), OnPropertyChanged)); 109 | 110 | 111 | public static readonly DependencyProperty BackgroundColorProperty = 112 | DependencyProperty.Register("BackgroundColor", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.Transparent), OnPropertyChanged)); 113 | 114 | // Using a DependencyProperty as the backing store for SegmentColor. This enables animation, styling, binding, etc... 115 | public static readonly DependencyProperty Segment360ColorProperty = 116 | DependencyProperty.Register("Segment360Color", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.LightGray), OnPropertyChanged)); 117 | 118 | // Using a DependencyProperty as the backing store for Radius. This enables animation, styling, binding, etc... 119 | public static readonly DependencyProperty RadiusProperty = 120 | DependencyProperty.Register("Radius", typeof(int), typeof(PieChart), new PropertyMetadata(25, OnPropertyChanged)); 121 | 122 | public PieChart() 123 | { 124 | 125 | InitializePieChart(); 126 | 127 | //_angle = Percentage * 360 / 100; 128 | } 129 | 130 | private static void OnPercentageChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) 131 | { 132 | var pieChart = sender as PieChart; 133 | 134 | pieChart._angle = (pieChart.Percentage * 360) / 100; 135 | 136 | pieChart.InitializePieChart(); 137 | 138 | pieChart.RenderArc(); 139 | } 140 | 141 | private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) 142 | { 143 | var pieChart = sender as PieChart; 144 | 145 | pieChart.InitializePieChart(); 146 | 147 | pieChart.RenderArc(); 148 | } 149 | 150 | public void RenderArc() 151 | { 152 | 153 | _angle = Percentage * 360 / 100; 154 | 155 | var startPoint = new Point(Radius, 0); 156 | var endPoint = ComputeCartesianCoordinate(_angle, Radius); 157 | endPoint.X += Radius; 158 | endPoint.Y += Radius; 159 | 160 | _pathRoot.Width = Radius * 2 + StrokeThickness; 161 | _pathRoot.Height = Radius * 2 + StrokeThickness; 162 | _pathRoot.Margin = new Thickness(StrokeThickness, StrokeThickness, 0, 0); 163 | 164 | var largeArc = _angle > 180.0; 165 | 166 | var outerArcSize = new Size(Radius, Radius); 167 | 168 | _pathFigure.StartPoint = startPoint; 169 | 170 | if (startPoint.X == Math.Round(endPoint.X) && startPoint.Y == Math.Round(endPoint.Y)) 171 | { 172 | endPoint.X -= 0.01; 173 | } 174 | 175 | _arcSegment.Point = endPoint; 176 | _arcSegment.Size = outerArcSize; 177 | _arcSegment.IsLargeArc = largeArc; 178 | 179 | // Draw the 360 arc/circle 180 | 181 | var endPoint2 = ComputeCartesianCoordinate(360, Radius); 182 | endPoint2.X += Radius; 183 | endPoint2.Y += Radius; 184 | 185 | _pathRoot360.Width = Radius * 2 + StrokeThickness; 186 | _pathRoot360.Height = Radius * 2 + StrokeThickness; 187 | _pathRoot360.Margin = new Thickness(StrokeThickness, StrokeThickness, 0, 0); 188 | 189 | _pathFigure360.StartPoint = startPoint; 190 | 191 | if (startPoint.X == Math.Round(endPoint2.X) && startPoint.Y == Math.Round(endPoint2.Y)) 192 | { 193 | endPoint2.X -= 0.01; 194 | } 195 | 196 | _arcSegment360.Point = endPoint2; 197 | _arcSegment360.Size = outerArcSize; 198 | _arcSegment360.IsLargeArc = true; 199 | } 200 | 201 | private Point ComputeCartesianCoordinate(double angle, double radius) 202 | { 203 | // convert to radians 204 | var angleRad = (Math.PI / 180.0) * (angle - 90); 205 | 206 | var x = radius * Math.Cos(angleRad); 207 | var y = radius * Math.Sin(angleRad); 208 | 209 | return new Point(x, y); 210 | } 211 | 212 | public void InitializePieChart() 213 | { 214 | 215 | // draw the full circle/arc 216 | _arcSegment360 = new ArcSegment 217 | { 218 | SweepDirection = SweepDirection.Clockwise 219 | }; 220 | 221 | _pathFigure360 = new PathFigure 222 | { 223 | Segments = new PathSegmentCollection 224 | { 225 | _arcSegment360 226 | } 227 | }; 228 | 229 | _pathRoot360 = new Path 230 | { 231 | Stroke = Segment360Color, 232 | StrokeThickness = StrokeThickness, 233 | HorizontalAlignment = HorizontalAlignment.Center, 234 | VerticalAlignment = VerticalAlignment.Center, 235 | Data = new PathGeometry 236 | { 237 | Figures = new PathFigureCollection 238 | { 239 | _pathFigure360 240 | } 241 | } 242 | }; 243 | 244 | //draw a circle with the given angle 245 | 246 | _arcSegment = new ArcSegment 247 | { 248 | SweepDirection = SweepDirection.Clockwise 249 | }; 250 | 251 | _pathFigure = new PathFigure 252 | { 253 | Segments = new PathSegmentCollection 254 | { 255 | _arcSegment 256 | } 257 | }; 258 | 259 | _pathRoot = new Path 260 | { 261 | Stroke = SegmentColor, 262 | StrokeThickness = StrokeThickness, 263 | HorizontalAlignment = HorizontalAlignment.Center, 264 | VerticalAlignment = VerticalAlignment.Center, 265 | Data = new PathGeometry 266 | { 267 | Figures = new PathFigureCollection 268 | { 269 | _pathFigure 270 | } 271 | } 272 | }; 273 | 274 | Content = new Grid 275 | { 276 | Background = BackgroundColor, 277 | Children = 278 | { 279 | _pathRoot360, 280 | _pathRoot, 281 | } 282 | }; 283 | } 284 | } 285 | } 286 | -------------------------------------------------------------------------------- /UWP/CrossPieCharts.UWP/PieCharts/PieChart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.Foundation; 3 | using Windows.UI; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Controls; 6 | using Windows.UI.Xaml.Media; 7 | using Windows.UI.Xaml.Shapes; 8 | 9 | namespace CrossPieCharts.UWP.PieCharts 10 | { 11 | 12 | /// 13 | /// Pie Chart control for UWP. 14 | /// 15 | public class PieChart : UserControl 16 | { 17 | 18 | private double _angle = 120; 19 | private ArcSegment _arcSegment = new ArcSegment(); 20 | private ArcSegment _arcSegment360 = new ArcSegment(); 21 | private PathFigure _pathFigure = new PathFigure(); 22 | private PathFigure _pathFigure360 = new PathFigure(); 23 | private Path _pathRoot = new Path(); 24 | private Path _pathRoot360 = new Path(); 25 | 26 | public int Radius 27 | { 28 | get 29 | { 30 | return (int)GetValue(RadiusProperty); 31 | } 32 | set 33 | { 34 | SetValue(RadiusProperty, value); 35 | } 36 | } 37 | 38 | public Brush SegmentColor 39 | { 40 | get 41 | { 42 | return (Brush)GetValue(SegmentColorProperty); 43 | } 44 | set 45 | { 46 | SetValue(SegmentColorProperty, value); 47 | } 48 | } 49 | 50 | public Brush Segment360Color 51 | { 52 | get 53 | { 54 | return (Brush)GetValue(Segment360ColorProperty); 55 | } 56 | set 57 | { 58 | SetValue(Segment360ColorProperty, value); 59 | } 60 | } 61 | 62 | public Brush BackgroundColor 63 | { 64 | get 65 | { 66 | return (Brush)GetValue(BackgroundColorProperty); 67 | } 68 | set 69 | { 70 | SetValue(BackgroundColorProperty, value); 71 | } 72 | } 73 | 74 | public int StrokeThickness 75 | { 76 | get 77 | { 78 | return (int)GetValue(StrokeThicknessProperty); 79 | } 80 | set 81 | { 82 | SetValue(StrokeThicknessProperty, value); 83 | } 84 | } 85 | 86 | public double Percentage 87 | { 88 | get 89 | { 90 | return (double)GetValue(PercentageProperty); 91 | } 92 | set 93 | { 94 | SetValue(PercentageProperty, value); 95 | } 96 | } 97 | 98 | // Using a DependencyProperty as the backing store for Percentage. This enables animation, styling, binding, etc... 99 | public static readonly DependencyProperty PercentageProperty = 100 | DependencyProperty.Register("Percentage", typeof(double), typeof(PieChart), new PropertyMetadata(65d, OnPropertyChanged)); 101 | 102 | // Using a DependencyProperty as the backing store for StrokeThickness. This enables animation, styling, binding, etc... 103 | public static readonly DependencyProperty StrokeThicknessProperty = 104 | DependencyProperty.Register("StrokeThickness", typeof(int), typeof(PieChart), new PropertyMetadata(10, OnPropertyChanged)); 105 | 106 | // Using a DependencyProperty as the backing store for SegmentColor. This enables animation, styling, binding, etc... 107 | public static readonly DependencyProperty SegmentColorProperty = 108 | DependencyProperty.Register("SegmentColor", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.Green), OnPropertyChanged)); 109 | 110 | 111 | public static readonly DependencyProperty BackgroundColorProperty = 112 | DependencyProperty.Register("BackgroundColor", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.Transparent), OnPropertyChanged)); 113 | 114 | // Using a DependencyProperty as the backing store for SegmentColor. This enables animation, styling, binding, etc... 115 | public static readonly DependencyProperty Segment360ColorProperty = 116 | DependencyProperty.Register("Segment360Color", typeof(Brush), typeof(PieChart), new PropertyMetadata(new SolidColorBrush(Colors.LightGray), OnPropertyChanged)); 117 | 118 | // Using a DependencyProperty as the backing store for Radius. This enables animation, styling, binding, etc... 119 | public static readonly DependencyProperty RadiusProperty = 120 | DependencyProperty.Register("Radius", typeof(int), typeof(PieChart), new PropertyMetadata(25, OnPropertyChanged)); 121 | 122 | public PieChart() 123 | { 124 | 125 | InitializePieChart(); 126 | 127 | //_angle = Percentage * 360 / 100; 128 | } 129 | 130 | private static void OnPercentageChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) 131 | { 132 | var pieChart = sender as PieChart; 133 | 134 | pieChart._angle = (pieChart.Percentage * 360) / 100; 135 | 136 | pieChart.InitializePieChart(); 137 | 138 | pieChart.RenderArc(); 139 | } 140 | 141 | private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) 142 | { 143 | var pieChart = sender as PieChart; 144 | 145 | pieChart.InitializePieChart(); 146 | 147 | pieChart.RenderArc(); 148 | } 149 | 150 | public void RenderArc() 151 | { 152 | 153 | _angle = Percentage * 360 / 100; 154 | 155 | var startPoint = new Point(Radius, 0); 156 | var endPoint = ComputeCartesianCoordinate(_angle, Radius); 157 | endPoint.X += Radius; 158 | endPoint.Y += Radius; 159 | 160 | _pathRoot.Width = Radius * 2 + StrokeThickness; 161 | _pathRoot.Height = Radius * 2 + StrokeThickness; 162 | _pathRoot.Margin = new Thickness(StrokeThickness, StrokeThickness, 0, 0); 163 | 164 | var largeArc = _angle > 180.0; 165 | 166 | var outerArcSize = new Size(Radius, Radius); 167 | 168 | _pathFigure.StartPoint = startPoint; 169 | 170 | if (startPoint.X == Math.Round(endPoint.X) && startPoint.Y == Math.Round(endPoint.Y)) 171 | { 172 | endPoint.X -= 0.01; 173 | } 174 | 175 | _arcSegment.Point = endPoint; 176 | _arcSegment.Size = outerArcSize; 177 | _arcSegment.IsLargeArc = largeArc; 178 | 179 | // Draw the 360 arc/circle 180 | 181 | var endPoint2 = ComputeCartesianCoordinate(360, Radius); 182 | endPoint2.X += Radius; 183 | endPoint2.Y += Radius; 184 | 185 | _pathRoot360.Width = Radius * 2 + StrokeThickness; 186 | _pathRoot360.Height = Radius * 2 + StrokeThickness; 187 | _pathRoot360.Margin = new Thickness(StrokeThickness, StrokeThickness, 0, 0); 188 | 189 | _pathFigure360.StartPoint = startPoint; 190 | 191 | if (startPoint.X == Math.Round(endPoint2.X) && startPoint.Y == Math.Round(endPoint2.Y)) 192 | { 193 | endPoint2.X -= 0.01; 194 | } 195 | 196 | _arcSegment360.Point = endPoint2; 197 | _arcSegment360.Size = outerArcSize; 198 | _arcSegment360.IsLargeArc = true; 199 | } 200 | 201 | private Point ComputeCartesianCoordinate(double angle, double radius) 202 | { 203 | // convert to radians 204 | var angleRad = (Math.PI / 180.0) * (angle - 90); 205 | 206 | var x = radius * Math.Cos(angleRad); 207 | var y = radius * Math.Sin(angleRad); 208 | 209 | return new Point(x, y); 210 | } 211 | 212 | public void InitializePieChart() 213 | { 214 | 215 | // draw the full circle/arc 216 | _arcSegment360 = new ArcSegment 217 | { 218 | SweepDirection = SweepDirection.Clockwise 219 | }; 220 | 221 | _pathFigure360 = new PathFigure 222 | { 223 | Segments = new PathSegmentCollection 224 | { 225 | _arcSegment360 226 | } 227 | }; 228 | 229 | _pathRoot360 = new Path 230 | { 231 | Stroke = Segment360Color, 232 | StrokeThickness = StrokeThickness, 233 | HorizontalAlignment = HorizontalAlignment.Center, 234 | VerticalAlignment = VerticalAlignment.Center, 235 | Data = new PathGeometry 236 | { 237 | Figures = new PathFigureCollection 238 | { 239 | _pathFigure360 240 | } 241 | } 242 | }; 243 | 244 | //draw a circle with the given angle 245 | 246 | _arcSegment = new ArcSegment 247 | { 248 | SweepDirection = SweepDirection.Clockwise 249 | }; 250 | 251 | _pathFigure = new PathFigure 252 | { 253 | Segments = new PathSegmentCollection 254 | { 255 | _arcSegment 256 | } 257 | }; 258 | 259 | _pathRoot = new Path 260 | { 261 | Stroke = SegmentColor, 262 | StrokeThickness = StrokeThickness, 263 | HorizontalAlignment = HorizontalAlignment.Center, 264 | VerticalAlignment = VerticalAlignment.Center, 265 | Data = new PathGeometry 266 | { 267 | Figures = new PathFigureCollection 268 | { 269 | _pathFigure 270 | } 271 | } 272 | }; 273 | 274 | Content = new Grid 275 | { 276 | Background = BackgroundColor, 277 | Children = 278 | { 279 | _pathRoot360, 280 | _pathRoot, 281 | } 282 | }; 283 | } 284 | } 285 | } 286 | --------------------------------------------------------------------------------