Creating Gantt Charts using the.net Chart Control



Similar documents
System Requirements for Microsoft Dynamics NAV 2013 R2

Integrating an ASP.NET MVC Web Application in Sitecore CMS

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Question 1a of 14 ( 2 Identifying the roots of a polynomial and their importance )

HSLAB Print Logger 5 Installation Guide

Measurement Studio. Contents RELEASE NOTES

Connectivity Pack for Microsoft Guide

Project Server hardware and software requirements

COMMON All Day Lab 10/16/2007 Hands on VB.net and ASP.Net for iseries Developers

SQL Server 2005 Reporting Services (SSRS)

SharePoint Development for.net Developers

Synchronizing databases

FrontDesk. (Server Software Installation) Ver

SAML v1.1 for.net Developer Guide

Click Studios. Passwordstate. Upgrade Instructions to V7 from V5.xx

SalesPad for Dynamics GP DataCollection Installation & Setup

System Requirements for Microsoft Dynamics NAV 2015

Introduction Course in SPSS - Evening 1

Market Pricing Override

R i o L i n x s u p p o r r i o l i n x. c o m 1 / 3 0 /

Aspose.Cells Product Family

WorkEngine Pre-Deployment Checklist

Making SharePoint Work with Workflow. Robert L. Bogue 3 Part Presentation Series

Notes on how to migrate wikis from SharePoint 2007 to SharePoint 2010

WEB COMPAS MINIMUM HOSTING REQUIREMENTS

TS: Microsoft.NET Framework 3.5, ASP.NET Application Development

System Requirements for Microsoft Dynamics NAV 2016

ReportPortal Web Reporting for Microsoft SQL Server Analysis Services

Microsoft Dynamics NAV

Single sign-on for ASP.Net and SharePoint

System Requirements for Microsoft Dynamics NAV 2016

Install Guide - Hosted

TIBCO Spotfire Business Author Essentials Quick Reference Guide. Table of contents:

LICENSE4J FLOATING LICENSE SERVER USER GUIDE

9/26/2013. Installer.ps1 will validate all settings before deployment. Define your deployment. Define your deployment Run PDT Downloader

Web Services. with Examples. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Online Vulnerability Scanner Quick Start Guide

BUILDER 3.0 Installation Guide with Microsoft SQL Server 2005 Express Edition January 2008

System Requirements for Microsoft Dynamics NAV 2016

Authoring for System Center 2012 Operations Manager

FocusOPEN Deployment & Configuration Guide

VB.NET - WEB PROGRAMMING

Welcome. Gáspár Nagy.

Prerequisites Guide. Version 4.0, Rev. 1

Continuous Integration with CruiseControl.Net

Document Management System 5.6A User Guide

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

SAP Predictive Analysis Installation

MSSQL quick start guide

Installing the ASP.NET VETtrak APIs onto IIS 5 or 6

Contents. TSM Remote Server Installation guide

domke consulting edv-beratung it-consulting ms office add-ins databases dms

Adding 3rd-Party Visualizations to OBIEE Kevin McGinley

Richmond Web Services Installation Guide Web Reporting Version 10.0

See requirements for Microsoft SQL Server 2000 or Microsoft SQL Server 2005

Session 15 OF, Unpacking the Actuary's Technical Toolkit. Moderator: Albert Jeffrey Moore, ASA, MAAA

BlackBerry Enterprise Server Resource Kit

SQL Reporting Services: A Peek at the Power & Potential

Charts for SharePoint

SAS BI Dashboard 4.4. User's Guide Second Edition. SAS Documentation

INSTRUCTION MANUAL AND REFERENCE FOR IT DEPARTMENTS

Analytics Configuration Reference

This document is provided to you by ABC E BUSINESS, Microsoft Dynamics Preferred partner. System Requirements NAV 2016

Microsoft Dynamics CRM 2011 Guide to features and requirements

Platform support for UNIT4 Milestone 4

Exercise 10: Basic LabVIEW Programming

UniFinger Engine SDK Manual (sample) Version 3.0.0

Iron Speed Designer Installation Guide

