diff --git a/.vs/GoogleChartsNGraphsControls/v14/.suo b/.vs/GoogleChartsNGraphsControls/v14/.suo new file mode 100644 index 0000000..5f4e68e Binary files /dev/null and b/.vs/GoogleChartsNGraphsControls/v14/.suo differ diff --git a/GoogleChartsNGraphsControls/BaseGVI.cs b/GoogleChartsNGraphsControls/BaseGVI.cs index 311ca2d..8406c3c 100644 --- a/GoogleChartsNGraphsControls/BaseGVI.cs +++ b/GoogleChartsNGraphsControls/BaseGVI.cs @@ -25,7 +25,7 @@ public enum GOOGLECHART WORDCLOUD, SCATTERCHART, TABLEARROW, TABLEBAR, CANDLESTICK, COMBO, HISTOGRAM, DONUT, TREEMAP, TIMELINE, WORDTREE, CALENDAR, ANNOTATION, SANKEY, - + GANTT, CHAP_TIMELINE, CHAP_GRAPH, CHAP_GRAPH3D, CHAP_NETWORK } @@ -39,82 +39,6 @@ public enum GOOGLECHART /// easily debugged or matching that on the Google Vis site /// - private static string jschap = - @" - - /******************************************************************************** - * GoogleVisualizationControls.NET {{ver}} - * http://code.google.com/p/googlevisualizationsdotnet/ - * Visualization: {3} - * Div Element: {0} - *********************************************************************************/ - google.load('visualization', '1'); - google.setOnLoadCallback( draw_{0} ); - var chart_{0} = undefined; - - function draw_{0}() {{ - var container = document.getElementById('{0}'); - var chart = new links.{3}(container); - var arrayD = __DATATABLE__; - var data = new google.visualization.DataTable( arrayD ); - - - /********* Formatter Hooks: your function will be called before render ********/ - chart.formatters = function(chart,data){{ - /*FORMATTERS*/ - }} - /********* View Hooks: DataTables are placed in a View and invoke your functions before going to render ********/ - chart.formatView = function(chart,view){{ - /*VIEW_FUNCTIONS*/ - }} - - /********* Extended Functions **********************/ - chart.reload = function(args, url) - {{ - if (url == undefined || url == null){{ - url = '{QueryString}'; - }} - m_SendAndDraw(container, chart, url, args) - }}; - chart.load = function(data) - {{ - m_JustDraw(container, chart, data); - }}; - chart.format = function(data) - {{ - {formatter} - }}; - - - - /********* User Defined Functions **********************/ - {4} - - - /********* Extended Params **********************/ - chart.opts = {1}; - chart.container = container; - - - - /********* Init Chart Load **********************/ - chart.draw(data, chart.opts); - - - /********* Update These Image Src **********************/ - {SETIMAGEFOR} - - - - - - /********* Save Chart Into DOM / Always Last **********************/ - chart_{0} = chart; - - - -}} -"; private static string jscode3 = @" @@ -125,12 +49,27 @@ public enum GOOGLECHART * Visualization: {3} * Div Element: {0} *********************************************************************************/ + /* google.load('visualization', '1', {{ 'packages': ['{2}'] }}); google.setOnLoadCallback( draw_{0} ); + */ + +/* google.charts.load('current', {{'packages':['{2}']}} ); */ + google.charts.setOnLoadCallback( draw_{0} ); + var chart_{0} = undefined; function draw_{0}() {{ var container = document.getElementById('{0}'); - var chart = new google.visualization.{3}(container); + + var chart = undefined; + if (google.visualization.{3} == undefined) + {{ + chart = new google.visualization.{5}(container); + }} + else + {{ + chart = new google.visualization.{3}(container); + }} var data = __DATATABLE__; @@ -191,71 +130,6 @@ public enum GOOGLECHART "; -// private static string jscode = -// @" -// -// /******************************************************************************** -// * GoogleVisualizationControls for .NET - by Julian King -// * Visualization: {3} -// * Div Element: {0} -// *********************************************************************************/ -// google.load('visualization', '1', {{ 'packages': ['{2}'] }}); -// google.setOnLoadCallback(draw_{0}); -// function draw_{0}() {{ -// var data = new google.visualization.DataTable(chart_{0}); -// var chart = new google.visualization.{3}(document.getElementById('{0}')); -// chart.draw(data, {1}); -// }} -//"; - -// private static string jscode2 = -// @" -// -// /******************************************************************************** -// * GoogleVisualizationControls.NET {{ver}} -// * http://code.google.com/p/googlevisualizationsdotnet/ -// * Visualization: {3} -// * Div Element: {0} -// *********************************************************************************/ -// var chart_{0} = undefined; -// google.load('visualization', '1', {{ 'packages': ['{2}'] }}); -// google.setOnLoadCallback( draw_{0} ); -// var regEvts_{0} = function(chart) {{ -// {4} -// }}; -// function draw_{0}() {{ -// var data = data_{0}(); -// var chart = new google.visualization.{3}(document.getElementById('{0}')); -// regEvts_{0}(chart); -// chart.draw(data, {1}); -// chart_{0} = chart; -// }} -//"; - - - - - -// private static string jscode_orig = -// @" -// -// /******************************************************************************** -// * GoogleVisualizationControls for .NET - by Julian King -// * Visualization: {3} -// * Div Element: {0} -// *********************************************************************************/ -// google.load('visualization', '1', {{ 'packages': ['{2}'] }}); -// google.setOnLoadCallback(draw_{0}); -// var regEvts_{0} = function(chart) {{ -// {4} -// }}; -// function draw_{0}() {{ -// var data = chart_{0}(); -// var chart = new google.visualization.{3}(document.getElementById('{0}')); -// regEvts_{0}(chart); -// chart.draw(data, {1}); -// }} -//"; #endregion private static readonly Dictionary dic = new Dictionary(); @@ -275,7 +149,7 @@ public BaseGVI() dic.Add(GOOGLECHART.MOTIONCHART, new string[] { "motionchart", "MotionChart" }); dic.Add(GOOGLECHART.ORGANIZATIONCHART, new string[] { "orgchart", "OrgChart" }); dic.Add(GOOGLECHART.PIECHART, new string[] { "corechart", "PieChart" }); - //dic.Add(GOOGLECHART.SPARKLINE, new string[] { "imagesparkline", "ImageSparkLine" }); + dic.Add(GOOGLECHART.GANTT, new string[] { "gantt", "gantt" }); dic.Add(GOOGLECHART.SCATTERCHART, new string[] { "corechart", "ScatterChart" }); dic.Add(GOOGLECHART.TABLEARROW, new string[] { "table", "Table" }); dic.Add(GOOGLECHART.TABLEBAR, new string[] { "table", "Table" }); @@ -309,8 +183,8 @@ internal void RegisterGVIScriptsEx(BaseWebControl PageControl, DataTable dt, GOO { string JAVASCRIPT = jscode3; - if (CHARTTYPE == GOOGLECHART.CHAP_TIMELINE) - JAVASCRIPT = jschap; + //if (CHARTTYPE == GOOGLECHART.CHAP_TIMELINE) + // JAVASCRIPT = jschap; string options,formatter = string.Empty; string imagereplace = string.Empty; @@ -357,7 +231,14 @@ internal void RegisterGVIScriptsEx(BaseWebControl PageControl, DataTable dt, GOO ctlid = PageControl.OverrideElementId; // interpolate the options into the canned Javascript - string optionsJscode = string.Format(JAVASCRIPT, ctlid, options, dic[CHARTTYPE].FirstOrDefault(), dic[CHARTTYPE].LastOrDefault(), string.Join("\n",events.ToArray())); + string optionsJscode = string.Format(JAVASCRIPT, + ctlid, + options, + dic[CHARTTYPE].FirstOrDefault(), + dic[CHARTTYPE].LastOrDefault(), + string.Join("\n",events.ToArray()), + dic[CHARTTYPE].FirstOrDefault().UpperCaseFirst() + ); // add version information onto each ChartJavascript string build = string.Format("v{0}.{1}.{2}.{3}", diff --git a/GoogleChartsNGraphsControls/BaseWebControl.cs b/GoogleChartsNGraphsControls/BaseWebControl.cs index 4e9f0c0..e18100a 100644 --- a/GoogleChartsNGraphsControls/BaseWebControl.cs +++ b/GoogleChartsNGraphsControls/BaseWebControl.cs @@ -1114,6 +1114,15 @@ protected override void OnLoad(EventArgs e) if (!this.Page.ClientScript.IsClientScriptIncludeRegistered("REGISTER_GOOGLE_API_JS")) this.Page.ClientScript.RegisterClientScriptInclude("REGISTER_GOOGLE_API_JS", "https://www.google.com/jsapi"); + if (!this.Page.ClientScript.IsClientScriptIncludeRegistered("REGISTER_GOOGLE_LOADER")) + this.Page.ClientScript.RegisterClientScriptInclude("REGISTER_GOOGLE_LOADER", "https://www.gstatic.com/charts/loader.js"); + + if (!this.Page.ClientScript.IsClientScriptBlockRegistered(this.GetType().BaseType, "REGISTER_GOOGLE_PACKAGES")) + { + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType().BaseType, "REGISTER_GOOGLE_PACKAGES", + "google.charts.load('current', {'packages':['corechart','gantt', 'map','annotatedtimeline','gauge','table','timeline','annotationchart', 'calendar','motionchart','orgchart']});", true); + } + if (!this.Page.ClientScript.IsClientScriptBlockRegistered(this.GetType().BaseType, "REGISTER_JX_AJAX")) { this.Page.ClientScript.RegisterClientScriptBlock(this.GetType().BaseType, "REGISTER_JX_AJAX", diff --git a/GoogleChartsNGraphsControls/DataStructs.cs b/GoogleChartsNGraphsControls/DataStructs.cs index e14e582..39915f6 100644 --- a/GoogleChartsNGraphsControls/DataStructs.cs +++ b/GoogleChartsNGraphsControls/DataStructs.cs @@ -247,7 +247,10 @@ public static string LowerCaseFirst(this string str) { return char.ToLower(str[0]) + str.Substring(1); } - + public static string UpperCaseFirst(this string str) + { + return char.ToUpper(str[0]) + str.Substring(1).ToLower(); + } public static string GVINameParse(this string str) { if (str.StartsWith("Gvi", true, System.Globalization.CultureInfo.CurrentCulture)) diff --git a/GoogleChartsNGraphsControls/GVGanttChart.cs b/GoogleChartsNGraphsControls/GVGanttChart.cs index 0ad510f..01a927b 100644 --- a/GoogleChartsNGraphsControls/GVGanttChart.cs +++ b/GoogleChartsNGraphsControls/GVGanttChart.cs @@ -38,14 +38,8 @@ public bool? GviIsStacked protected override void RenderContents(HtmlTextWriter output) { - List tmp = new List(); - tmp.Add(this.GVIBackgroundColor == null ? Color.Transparent : this.GVIBackgroundColor); - if (this.GviColors != null) tmp.AddRange(this.GviColors); - - this.GviIsStacked = true; - this.GviColors = tmp.ToArray(); this.GviTitle = string.IsNullOrEmpty(this.GviTitle) ? this.dt.TableName : this.GviTitle; - this.gvi.RegisterGVIScriptsEx(this, TableWithLeadTime(this.dt), BaseGVI.GOOGLECHART.BARCHART); + this.gvi.RegisterGVIScriptsEx(this, this.dt, BaseGVI.GOOGLECHART.GANTT); output.Write(Text); } // Support for IPostBackEventHandler @@ -85,27 +79,27 @@ protected override void RenderContents(HtmlTextWriter output) * So our Gantt chart now starts to give us some more detailed information. * We’ll also add some data labels so a legend is painted. */ - internal static System.Data.DataTable TableWithLeadTime(System.Data.DataTable dt) - { - if (dt.Columns.Count > 2) throw new Exception("Gantt Charts don't support having more then 2 columns valid ie.['Date',value]"); + //internal static System.Data.DataTable TableWithLeadTime(System.Data.DataTable dt) + //{ + // if (dt.Columns.Count > 2) throw new Exception("Gantt Charts don't support having more then 2 columns valid ie.['Date',value]"); - // test for numeric types only + // // test for numeric types only - System.Data.DataTable dtwithlead = new System.Data.DataTable(); - dtwithlead.Columns.Add(dt.Columns[0].ColumnName, dt.Columns[0].DataType); - dtwithlead.Columns.Add(" ",dt.Columns[1].DataType); - dtwithlead.Columns.Add(dt.Columns[1].ColumnName, dt.Columns[1].DataType); + // System.Data.DataTable dtwithlead = new System.Data.DataTable(); + // dtwithlead.Columns.Add(dt.Columns[0].ColumnName, dt.Columns[0].DataType); + // dtwithlead.Columns.Add(" ",dt.Columns[1].DataType); + // dtwithlead.Columns.Add(dt.Columns[1].ColumnName, dt.Columns[1].DataType); - int leading = 0; - foreach(System.Data.DataRow dr in dt.Rows) - { - object[] tmp = new object[]{dr[0],leading,dr[1]}; - leading += int.Parse(dr[1].ToString()); - dtwithlead.Rows.Add(tmp); - } + // int leading = 0; + // foreach(System.Data.DataRow dr in dt.Rows) + // { + // object[] tmp = new object[]{dr[0],leading,dr[1]}; + // leading += int.Parse(dr[1].ToString()); + // dtwithlead.Rows.Add(tmp); + // } - return dtwithlead; - } + // return dtwithlead; + //} public override string ToString() { diff --git a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.dll b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.dll index c850365..8fcea89 100644 Binary files a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.dll and b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.dll differ diff --git a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.pdb b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.pdb index 981d550..aef89ed 100644 Binary files a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.pdb and b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.pdb differ diff --git a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.tlb b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.tlb index 1399345..8caafe7 100644 Binary files a/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.tlb and b/GoogleChartsNGraphsControls/bin/Debug/GoogleChartsNGraphsControls.tlb differ diff --git a/GoogleChartsNGraphsControls/bin/Debug/Visualization.dll b/GoogleChartsNGraphsControls/bin/Debug/Visualization.dll index e0c3455..bce5e42 100644 Binary files a/GoogleChartsNGraphsControls/bin/Debug/Visualization.dll and b/GoogleChartsNGraphsControls/bin/Debug/Visualization.dll differ diff --git a/GoogleChartsNGraphsControls/bin/Debug/Visualization.pdb b/GoogleChartsNGraphsControls/bin/Debug/Visualization.pdb index 39b3ba2..9eba740 100644 Binary files a/GoogleChartsNGraphsControls/bin/Debug/Visualization.pdb and b/GoogleChartsNGraphsControls/bin/Debug/Visualization.pdb differ diff --git a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csproj.FileListAbsolute.txt b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csproj.FileListAbsolute.txt index d9b0f58..3a90f5c 100644 --- a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csproj.FileListAbsolute.txt +++ b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csproj.FileListAbsolute.txt @@ -9,3 +9,14 @@ C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.csproj.GenerateResource.Cache C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.dll C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\GoogleChartsNGraphsControls.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\GoogleChartsNGraphsControls.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\GoogleChartsNGraphsControls.tlb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\Newtonsoft.Json.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\Visualization.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\bin\Debug\Visualization.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.csprojResolveAssemblyReference.cache +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.Resource1.resources +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.csproj.GenerateResource.Cache +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\GoogleChartsNGraphsControls\obj\Debug\GoogleChartsNGraphsControls.pdb diff --git a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csprojResolveAssemblyReference.cache b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csprojResolveAssemblyReference.cache index fe3db6c..dfe6cfb 100644 Binary files a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csprojResolveAssemblyReference.cache and b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.csprojResolveAssemblyReference.cache differ diff --git a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.dll b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.dll index c850365..8fcea89 100644 Binary files a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.dll and b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.dll differ diff --git a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.pdb b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.pdb index 981d550..aef89ed 100644 Binary files a/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.pdb and b/GoogleChartsNGraphsControls/obj/Debug/GoogleChartsNGraphsControls.pdb differ diff --git a/GoogleChartsNGraphsControls/obj/GoogleChartsNGraphsControls.csproj.UnmanagedRegistration.cache b/GoogleChartsNGraphsControls/obj/GoogleChartsNGraphsControls.csproj.UnmanagedRegistration.cache index be056a4..9f48b02 100644 Binary files a/GoogleChartsNGraphsControls/obj/GoogleChartsNGraphsControls.csproj.UnmanagedRegistration.cache and b/GoogleChartsNGraphsControls/obj/GoogleChartsNGraphsControls.csproj.UnmanagedRegistration.cache differ diff --git a/TestGoogleCharsNGraphsControls/Default.aspx b/TestGoogleCharsNGraphsControls/Default.aspx index 66bbfa5..b7a1812 100644 --- a/TestGoogleCharsNGraphsControls/Default.aspx +++ b/TestGoogleCharsNGraphsControls/Default.aspx @@ -251,7 +251,45 @@ this.GVPieChart2.ChartData(dt); +

