BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<?xml version="1.0" encoding="utf-8" ?> <bottomTabs:BottomTabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms" xmlns:bottomTabs="clr-namespace:pranjalApp.Renders" xmlns:local="clr-namespace:pranjalApp.ViewModels" xmlns:Iconize="clr-namespace:FormsPlugin.Iconize;assembly=FormsPlugin.Iconize" x:Class="pranjalApp.Views.userHistory" NavigationPage.HasNavigationBar="False"> <!--Pages can be added as references or inline--> <ContentPage Title="Payment History"> <ContentPage.Content> <StackLayout x:Name="pieStack"> <chart:SfChart x:Name="Chart" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> <chart:SfChart.Title> <chart:ChartTitle Text="Expenditures"/> </chart:SfChart.Title> <chart:SfChart.BindingContext> <local:PieSeriesViewModel /> </chart:SfChart.BindingContext> <chart:SfChart.Legend> <chart:ChartLegend/> </chart:SfChart.Legend> <chart:SfChart.Series> <chart:PieSeries ItemsSource="{Binding PieSeriesData}" XBindingPath="Name" YBindingPath="value" StartAngle="75" EnableAnimation="True" EndAngle ="435" EnableSmartLabels="True" ConnectorLineType = "Bezier" DataMarkerPosition = "OutsideExtended" LegendIcon="Rectangle"> <chart:PieSeries.DataMarker> <chart:ChartDataMarker LabelContent="Percentage" ShowLabel="True"> <chart:ChartDataMarker.LabelStyle> <chart:DataMarkerLabelStyle LabelPosition="Center"/> </chart:ChartDataMarker.LabelStyle> </chart:ChartDataMarker> </chart:PieSeries.DataMarker> </chart:PieSeries> </chart:SfChart.Series> </chart:SfChart> </StackLayout> </ContentPage.Content> </ContentPage> <ContentPage Title="Recharge History" > </ContentPage> </bottomTabs:BottomTabbedPage>
[XamlCompilation(XamlCompilationOptions.Compile)] public partial class userHistory : BottomTabbedPage { public userHistory () { InitializeComponent(); if (!(Device.OS == TargetPlatform.Android || Device.OS == TargetPlatform.iOS)) { Chart.Series[0].AnimationDuration = 2; (Chart.Series[0] as PieSeries).StartAngle = 0; (Chart.Series[0] as PieSeries).EndAngle = 360; } Chart.Series[0].BindingContext = new pranjalApp.ViewModels.PieSeriesViewModel(); } protected override void OnPagesChanged(NotifyCollectionChangedEventArgs e) { base.OnPagesChanged(e); } }
pieseriesviewmodel class: public class PieSeriesViewModel { public ObservableCollection<ChartDataModel> PieSeriesData { get; set; } public PieSeriesViewModel() { PieSeriesData = new ObservableCollection<ChartDataModel> { new ChartDataModel("Other personal", 94658), new ChartDataModel("Medical care", 9090), new ChartDataModel("Housing", 2577), new ChartDataModel("Transportation", 473), new ChartDataModel("Education", 120), new ChartDataModel("Electronics", 70) }; } }
public class ChartDataModel { private string Expense; private int value; public ChartDataModel(string Expense, int value) { this.Expense = Expense; this.value = value; } }