Ejemplo n.º 1
0
		async Task UpdateSalesReport ()
		{
			currentSalesReport = await App.Client.GetSalesReport (PeriodFilter);
			if (currentSalesReport == null)
				return;
			
			UpdateNumbersCount ();
			AverageSales = currentSalesReport.AverageSales;
			TotalSales = currentSalesReport.TotalSales;
			//periodFilter = Extensions.ParseEnum<WooCommerceFilterPeriod> (currentSalesReport.TotalsGroupedBy);
			GeneratePlotModels (currentSalesReport);
		}
Ejemplo n.º 2
0
		static PlotModel GetNewOrdersSplotModel (SalesReport report)
		{
			var splotModel =  CreateChartOnlyBars ();

			var columnSeries = new ColumnSeries ();
			for (int i = 0; i < report.Totals.Count; i++) {
				var total = report.Totals.ElementAt (i).Value;
				columnSeries.Items.Add (new ColumnItem (total.Orders) {
					Color = OxyColor.Parse ( i% 2 == 0 ? "#f2e3c7" : "#f5ebde") 
				});
			}
			splotModel.Series.Add (columnSeries);
			return splotModel;
		}
Ejemplo n.º 3
0
		static PlotModel GetSalesSplotModel (SalesReport report)
		{
			var splotModel =  CreateChartOnlyBars ();

			var columnSeries = new ColumnSeries ();
			for (int i = 0; i < report.Totals.Count; i++) {
				var total = report.Totals.ElementAt (i).Value;
				double value;
				double.TryParse (total.Sales, out value);
				if (value == 0)
					value = 1;
				columnSeries.Items.Add (new ColumnItem (value) {
					Color = OxyColor.Parse ( i% 2 == 0 ? "#dee3c7" : "#ebedde") 
				});
			}
			splotModel.Series.Add (columnSeries);
			return splotModel;
		}
Ejemplo n.º 4
0
		void GeneratePlotModels (SalesReport report)
		{
			PlotDataReady = false;
			var splotModel = GetSalesSplotModel (report);
			var noplotModel = GetNewOrdersSplotModel (report);
			var ncplotModel = GetNewCustomersSplotModel (report);
			NewCustomersPlotModel = ncplotModel;
			SalesPlotModel = splotModel;
			NewOrdersPlotModel = noplotModel;
			PlotDataReady = true;
		}