public RankChartGenerator(Database db, RankChartParameters rcp, string title)
        {
            _db    = db;
            _rcp   = rcp;
            _title = title;

            //Look up the time zone of the user
            _timeZone = TimeZones.GetTimeZone(_rcp.TimezoneOffsetIndex);

            //Determine the time range
            if (rcp.DateRangeType == DateRangeSelector.DateRanges.Custom)
            {
                _start = _rcp.StartTime;
                _end   = _rcp.EndTime;
            }
            else
            {
                DateRangeSelector.GetDateRangeByType(rcp.DateRangeType, out _start, out _end);
            }

            //Add 1 day to the end of the range, so that it ecompasses the whole last day in the range
            _end = _end.AddDays(1);

            _chart = new XYChart(ChartWidth, ChartHeight, 0xeeeeee, 0x000000, 1);
            Chart.setLicenseCode(CHARTDIRECTOR_LICENSE);
        }
Exemple #2
0
        public void ZoomTimeRangeTest()
        {
            DateTime start, end;

            start = DateTime.Parse("1/1/07 10:00");
            end   = DateTime.Parse("1/1/07 11:00");

            RankChartParameters.ZoomTimeRange(start, end, out start, out end, true);

            Assert.AreEqual(DateTime.Parse("1/1/07 10:15"), start);
            Assert.AreEqual(DateTime.Parse("1/1/07 10:45"), end);
        }
Exemple #3
0
        public void ScrollTimeRange_NoSpan()
        {
            DateTime start, end;

            start = DateTime.Parse("1/1/07 10:00");
            end   = DateTime.Parse("1/1/07 10:00");

            RankChartParameters.ScrollTimeRange(start, end, out start, out end, false);

            Assert.AreEqual(DateTime.Parse("1/1/07 10:00"), start);
            Assert.AreEqual(DateTime.Parse("1/1/07 10:00"), end);
        }
Exemple #4
0
 public void Setup()
 {
     rcp = new RankChartParameters();
 }
 public RankChartGenerator(Database db, RankChartParameters rcp) : this(db, rcp, null)
 {
 }