public QuarterHomeCache()
 {
     ListDataQuarter       = new List <DataResultModel>();
     ListLateTopInQuarter  = new List <DataTopModel>();
     ListEarlyTopInQuarter = new List <DataTopModel>();
     DataChartQuarter      = new DataChartModel();
 }
Beispiel #2
0
 public WeekHomeCache()
 {
     ListDataWeek       = new List <DataResultModel>();
     ListLateTopInWeek  = new List <DataTopModel>();
     ListEarlyTopInWeek = new List <DataTopModel>();
     DataChartWeek      = new DataChartModel();
 }
 public MonthHomeCache()
 {
     ListDataMonth       = new List <DataResultModel>();
     ListLateTopInMonth  = new List <DataTopModel>();
     ListEarlyTopInMonth = new List <DataTopModel>();
     DataChartMonth      = new DataChartModel();
 }
Beispiel #4
0
        private DataChartModel createChartModel(string type)
        {
            var    model  = new DataChartModel();
            string width  = "350px";
            string height = "300px";

            model.DataSource = _unitOfWork.Categories.GetUnitsSoldByMonthForSpecificCountries();

            if (type == "Column")
            {
                width        = "900px";
                height       = "400px";
                model.Legend = new LegendModel {
                    ID = "legend"
                };
                model.Subtitle   = "How many uniter have been sold from each product category";
                model.DataSource = _unitOfWork.Categories.GetSpecificCountries();
            }

            model.Title  = type == "Column" ? "Units sold by category" : type;
            model.Width  = width;
            model.Height = height;

            model.Axes.Add(new CategoryXAxisModel
            {
                Name      = "xAxis",
                Title     = type == "Column" ? "Product Category" : null,
                Label     = type == "Column" ? "Category" : "Month",
                TopMargin = 10
            });

            model.Axes.Add(new NumericYAxisModel
            {
                Name         = "yAxis",
                Title        = type == "Column" ? "Product Category" : null,
                MaximumValue = type == "Column" ? 1900 : 300,
                RightMargin  = 5
            });

            model.Series.Add(createSeries("USA", "USA", type));
            model.Series.Add(createSeries("Germany", "Germany", type));
            model.Series.Add(createSeries("Brazil", "Brazil", type));

            return(model);
        }