| |||||
Introducing SharpPlot Your First Chart Recent Updates Tutorials General Tutorials Chart Tutorials Reference SharpPlot Class Properties Methods Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Home > Sample Charts > GanttChart GanttChartGantt charts were originally devised as a graphical way to show the relationship between activites in a project plan, and have been made very popular by tools such as MS Project. The chart shows time progressing from left to right, with each activity drawn as a colored bar, and generally labelled with its name. The Y-axis shows some higher-level grouping of related tasks. This style of chart also works very well as a way to show a production schedule (machines are shown on the Y-axis) or to record the output from any kind of logging system. SharpPlot sp = new SharpPlot; sp.SetMargins(6,12,36,4); sp.SetColors(new Color[]{Color.OrangeRed,Color.ForestGreen}); sp.SetYLabels(new string[]{"Cut","Polish","Pack"}); sp.SetXTickMarks(5); sp.SetYTickMarks(new double[] {0.5,1.5,2.5,3.5}); process = new int[] {1,1,2,2,2,3,3}; start = new int[] {24,28,25,29,35,29,42}; end = new int[] {28,32,29,33,40,30,44}; done = new bool[]{true,false,true,false,false,true,false}; sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.MiddleLabels|YAxisStyles.GridLines; sp.KeyStyle = KeyStyles.NoKey; sp.SplitBy(done); sp.DrawGanttChart(process,start,end); Worked Examples |