public JsonResult GetDataforProductChart() { var query = deliveryService.DeliveredProductListforChart() .GroupBy(q => q.Order.ProductInventory.Name) .Select(q => new { name = q.Key, count = q.Sum(t => t.Order.Quantity) }).ToList(); return(Json(query)); }