+

Gantt Example

+ + +
+            Sample Code:
+
+             DataTable dt = new DataTable("Gantt");
+
+             // specical datatype for the 2nd and 3rd Date columns required for this chart
+            DataColumn startDate = new DataColumn("Start Date", typeof(DateTime));
+            startDate.ExtendedProperties.Add("GoogleDateType", Bortosky.Google.Visualization.GoogleDateType.Date);
+            DataColumn endDate = new DataColumn("End Date", typeof(DateTime));
+            endDate.ExtendedProperties.Add("GoogleDateType", Bortosky.Google.Visualization.GoogleDateType.Date);
+
+            dt.Columns.AddRange(new DataColumn[] {
+                new DataColumn("Task ID"),
+                new DataColumn("Task Name"),
+                startDate,
+                endDate,
+                new DataColumn("Duration", typeof(double)) { AllowDBNull = true },
+                new DataColumn("Percent Complete",typeof(int)) { AllowDBNull = true },
+                new DataColumn("Dependencies") { AllowDBNull = true }
+            });
+
+            dt.Rows.Add(new object[] {"Research", "Find Sources", new DateTime(2015, 1,1), new DateTime(2015, 1, 5), null, 100, null });
+            dt.Rows.Add(new object[] { "Write", "Write Paper", null, new DateTime(2015, 1, 9), 3 * 24 * 60 * 60 * 1000, 25, "Research,Outline" });
+            dt.Rows.Add(new object[] { "Cite", "Create bibliography", null, new DateTime(2015, 1, 7), 1 * 24 * 60 * 60 * 1000, 20, "Research" });
+            dt.Rows.Add(new object[] { "Complete", "Hand in Paper", null, new DateTime(2015, 1, 10), 1 * 24 * 60 * 60 * 1000, 0, "Cite,Write" });
+            dt.Rows.Add(new object[] { "Outline", "Outline Paper", null, new DateTime(2015, 1, 6), 1 * 24 * 60 * 60 * 1000, 100, "Research" });
+
+
+
+            this.GVGanttChart1.DataSource = dt;
+            this.GVGanttChart1.DataBind();
+        
+ +

