Наследование: WidgetBase
Пример #1
0
        public void XmlEncodingTest() {
            var chart = new GanttChart
                        {
                            Caption = "Gantt Chart 'Sample' 입니다.",
                            SubCaption = "<< Sub \"LegendCaption\" & 특수문자 입니다 >>",
                            DateFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern
                        };

            var categories = new CategoriesElement
                             {
                                 new CategoryElement
                                 {
                                     Start = DateTime.Today.AddYears(-1),
                                     End = DateTime.Today.AddYears(1),
                                 }
                             };
            categories.BgColor = Color.WhiteSmoke;

            chart.CategoriesList.Add(categories);
            chart.ClickURL.Url = "http://localhost/Gantt.aspx";
            chart.DefaultAnimation = false;

            Console.WriteLine("Gantt Chart with categories");

            ValidateChartXml(chart);
        }
Пример #2
0
        public void XmlEncodingTest()
        {
            var chart = new GanttChart
            {
                Caption    = "Gantt Chart 'Sample' 입니다.",
                SubCaption = "<< Sub \"LegendCaption\" & 특수문자 입니다 >>",
                DateFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern
            };

            var categories = new CategoriesElement
            {
                new CategoryElement
                {
                    Start = DateTime.Today.AddYears(-1),
                    End   = DateTime.Today.AddYears(1),
                }
            };

            categories.BgColor = Color.WhiteSmoke;

            chart.CategoriesList.Add(categories);
            chart.ClickURL.Url     = "http://localhost/Gantt.aspx";
            chart.DefaultAnimation = false;

            Console.WriteLine("Gantt Chart with categories");

            ValidateChartXml(chart);
        }
Пример #3
0
        public void GenerateCategories_YearWeekDayHour() {
            using(new OperationTimer("Year,Week,Day,Hour")) {
                var chart = new GanttChart();
                GanttUtil.GenerateCategories(chart.CategoriesList, ProjectPeriod, PeriodFlags.YearWeekDayHour);

                if(IsDebugEnabled)
                    log.Debug("chart=" + chart.GetDataXml(true));
            }
        }
Пример #4
0
        public void GenerateCategories_Year_HalfYear_Quarter_Month_Day_Hour() {
            using(new OperationTimer("Year,HalfYear,Quarter,Month,Day,Hour")) {
                var chart = new GanttChart();
                GanttUtil.GenerateCategories(chart.CategoriesList, ProjectPeriod,
                                             PeriodFlags.YearQuarterMonthDayHour | PeriodFlags.HalfYear);

                if(IsDebugEnabled)
                    log.Debug("chart=" + chart.GetDataXml(true));
            }
        }
Пример #5
0
        public void GenerateCategories_YearWeek() {
            var period = new CalendarTimeRange(new DateTime(2008, 7, 12), new DateTime(2011, 2, 12), TimeCalendar.NewEmptyOffset());
            var chart = new GanttChart();

            GanttUtil.GenerateCategories(chart.CategoriesList, period, PeriodFlags.YearWeek);
            chart.SetExportInServer();

            if(IsDebugEnabled)
                log.Debug("chart=" + chart.GetDataXml(true));
        }
Пример #6
0
        public void GenerateCategories_YearWeekDayHour()
        {
            using (new OperationTimer("Year,Week,Day,Hour")) {
                var chart = new GanttChart();
                GanttUtil.GenerateCategories(chart.CategoriesList, ProjectPeriod, PeriodFlags.YearWeekDayHour);

                if (IsDebugEnabled)
                {
                    log.Debug("chart=" + chart.GetDataXml(true));
                }
            }
        }
Пример #7
0
        public void GenerateCategories_Year_HalfYear_Quarter_Month_Day_Hour()
        {
            using (new OperationTimer("Year,HalfYear,Quarter,Month,Day,Hour")) {
                var chart = new GanttChart();
                GanttUtil.GenerateCategories(chart.CategoriesList, ProjectPeriod,
                                             PeriodFlags.YearQuarterMonthDayHour | PeriodFlags.HalfYear);

                if (IsDebugEnabled)
                {
                    log.Debug("chart=" + chart.GetDataXml(true));
                }
            }
        }
Пример #8
0
        public void GenerateCategories_YearWeek()
        {
            var period = new CalendarTimeRange(new DateTime(2008, 7, 12), new DateTime(2011, 2, 12), TimeCalendar.NewEmptyOffset());
            var chart  = new GanttChart();

            GanttUtil.GenerateCategories(chart.CategoriesList, period, PeriodFlags.YearWeek);
            chart.SetExportInServer();

            if (IsDebugEnabled)
            {
                log.Debug("chart=" + chart.GetDataXml(true));
            }
        }