FMCS SINGLE SIGN ON Overview and Installation Guide. November SSO-MNL-v3.0

Creating the AM.NET IIS Web folders

c360 Portal Installation Guide

Pro-Watch Software Suite Installation Guide Honeywell Release 4.1

Administrator s Guide Version Released June 18, 2009

Presented by Sam Gill Innovative Solutions Inc.

Implementation of Process Control and Monitoring Software with Dynamic Compilation in.net Technology

What s New: Crystal Reports for Visual Studio 2005

Codeless Server IIS Installation

SimWebLink.NET Remote Control and Monitoring in the Simulink

Virto SharePoint Project Management Template Release User and Installation Guide

Manage Office. A SharePoint solution. Executive Summary. About our Client. Business Situation

Click Studios. Passwordstate. Installation Instructions

Using SPSS, Chapter 2: Descriptive Statistics

1 (11) Paperiton DMS Document Management System System Requirements Release: 2012/

TIME KEEP LEGAL BILLING SOFTWARE DESIGN DOCUMENT. Mike Don Cheng-Yu. CS 524 Software Engineer Professor: Dr Liang

Web VTS Installation Guide. Copyright SiiTech Inc. All rights reserved.

Microsoft SharePoint 2010 End User Quick Reference Card

Creating While Loops with Microsoft SharePoint Designer Workflows Using Stateful Workflows

Installation Guide. Genesis Edition for SharePoint AgilePoint BPMS v5.0 R2 SP1 Genesis for SharePoint 2010

MultiAlign Software. Windows GUI. Console Application. MultiAlign Software Website. Test Data

Proof of Concept. A New Data Validation Technique for Microsoft ASP.NET Web Applications. Foundstone Professional Services

InformationNOW Upgrading to Microsoft SQL Server 2008

metaengine DataConnect For SharePoint 2007 Configuration Guide

THUM - Temperature Humidity USB Monitor

Installation for WEB Server Windows 2003

Snow Inventory Data Processor

Census. di Monitoring Installation User s Guide

SelectSurvey.NET Developers Manual

Installation & User Guide

Quick Start Guide. Managing the Service. Converting Files and Folders

Transcription:

Creating Gantt Charts using the.net Chart Control Gantt charts (that is charts which graphically display tasks by start and end dates) are one of the more challenging type of charts to create. Using the.net Chart control however makes it a fairly easy task. This sample shows how to use the.net Chart control, using a VWG compatible wrapper for the control and printing charts using the itextsharp PDF open source libraries and a download Gateway. Some background for the.net Chart control, this is taken from Alex Gorev's Web blog: "So I will start with a little bit of history... Dundas is one of the leaders in data visualization, who provides well known Chart, Gauge, Map and other visual controls for different Microsoft development platforms (ASP.NET, Windows Forms, SQL Reporting Services and SharePoint). Microsoft acquired Dundas Data Visualization Intellectual Property in April 2007 and is integrating this technology in different Microsoft products. New Chart and Gauge report items were already released as part of SQL Reporting Services 2008. We also announced the new Map report item which will be available in the next release of SSRS.Microsoft Chart controls (ASP.NET and Windows Forms), released at PDC 2008, also based on the source code acquired from Dundas! Microsoft Chart control is available as a separate installation for.net Framework 3.5 SP1 and will be part of.net Framework 4.0." This blog can be found at: http://blogs.msdn.com/b/alexgor/archive/2008/11/07/microsoft-chartcontrol-vs-dundas-chart-control.aspx Also see: http://code.msdn.microsoft.com/mschart So, requirements are either.net Framework 3.5 SP1 OR.Net Framework 4.0. This simple project was built as: 1) A Winforms example (GanttExampleWin.zip) using VS C# 2010 with a Windows application as the output type. 2) A VisualWeb GUI example (GanttExampleVwg.zip) using VS C#2010 with a class library (GanttExampleVWG.dll) as the output type. This dll should be included in the bin folder of the web library. 3) A Web site (GanttExampleWeb.zip) using VS Web Developer 2010, containing a default.aspx page, a bin folder, a Reports folder and the web.config file.