diff --git a/TestGoogleCharsNGraphsControls/Default.aspx.cs b/TestGoogleCharsNGraphsControls/Default.aspx.cs index 0546fea..b5ceb41 100644 --- a/TestGoogleCharsNGraphsControls/Default.aspx.cs +++ b/TestGoogleCharsNGraphsControls/Default.aspx.cs @@ -80,6 +80,7 @@ protected void Page_Init() chart_calendar(); chart_annotation(); chart_Roles(); + chart_gantt(); // Map Test this.GVMap2.ChartData("Duvall, WA", "Home Sweet Home"); @@ -587,6 +588,37 @@ private void chart_calendar() } + private void chart_gantt() + { + DataTable dt = new DataTable("Gantt"); + + DataColumn startDate = new DataColumn("Start Date", typeof(DateTime)); + startDate.ExtendedProperties.Add("GoogleDateType", Bortosky.Google.Visualization.GoogleDateType.Date); + DataColumn endDate = new DataColumn("End Date", typeof(DateTime)); + endDate.ExtendedProperties.Add("GoogleDateType", Bortosky.Google.Visualization.GoogleDateType.Date); + + dt.Columns.AddRange(new DataColumn[] { + new DataColumn("Task ID"), + new DataColumn("Task Name"), + startDate, + endDate, + new DataColumn("Duration", typeof(double)) { AllowDBNull = true }, + new DataColumn("Percent Complete",typeof(int)) { AllowDBNull = true }, + new DataColumn("Dependencies") { AllowDBNull = true } + }); + + dt.Rows.Add(new object[] {"Research", "Find Sources", new DateTime(2015, 1,1), new DateTime(2015, 1, 5), null, 100, null }); + dt.Rows.Add(new object[] { "Write", "Write Paper", null, new DateTime(2015, 1, 9), 3 * 24 * 60 * 60 * 1000, 25, "Research,Outline" }); + dt.Rows.Add(new object[] { "Cite", "Create bibliography", null, new DateTime(2015, 1, 7), 1 * 24 * 60 * 60 * 1000, 20, "Research" }); + dt.Rows.Add(new object[] { "Complete", "Hand in Paper", null, new DateTime(2015, 1, 10), 1 * 24 * 60 * 60 * 1000, 0, "Cite,Write" }); + dt.Rows.Add(new object[] { "Outline", "Outline Paper", null, new DateTime(2015, 1, 6), 1 * 24 * 60 * 60 * 1000, 100, "Research" }); + + + + this.GVGanttChart1.DataSource = dt; + this.GVGanttChart1.DataBind(); + + } private void chart_timeline() { diff --git a/TestGoogleCharsNGraphsControls/Default.aspx.designer.cs b/TestGoogleCharsNGraphsControls/Default.aspx.designer.cs index 665df93..020d934 100644 --- a/TestGoogleCharsNGraphsControls/Default.aspx.designer.cs +++ b/TestGoogleCharsNGraphsControls/Default.aspx.designer.cs @@ -120,6 +120,15 @@ public partial class WebForm1 { /// protected global::GoogleChartsNGraphsControls.GVPieChart GVPieChart2; + ///