Пример #9
0
        private static IChart CreateSampleChart(string caption) {
            var chart = new GanttChart
                        {
                            Caption = caption,
                            SubCaption = "소제목입니다.",
                            Palette = 2,
                            BaseFontAttr =
                            {
                                Font = "맑은 고딕",
                                FontColor = "#0372AB".FromHtml(),
                                FontSize = "8"
                            },
                        };

            GanttUtil.GenerateCategories(chart.CategoriesList, ProjectPeriod, PeriodFlags.YearWeek);

            chart.Processes.FontAttr.Font = "맑은 고딕";
            chart.Processes.FontAttr.FontSize = 12.ToString();
            chart.Processes.FontAttr.IsBold = true;
            chart.Processes.FontAttr.IsItalic = false;
            chart.Processes.Align = FusionTextAlign.Right;
            chart.Processes.HeaderText = "What to do?";
            chart.Processes.HeaderAttr.FontAttr.FontSize = 18.ToString();
            chart.Processes.HeaderAttr.Align = FusionTextAlign.Left;
            chart.Processes.HeaderAttr.VAlign = FusionVerticalAlign.Middle;

            // task의 진행률을 Percentage로 나타낼 때, 완료하지 않은 부분
            chart.SlackFillColor = Color.DarkGray;
            // Task의 진행률을 나타냅니다.
            chart.ShowPercentLabel = true;

            var procId = 0;
            foreach(string label in ProcessLabels) {
                var process = new ProcessElement("Process" + procId++)
                              {
                                  ItemAttr =
                                  {
                                      Label = label,
                                      FontAttr =
                                      {
                                          Font = "맑은 고딕",
                                          FontColor = Color.FromArgb(0, 0x03, 0x72, 0xAB),
                                          FontSize = 13.ToString(),
                                          IsBold = true
                                      }
                                  }
                              };

                // process.ItemAttr.FontAttr.IsItalic = true;
                // process.ItemAttr.FontAttr.IsUnderline = true;
                // process.ItemAttr.BgColor = Color.White;
                process.ItemAttr.Align = FusionTextAlign.Left;
                process.ItemAttr.VAlign = FusionVerticalAlign.Middle;

                // chart.Processes.ProcessElements.Add(process);
                chart.Processes.Add(process);
            }

            var taskId = 0;
            foreach(var taskPeriod in TaskPeriods) {
                var task = new TaskElement
                           {
                               Start = taskPeriod.Start,
                               End = taskPeriod.End,
                               Id = taskId++.ToString(),
                               Color = Color.SteelBlue,
                               ShowLabel = true,
                               Animation = true,
                               BorderThickness = 1,
                               PercentComplete = rnd.Next(0, 101)
                           };

                // Task의 진행률

                // chart.Tasks.TaskElements.Add(task);
                chart.Tasks.Add(task);
            }

            return chart;
        }
Пример #10
0
        private static GanttChart CreateSampleChart(string caption) {
            var chart = new GanttChart
                        {
                            Caption = caption,
                            SubCaption = "소제목입니다.",
                            Palette = 2,
                        };

            var categories = new CategoriesElement
                             {
                                 FontAttr =
                                 {
                                     Font = "Tahoma",
                                     FontColor = Color.FromArgb(0, 0x03, 0x72, 0xAB),
                                     FontSize = 13.ToString(),
                                     IsBold = true,
                                     IsItalic = true,
                                     IsUnderline = true
                                 },
                                 BgColor = Color.White,
                                 Align = FusionTextAlign.Center,
                                 VAlign = FusionVerticalAlign.Middle
                             };


            foreach(var month in ProjectPeriod.ForEachMonths()) {
                var category = new CategoryElement
                               {
                                   Start = month.Start,
                                   End = month.End,
                               };
                category.ItemAttr.Label = month.Start.Month.ToString();
                category.ItemAttr.FontAttr.Font = "Tahoma";
                category.ItemAttr.FontAttr.FontColor = Color.FromArgb(0, 0x03, 0x72, 0xAB);
                category.ItemAttr.FontAttr.FontSize = 13.ToString();
                category.ItemAttr.FontAttr.IsBold = true;
                category.ItemAttr.FontAttr.IsItalic = true;
                category.ItemAttr.FontAttr.IsUnderline = true;
                category.ItemAttr.BgColor = Color.White;
                category.ItemAttr.Align = FusionTextAlign.Center;
                category.ItemAttr.VAlign = FusionVerticalAlign.Middle;

                categories.Add(category);
            }

            chart.CategoriesList.Add(categories);

            chart.Processes.FontAttr.FontSize = 12.ToString();
            chart.Processes.FontAttr.IsBold = true;
            chart.Processes.Align = FusionTextAlign.Right;
            chart.Processes.HeaderText = "What to do?";
            chart.Processes.HeaderAttr.FontAttr.FontSize = 18.ToString();
            chart.Processes.HeaderAttr.Align = FusionTextAlign.Right;
            chart.Processes.HeaderAttr.VAlign = FusionVerticalAlign.Bottom;

            var procId = 0;
            foreach(string label in ProcessLabels) {
                var process = new ProcessElement("Process" + procId++.ToString())
                              {
                                  ItemAttr =
                                  {
                                      Label = label,
                                      FontAttr =
                                      {
                                          Font = "Tahoma",
                                          FontColor = Color.FromArgb(0, 0x03, 0x72, 0xAB),
                                          FontSize = 13.ToString(),
                                          IsBold = true,
                                          IsItalic = true,
                                          IsUnderline = true
                                      },
                                      BgColor = Color.White,
                                      Align = FusionTextAlign.Center,
                                      VAlign = FusionVerticalAlign.Middle
                                  }
                              };

                chart.Processes.Add(process);
            }

            procId = 0;
            var taskId = 0;
            foreach(var taskPeriod in TaskPeriods) {
                var task = new TaskElement
                           {
                               Start = taskPeriod.Start,
                               End = taskPeriod.End,
                               Id = "Task" + taskId++,
                               ProcessId = "Process" + procId++,
                               Color = Color.BlueViolet,
                               ShowLabel = true,
                               Animation = true,
                               BorderThickness = 1
                           };

                // chart.Tasks.TaskElements.Add(task);
                chart.Tasks.Add(task);
            }

            return chart;
        }
