public void InitData()
        {
            List <DataModel> list = new List <DataModel>();

            if (group == null)
            {
                group = "测试";
            }
            if (TextDataData == null)
            {
                TextDataData = new string[] { "出租房管理情况", "230", "140", "流动人口管理情况", "410", "200" };
            }

            DataModel model = new DetailDataModel(group, 0, TextDataData);

            list.Add(model);

            ReportViewAdapter adapter = new SingleReportViewAdapter();

            adapter.setData(list);
            adapter.IsVerticalShowData = false;
            setAdapter(adapter);

            _attr       = GetAlphaImgAttr(98);
            _rentalImg1 = Image.FromFile(ImgPath1);
            _rentalImg2 = Image.FromFile(ImgPath2);
        }
Exemple #2
0
        public void initData()
        {
            List <DataModel> list = new List <DataModel>();

            if (pieTitle == null)
            {
                pieTitle = "October 1024件";
            }
            if (TextAndData == null)
            {
                TextAndData = new string[] { "移动", "230", "联通", "140", "电信", "410", "公网", "200", "华数", "44" };
            }
            //计算数据之和以及设定最大数据
            allNum = 0;
            maxNum = 0;
            CalculateAllNum();

            DataModel model = new DetailDataModel(pieTitle, 0, TextAndData);

            if (IsHorizontally)
            {
                EStartX = this.Width / 2 - EViewWidth / 2;
                EStartY = this.Height / 2 - EViewHeight / 2;
            }
            model.Area = new AreaPositionRect(EStartX, EStartY, EViewWidth + EStartX, EViewHeight + EStartY);
            list.Add(model);

            ReportViewAdapter adapter = new SingleReportViewAdapter();

            //设置数据源
            adapter.setData(list);
            adapter.IsVerticalShowData = false;
            setAdapter(adapter);
        }
        /// 初始化数据
        public void initData()
        {
            List <DataModel> list = new List <DataModel>();

            if (Title == null)
            {
                Title = "报表";
            }
            if (TextAndData == null)
            {
                TextAndData = new string[] { "数据一", "20", "数据二", "30", "数据三", "40" };
            }
            //计算数据之和以及设定最大数据
            allNum = 0;
            CalculateAllNum();
            //CalculateAllNum();
            if (IsDescendingOrder)
            {
                TextAndData = ReportViewUtils.SortTextAndData(TextAndData);
            }
            DataModel model = new DetailDataModel(Title, 0, TextAndData);

            if (IsHorizontally)
            {
                EStartX = this.Width / 2 - EViewWidth / 2;
                EStartY = this.Height / 2 - EViewHeight / 2;
            }
            model.Area = new AreaPositionRect(EStartX, EStartY, EViewWidth + EStartX, EViewHeight + EStartY);
            list.Add(model);

            //添加图形注解,用于解释该图形代表什么
            LegendNoteModels = GetLegendNotes();
            //添加特殊的鼠标响应区域, 注意数据模型必须是坐标已赋值的
            DataModel[] datamodels = LegendNoteModels;
            if (datamodels != null)
            {
                foreach (DataModel item in datamodels)
                {
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            ReportViewAdapter adapter = new SingleReportViewAdapter();

            //设置数据源
            adapter.setData(list);
            adapter.IsVerticalShowData = false;
            setAdapter(adapter);
            AutoResizeWithHeightAndPos();
        }
Exemple #4
0
        public void initData()
        {
            //List<DataModel> list = new List<DataModel>();
            //DataModel model = new DataModel();
            if (Title != null)
            {
                CoordinateDataModelBean.Title = Title;
            }
            else
            {
                Title = CoordinateDataModelBean.Title;
            }
            if (LableX != null)
            {
                CoordinateDataModelBean.Lable_X = LableX;
            }
            else
            {
                LableX = CoordinateDataModelBean.Lable_X;
            }
            if (LableY != null)
            {
                CoordinateDataModelBean.Lable_Y = LableY;
            }
            else
            {
                LableY = CoordinateDataModelBean.Lable_Y;
            }
            if (CoordinateModels != null)
            {
                CoordinateDataModelBean.CoordinateModelList = CoordinateModels;
            }
            else
            {
                List <DataModel> Models = new List <DataModel>();
                Models.Add(new DataModel("时间01", 50));
                Models.Add(new DataModel("时间02", 100));
                Models.Add(new DataModel("时间03", 150));
                Models.Add(new DataModel("时间04", 200));
                Models.Add(new DataModel("时间05", 200));
                Models.Add(new DataModel("时间06", 200));
                Models.Add(new DataModel("时间07", 200));
                addDifferentModels(Models);
                Models = new List <DataModel>();
                Models.Add(new DataModel("时间01", 80));
                Models.Add(new DataModel("时间02", 10));
                Models.Add(new DataModel("时间03", 50));
                Models.Add(new DataModel("时间04", 20));
                Models.Add(new DataModel("时间05", 220));
                Models.Add(new DataModel("时间06", 10));
                Models.Add(new DataModel("时间07", 230));
                addDifferentModels(Models);
                Models = new List <DataModel>();
                Models.Add(new DataModel("时间01", 180));
                Models.Add(new DataModel("时间02", 110));
                Models.Add(new DataModel("时间03", 150));
                Models.Add(new DataModel("时间04", 120));
                Models.Add(new DataModel("时间05", 80));
                Models.Add(new DataModel("时间06", 50));
                Models.Add(new DataModel("时间07", 30));
                addDifferentModels(Models);
                CoordinateDataModelBean.CoordinateModelList = CoordinateModels;
            }

            CoordinateDataModelBean.initXYData();
            //计算数据之和以及设定最大数据
            //AllNum = 0;
            MaxNum = ReportViewUtils.getMaxNumFromData(CoordinateDataModelBean.Y_Data);
            //CalculateAllNum();
            if (IsNeedDataPartitioning)
            {
                //整理数据
            }
            //自动缩放
            if (IsAutoReSizeView)
            {
                ResizeReportViewChange();
            }
            else
            {
                if (EViewWidth == 0)
                {
                    throw new ArgumentException("请设定绘制图像的宽高, 或者设置IaAutoReSize = true");
                }
            }

            if (IsHorizontally)
            {
                if (EViewWidth != 0)
                {
                    EStartX = this.Width / 2 - EViewWidth / 2;
                    EStartY = this.Height / 2 - EViewHeight / 2;
                }
            }
            //自动调整位置
            if (IsHorizontally)
            {
                ReLocationModelPos();
            }
            //model.Area = new AreaPositionRect(StartX, StartY, ViewWidth + StartX, ViewHeight + StartY);
            //list.Add(model);
            ReportViewAdapter adapter = new SingleReportViewAdapter();

            //设置数据源
            adapter.setData(CoordinateModels);
            adapter.IsVerticalShowData = false;
            setAdapter(adapter);
        }