public virtual void AddTask(TaskElement task) { task.ShouldNotBeNull("task"); task.ProcessId = Id; Tasks.Add(task); }
public void MultiTaskedProcess() { var chart = CreateSampleChart("MultiTaskedProcess"); chart.Tasks.ShowLabels = true; // NOTE : Process 별로 다중의 Task가 존재할 때를 테스트한다. // chart.Tasks.TaskElements.Clear(); chart.Tasks.Clear(); for (int i = 0; i < TaskPeriods.Length; i++) { var taskPeriod = TaskPeriods[i]; // Planned: var planTask = new TaskElement { Start = taskPeriod.Start, End = taskPeriod.End, Id = "Planed Task" + i.ToString(), ProcessId = "Process" + i.ToString(), Label = "Planed", Color = Color.BlueViolet, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "22%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(planTask); chart.Processes[i].Tasks.Add(planTask); // Planned: var actualTask = new TaskElement { Start = taskPeriod.Start.AddDays(5), End = taskPeriod.End.AddDays(10), Id = "Actual Task" + i.ToString(), ProcessId = "Process" + i.ToString(), Label = "Actual", Color = Color.YellowGreen, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "70%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(actualTask); chart.Processes[i].Tasks.Add(actualTask); } ValidateChartXml(chart); }
private static IChart MultiTaskedProcesses() { var chart = (GanttChart)ChartHasDataTable(); chart.Tasks.ShowLabels = true; // NOTE : Process 별로 다중의 Task가 존재할 때를 테스트한다. // chart.Tasks.TaskElements.Clear(); chart.Tasks.Clear(); for(int i = 0; i < TaskPeriods.Length; i++) { var taskPeriod = TaskPeriods[i]; // Planned: var planTask = new TaskElement { Start = taskPeriod.Start, End = taskPeriod.End, Id = "Planed Task" + i, ProcessId = "Process" + i, Label = "Planed", Color = Color.LightSlateGray, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "22%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(planTask); chart.Processes[i].Tasks.Add(planTask); // Planned: var actualTask = new TaskElement { Start = taskPeriod.Start.AddDays(5), End = taskPeriod.End.AddDays(10), Id = "Actual Task" + i, ProcessId = "Process" + i, Label = "Actual", Color = Color.YellowGreen, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "70%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(actualTask); chart.Processes[i].Tasks.Add(actualTask); } chart.LegendAttr.Show = true; // chart.Legend.Items.Add(new LegendItemElement("Planned", Color.LightSlateGray)); // chart.Legend.Items.Add(new LegendItemElement("Actual", Color.YellowGreen)); chart.Legend.Add(new LegendItemElement("Planned", Color.LightSlateGray)); chart.Legend.Add(new LegendItemElement("Actual", Color.Green)); return chart; }
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; }
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; }
public void MultiTaskedProcess() { var chart = CreateSampleChart("MultiTaskedProcess"); chart.Tasks.ShowLabels = true; // NOTE : Process 별로 다중의 Task가 존재할 때를 테스트한다. // chart.Tasks.TaskElements.Clear(); chart.Tasks.Clear(); for(int i = 0; i < TaskPeriods.Length; i++) { var taskPeriod = TaskPeriods[i]; // Planned: var planTask = new TaskElement { Start = taskPeriod.Start, End = taskPeriod.End, Id = "Planed Task" + i.ToString(), ProcessId = "Process" + i.ToString(), Label = "Planed", Color = Color.BlueViolet, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "22%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(planTask); chart.Processes[i].Tasks.Add(planTask); // Planned: var actualTask = new TaskElement { Start = taskPeriod.Start.AddDays(5), End = taskPeriod.End.AddDays(10), Id = "Actual Task" + i.ToString(), ProcessId = "Process" + i.ToString(), Label = "Actual", Color = Color.YellowGreen, ShowLabel = true, Animation = true, BorderThickness = 1, Height = "25%", TopPadding = "70%" }; // chart.Processes.ProcessElements[i].Tasks.TaskElements.Add(actualTask); chart.Processes[i].Tasks.Add(actualTask); } ValidateChartXml(chart); }
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); }