示例#1
0
        private static IChart MultipleCategories()
        {
            var chart = (GanttChart)CreateSampleChart("Multiple Categories Gantt Chart");

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

            return(chart);
        }
示例#2
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);
        }