+ /// GVGanttChart1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GoogleChartsNGraphsControls.GVGanttChart GVGanttChart1; + /// /// GVAreaChart2 control. /// diff --git a/TestGoogleCharsNGraphsControls/TestGoogleCharsNGraphsControls.csproj.user b/TestGoogleCharsNGraphsControls/TestGoogleCharsNGraphsControls.csproj.user index a84ba58..490ad55 100644 --- a/TestGoogleCharsNGraphsControls/TestGoogleCharsNGraphsControls.csproj.user +++ b/TestGoogleCharsNGraphsControls/TestGoogleCharsNGraphsControls.csproj.user @@ -7,7 +7,7 @@ - ComboWatermarks.aspx + Default.aspx SpecificPage True False diff --git a/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.dll b/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.dll index c850365..8fcea89 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.dll and b/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.dll differ diff --git a/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.pdb b/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.pdb index 981d550..aef89ed 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.pdb and b/TestGoogleCharsNGraphsControls/bin/GoogleChartsNGraphsControls.pdb differ diff --git a/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.dll b/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.dll index 858df3c..a1fc772 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.dll and b/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.dll differ diff --git a/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.pdb b/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.pdb index 4bca3fe..30513e9 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.pdb and b/TestGoogleCharsNGraphsControls/bin/TestGoogleCharsNGraphsControls.pdb differ diff --git a/TestGoogleCharsNGraphsControls/bin/Visualization.dll b/TestGoogleCharsNGraphsControls/bin/Visualization.dll index e0c3455..bce5e42 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/Visualization.dll and b/TestGoogleCharsNGraphsControls/bin/Visualization.dll differ diff --git a/TestGoogleCharsNGraphsControls/bin/Visualization.pdb b/TestGoogleCharsNGraphsControls/bin/Visualization.pdb index 39b3ba2..9eba740 100644 Binary files a/TestGoogleCharsNGraphsControls/bin/Visualization.pdb and b/TestGoogleCharsNGraphsControls/bin/Visualization.pdb differ diff --git a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csproj.FileListAbsolute.txt b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csproj.FileListAbsolute.txt index 3ac099d..940145b 100644 --- a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csproj.FileListAbsolute.txt +++ b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csproj.FileListAbsolute.txt @@ -9,3 +9,14 @@ C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.dll C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\TestGoogleCharsNGraphsControls.dll.config +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\TestGoogleCharsNGraphsControls.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\TestGoogleCharsNGraphsControls.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\GoogleChartsNGraphsControls.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\Visualization.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\Newtonsoft.Json.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\GoogleChartsNGraphsControls.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\bin\Visualization.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\TestGoogleCharsNGraphsControls\obj\Debug\TestGoogleCharsNGraphsControls.pdb diff --git a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache index c00fed7..fe07a44 100644 Binary files a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache and b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.csprojResolveAssemblyReference.cache differ diff --git a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.dll b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.dll index 858df3c..a1fc772 100644 Binary files a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.dll and b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.dll differ diff --git a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.pdb b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.pdb index 4bca3fe..30513e9 100644 Binary files a/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.pdb and b/TestGoogleCharsNGraphsControls/obj/Debug/TestGoogleCharsNGraphsControls.pdb differ diff --git a/bortosky-google-visualization/src/Columns/DateGoogleDataColumn.cs b/bortosky-google-visualization/src/Columns/DateGoogleDataColumn.cs index 8154905..30cbda7 100644 --- a/bortosky-google-visualization/src/Columns/DateGoogleDataColumn.cs +++ b/bortosky-google-visualization/src/Columns/DateGoogleDataColumn.cs @@ -29,10 +29,16 @@ internal DateGoogleDataColumn(DataColumn column): base(column){ /// /// protected internal override string SerializedValue(DataRow row){ - System.DateTime d = (System.DateTime)row[subjectColumn]; - if (d == DateTime.MinValue) + try + { + System.DateTime d = (System.DateTime)row[subjectColumn]; + if (d == DateTime.MinValue) + return "undefined"; + return string.Format("new Date({0}, {1}, {2})", d.Year, d.Month - 1, d.Day); + } catch(Exception ex) + { return "undefined"; - return string.Format("new Date({0}, {1}, {2})", d.Year, d.Month - 1, d.Day); + } } protected internal override string GoogleDataType{ diff --git a/bortosky-google-visualization/src/Columns/DateTimeGoogleDataColumn.cs b/bortosky-google-visualization/src/Columns/DateTimeGoogleDataColumn.cs index 5fb1a9d..4b918ae 100644 --- a/bortosky-google-visualization/src/Columns/DateTimeGoogleDataColumn.cs +++ b/bortosky-google-visualization/src/Columns/DateTimeGoogleDataColumn.cs @@ -29,10 +29,17 @@ internal DateTimeGoogleDataColumn(DataColumn column): base(column){ /// /// protected internal override string SerializedValue(DataRow row){ - DateTime d = (DateTime)row[subjectColumn]; - if (d == DateTime.MinValue) + try + { + DateTime d = (DateTime)row[subjectColumn]; + if (d == DateTime.MinValue) + return "null"; + return string.Format("new Date({0}, {1}, {2}, {3}, {4}, {5})", d.Year, d.Month - 1, d.Day, d.Hour, d.Minute, d.Second); + } + catch(Exception ex) + { return "null"; - return string.Format("new Date({0}, {1}, {2}, {3}, {4}, {5})", d.Year, d.Month - 1, d.Day, d.Hour, d.Minute, d.Second); + } } protected internal override string GoogleDataType{ diff --git a/bortosky-google-visualization/src/bin/Debug/Visualization.dll b/bortosky-google-visualization/src/bin/Debug/Visualization.dll index e0c3455..bce5e42 100644 Binary files a/bortosky-google-visualization/src/bin/Debug/Visualization.dll and b/bortosky-google-visualization/src/bin/Debug/Visualization.dll differ diff --git a/bortosky-google-visualization/src/bin/Debug/Visualization.pdb b/bortosky-google-visualization/src/bin/Debug/Visualization.pdb index 39b3ba2..9eba740 100644 Binary files a/bortosky-google-visualization/src/bin/Debug/Visualization.pdb and b/bortosky-google-visualization/src/bin/Debug/Visualization.pdb differ diff --git a/bortosky-google-visualization/src/obj/Debug/Visualization.csproj.FileListAbsolute.txt b/bortosky-google-visualization/src/obj/Debug/Visualization.csproj.FileListAbsolute.txt index c47d747..6d9f642 100644 --- a/bortosky-google-visualization/src/obj/Debug/Visualization.csproj.FileListAbsolute.txt +++ b/bortosky-google-visualization/src/obj/Debug/Visualization.csproj.FileListAbsolute.txt @@ -7,3 +7,8 @@ C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\bortosky-google-visualization\src\bin\Debug\Visualization.pdb C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\bortosky-google-visualization\src\obj\Debug\Visualization.dll C:\Users\kingj5\Documents\Visual Studio 2010\Projects\googlevisualizationsdotnet\bortosky-google-visualization\src\obj\Debug\Visualization.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\bortosky-google-visualization\src\bin\Debug\Visualization.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\bortosky-google-visualization\src\bin\Debug\Visualization.pdb +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\bortosky-google-visualization\src\obj\Debug\Visualization.csprojResolveAssemblyReference.cache +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\bortosky-google-visualization\src\obj\Debug\Visualization.dll +C:\Users\kingj5\Documents\GitHub\googlevisualizationsdotnet\bortosky-google-visualization\src\obj\Debug\Visualization.pdb diff --git a/bortosky-google-visualization/src/obj/Debug/Visualization.csprojResolveAssemblyReference.cache b/bortosky-google-visualization/src/obj/Debug/Visualization.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..7fc657e Binary files /dev/null and b/bortosky-google-visualization/src/obj/Debug/Visualization.csprojResolveAssemblyReference.cache differ diff --git a/bortosky-google-visualization/src/obj/Debug/Visualization.dll b/bortosky-google-visualization/src/obj/Debug/Visualization.dll index e0c3455..bce5e42 100644 Binary files a/bortosky-google-visualization/src/obj/Debug/Visualization.dll and b/bortosky-google-visualization/src/obj/Debug/Visualization.dll differ diff --git a/bortosky-google-visualization/src/obj/Debug/Visualization.pdb b/bortosky-google-visualization/src/obj/Debug/Visualization.pdb index 39b3ba2..9eba740 100644 Binary files a/bortosky-google-visualization/src/obj/Debug/Visualization.pdb and b/bortosky-google-visualization/src/obj/Debug/Visualization.pdb differ