/// <summary> /// 库存滞销报表 /// </summary> /// <param name="app"></param> /// <param name="title"></param> /// <returns></returns> private async Task <ChartViewConfig> UnsalablePage_Chart(Module app, string title) { ChartViewConfig chartData = null; try { var result = await _reportingService.GetUnSaleRankingAsync(Settings.UserId, 0, 0, DateTime.Now.AddDays(-15), DateTime.Now, this.ForceRefresh, new System.Threading.CancellationToken()); if (result != null && result.Any()) { var series = result.ToList(); if (series.Count > 50) { series = result.Take(50).ToList(); } chartData = new ChartViewConfig() { BackgroundColor = Color.White, ChartConfig = new ChartConfig { type = Wesley.ChartJS.ChartTypes.Line, data = ChartDataProvider.GetUnsalable(series), } }; } return(chartData); } catch (Exception ex) { Crashes.TrackError(ex); return(chartData); } }
public void Refresh(List <UnSaleRanking> series) { RankSeries = new ObservableCollection <UnSaleRanking>(series); TotalSumReturnAmount = series.Select(s => s.TotalSumReturnAmount).Sum(); TotalSumNetAmount = series.Select(s => s.TotalSumNetAmount).Sum(); var ranks = series.ToList(); if (ranks.Count > 10) { ranks = ranks.Take(10).ToList(); } var data = new ChartViewConfig() { BackgroundColor = Color.White, ChartConfig = new ChartConfig { type = Wesley.ChartJS.ChartTypes.Line, data = ChartDataProvider.GetUnsalable(ranks), } }; ChartConfig = data; }