public JsonResult Statistics(StatistiscViewModel model)
        {
            int userId            = UserHelper.GetUserByIdentityName(User.Identity.Name).Id;
            List <SiteCount> data = StatisticsHelper.GetSitesStatistics(
                model.CurrentAttribute, userId, model.StartDate, model.EndDate);

            model.Labels      = GetLabels(data);
            model.CountedData = GetData(data);
            model.Attributes  = GetAttributes();
            model.ChartTypes  = GetChartTypes();
            return(Json(new { labels = model.Labels, countedData = model.CountedData, chartType = model.CurrentChartType }));
        }
        private StatistiscViewModel GetModel()
        {
            var model = new StatistiscViewModel()
            {
                Attributes       = GetAttributes(),
                ChartTypes       = GetChartTypes(),
                CurrentAttribute = "system",
                CurrentChartType = "pie",
                StartDate        = new DateTime(2016, 01, 01),
                EndDate          = new DateTime(2017, 01, 01),
                Labels           = null,
                CountedData      = null
            };

            return(model);
        }