Exemple #1
0
        void InitData(Agent agent)
        {
            if (agent == null)
            {
                return;
            }
            gridControl1.DataSource = DataHelper.GetHomesByAgent(agent);
            gridControl1.Focus();
            Random random = new Random(agent.ID);
            int    year   = DateTime.Now.Year;

            ccAgent.BeginInit();
            try {
                NorthEastSeries.Points.Clear();
                MidWestSeries.Points.Clear();
                SouthSeries.Points.Clear();
                WestSeries.Points.Clear();
                for (int i = 0; i < 10; i++)
                {
                    DateTime date = new DateTime(year - i, 1, 1);
                    NorthEastSeries.Points.Add(new SeriesPoint(date, random.Next(5)));
                    MidWestSeries.Points.Add(new SeriesPoint(date, random.Next(10)));
                    SouthSeries.Points.Add(new SeriesPoint(date, random.Next(20)));
                    WestSeries.Points.Add(new SeriesPoint(date, random.Next(15)));
                }
            }
            finally {
                ccAgent.EndInit();
            }
            ((ImageAnnotation)ccAgent.Annotations[0]).Image.Image = agent.Photo;
            ccAgent.Titles[0].Text = string.Format("Houses Sold by {0} {1}", agent.FirstName, agent.LastName);
            object min = AxisX.GetScaleValueFromInternal(WholeRangeX.MaxValueInternal - 3);

            VisualRangeX.SetMinMaxValues(min, WholeRangeX.MaxValue);
        }
Exemple #2
0
        void InitData(List <MortgageRate> mortgageRates)
        {
            ccBank.BeginInit();
            try {
                foreach (MortgageRate mortgageRate in mortgageRates)
                {
                    FRM30.Points.Add(new SeriesPoint(mortgageRate.Date, mortgageRate.FRM30));
                    FRM15.Points.Add(new SeriesPoint(mortgageRate.Date, mortgageRate.FRM15));
                    ARM1.Points.Add(new SeriesPoint(mortgageRate.Date, mortgageRate.ARM1));
                }
            }
            finally {
                ccBank.EndInit();
            }
            object min = AxisX.GetScaleValueFromInternal(WholeRangeX.MaxValueInternal - 80);

            VisualRangeX.SetMinMaxValues(min, WholeRangeX.MaxValue);
        }