Пример #11
0
        private static GanttChart CreateSampleChart(string caption)
        {
            var chart = new GanttChart
            {
                Caption    = caption,
                SubCaption = "소제목입니다.",
                Palette    = 2,
            };

            var categories = new CategoriesElement
            {
                FontAttr =
                {
                    Font        = "Tahoma",
                    FontColor   = Color.FromArgb(0, 0x03, 0x72, 0xAB),
                    FontSize    =    13.ToString(),
                    IsBold      = true,
                    IsItalic    = true,
                    IsUnderline = true
                },
                BgColor = Color.White,
                Align   = FusionTextAlign.Center,
                VAlign  = FusionVerticalAlign.Middle
            };


            foreach (var month in ProjectPeriod.ForEachMonths())
            {
                var category = new CategoryElement
                {
                    Start = month.Start,
                    End   = month.End,
                };
                category.ItemAttr.Label                = month.Start.Month.ToString();
                category.ItemAttr.FontAttr.Font        = "Tahoma";
                category.ItemAttr.FontAttr.FontColor   = Color.FromArgb(0, 0x03, 0x72, 0xAB);
                category.ItemAttr.FontAttr.FontSize    = 13.ToString();
                category.ItemAttr.FontAttr.IsBold      = true;
                category.ItemAttr.FontAttr.IsItalic    = true;
                category.ItemAttr.FontAttr.IsUnderline = true;
                category.ItemAttr.BgColor              = Color.White;
                category.ItemAttr.Align                = FusionTextAlign.Center;
                category.ItemAttr.VAlign               = FusionVerticalAlign.Middle;

                categories.Add(category);
            }

            chart.CategoriesList.Add(categories);

            chart.Processes.FontAttr.FontSize            = 12.ToString();
            chart.Processes.FontAttr.IsBold              = true;
            chart.Processes.Align                        = FusionTextAlign.Right;
            chart.Processes.HeaderText                   = "What to do?";
            chart.Processes.HeaderAttr.FontAttr.FontSize = 18.ToString();
            chart.Processes.HeaderAttr.Align             = FusionTextAlign.Right;
            chart.Processes.HeaderAttr.VAlign            = FusionVerticalAlign.Bottom;

            var procId = 0;

            foreach (string label in ProcessLabels)
            {
                var process = new ProcessElement("Process" + procId++.ToString())
                {
                    ItemAttr =
                    {
                        Label    = label,
                        FontAttr =
                        {
                            Font        = "Tahoma",
                            FontColor   = Color.FromArgb(0,             0x03, 0x72, 0xAB),
                            FontSize    =          13.ToString(),
                            IsBold      = true,
                            IsItalic    = true,
                            IsUnderline = true
                        },
                        BgColor = Color.White,
                        Align   = FusionTextAlign.Center,
                        VAlign  = FusionVerticalAlign.Middle
                    }
                };

                chart.Processes.Add(process);
            }

            procId = 0;
            var taskId = 0;

            foreach (var taskPeriod in TaskPeriods)
            {
                var task = new TaskElement
                {
                    Start           = taskPeriod.Start,
                    End             = taskPeriod.End,
                    Id              = "Task" + taskId++,
                    ProcessId       = "Process" + procId++,
                    Color           = Color.BlueViolet,
                    ShowLabel       = true,
                    Animation       = true,
                    BorderThickness = 1
                };

                // chart.Tasks.TaskElements.Add(task);
                chart.Tasks.Add(task);
            }

            return(chart);
        }