For the VWG version, Lufe provided me with a VB.net wrapper for the MsChart control and I converted it into C#. Thanks Lufe, that was very much appreciated. To run the application on the web, add the following to the applications section of the web.config: <Applications> <Application Code="GanttChart" Type="GanttExample.GanttChart, GanttExampleVWG"/> </Applications> To use the.net Chart control, you also need to add an httphandler: <httphandlers>... <add verb="get,head" path="chartimg.axd" type="system.web.ui.datavisualization.charting.charthttphandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>... </httphandlers> To print the chart control, I use the itextsharp open source libraries (version 5 or above) to create PDF documents on the fly. To print the chart area, we save the chart as a png image in the reports folder, and then use the itextsharp functions to get an instance of the image and include it in the document. Include the itextsharp.dll in the bin directories of the web site and in the VWG C# project include a reference to it. You will need to have a folder named Reports in the root directory of the web site. The example was built using VWG Release 6.4. The example in the web.config is using.ashx instead of.wgx for the VWG application. Any questions or feedback, I can be reached at kenn@kennware.com

The basics Each task, start date and end date will be saved as a datapoint series of their own. We create a List of the series type as "private List<Series> serieslist = new List<Series>();". For each task, we want to store the x-ordinal of the task (so tasks or resource with the same name will be laid out side-by-side) and two date values for the y-ordinal. Datapoint values in the series are of the type "double" so we will convert the values to: string xlabel = string.empty; double xordinal = 0; double yplot1 = 0; double yplot2 = 0;

Now we loop through all the tasks (or resources) we want to plot. For each task/resource: xlabel = is the name of the task or resource to show as the label xordinal = an ordinal for the x-axis, as an example, different tasks for the same resource would have the same xordinal when displaying a resource gantt chart yplot1 = the start date. yplot2 = the end date. // To cast a date as a double, use the Office Automation date (ToOADate) function, you cannot directly cast a datetime value to a double (Note: Office Automation Dates have different min and max values than a datetime value) yplot1 = (double)fromtime.tooadate(); yplot2 = (double)totime.tooadate(); // Use a different series for each datapoint Series seriesinstance = new Series(); // For Gantt charts, we want a RangeBar graph type seriesinstance.charttype = SeriesChartType.RangeBar; // Have a start and end date so plotting 2 points on the y-axis seriesinstance.yvaluesperpoint = 2; // We want to draw datapoint side by side (night is day?) seriesinstance.customproperties = "DrawSideBySide=false"; // Add the datapoint to the series, specifying tooltiptext, color and label xordinal = (double)itemindex; seriesinstance.points.addxy(xordinal, yplot1, yplot2); seriesinstance.points[0].tooltip = sometiptext; seriesinstance.points[0].color = resourcecolor; seriesinstance.points[0].axislabel = xlabel; serieslist.add(seriesinstance); Loop again until all tasks/resources have been added to the serieslist.

Now that all the datapoints have been collected, add them to the chart and update it. // Add all the series to the chart foreach (Series plotseries in serieslist) { } chart1.series.add(plotseries); // Force x-axis to show each task or resource chart1.chartareas[0].axisx.interval = 1; // Set y-axis to show each day of the month chart1.chartareas[0].axisy.interval = 1; // Set x-axis to show in reversed order so dates are displayed leftto-right chartarea1.axisx.isreversed = true; // Set other y-axis properties chartarea1.axisy.isstartedfromzero = false; chartarea1.axisy.ismarginvisible = false; chartarea1.axisy.isstartedfromzero = false; chartarea1.axisy.intervaltype = DateTimeIntervalType.Days; // Set the y-axis labels chart1.chartareas[0].axisy.minimum = firstdate.adddays(-1).tooadate(); chart1.chartareas[0].axisy.maximum = lastdate.adddays(+1).tooadate(); //chart1.chartareas[0].axisy.labelstyle.format = "MMM dd ddd"; //chart1.chartareas[0].axisy.labelstyle.format = "ddd MMM dd"; chart1.chartareas[0].axisy.labelstyle.format = "ddd M/d"; // Force redraw of chart chart1.update();

Sample output from the project (showing by task) Sample output from the project (showing by resource)