User (Legacy) Posted September 4, 2003 Report Share Posted September 4, 2003 I am testing ChartFX for my company and have a slight problem. I am pulling data using ADO.NET and the table returned has three fields. 1. Person's name 2. Start Date 3. End Date (or today if null) When I run the code, I get the data, but the dates on the axis Y shows three values: 12/30/1899, 1/30/1937, 2/28/1974... All of my bars are squished to the right side. There are no null values being returned. I thought that the range would be determined from the range of values in the dataset. Since I am using dates and not doubles, is there some code I am missing? Here is what I have so far... Dim lo_dt_Data As DataTable lo_dt_Data = Get_Data() Chart1.Gallery = Gallery.Gantt Chart1.DataType(0) = DataType.Label Chart1.DataType(1) = DataType.IniValue Chart1.DataType(2) = DataType.Value Chart1.DataSource = lo_dt_Data Chart1.AxisY.LabelsFormat.Format = AxisFormat.Date Please help. This is just a simple experiment before I delve into some more complicated gantts. Thanks! Gavin Donoho Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 4, 2003 Author Report Share Posted September 4, 2003 Never mind. I figured out by doing some more research... "Gavin Donoho" <gavin.donoho@teamise.com> wrote in message news:6iY0lVxcDHA.916@WEBSERVER1... > I am testing ChartFX for my company and have a slight problem. I am pulling > data using ADO.NET and the table returned has three fields. > > 1. Person's name > 2. Start Date > 3. End Date (or today if null) > > When I run the code, I get the data, but the dates on the axis Y shows three > values: 12/30/1899, 1/30/1937, 2/28/1974... > > All of my bars are squished to the right side. There are no null values > being returned. I thought that the range would be determined from the range > of values in the dataset. Since I am using dates and not doubles, is there > some code I am missing? Here is what I have so far... > Dim lo_dt_Data As DataTable > > lo_dt_Data = Get_Data() > > Chart1.Gallery = Gallery.Gantt > > Chart1.DataType(0) = DataType.Label > > Chart1.DataType(1) = DataType.IniValue > > Chart1.DataType(2) = DataType.Value > > Chart1.DataSource = lo_dt_Data > > Chart1.AxisY.LabelsFormat.Format = AxisFormat.Date > > Please help. This is just a simple experiment before I delve into some more > complicated gantts. Thanks! > > Gavin Donoho > > > Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 8, 2003 Author Report Share Posted September 8, 2003 Add these lines to the code prior to binding the data. I use AddMonths to pad the edges of my chart. Chart1.AxisY.Min = CType(lo_dt_Data.Rows(0).Item("FROMDT"), Date).AddMonths(-1).ToOADate Chart1.AxisY.Max = CType(DateTime.Now.AddMonths(3), Date).ToOADate "Gavin Donoho" <gavin.donoho@teamise.com> wrote in message news:6iY0lVxcDHA.916@WEBSERVER1... > I am testing ChartFX for my company and have a slight problem. I am pulling > data using ADO.NET and the table returned has three fields. > > 1. Person's name > 2. Start Date > 3. End Date (or today if null) > > When I run the code, I get the data, but the dates on the axis Y shows three > values: 12/30/1899, 1/30/1937, 2/28/1974... > > All of my bars are squished to the right side. There are no null values > being returned. I thought that the range would be determined from the range > of values in the dataset. Since I am using dates and not doubles, is there > some code I am missing? Here is what I have so far... > Dim lo_dt_Data As DataTable > > lo_dt_Data = Get_Data() > > Chart1.Gallery = Gallery.Gantt > > Chart1.DataType(0) = DataType.Label > > Chart1.DataType(1) = DataType.IniValue > > Chart1.DataType(2) = DataType.Value > > Chart1.DataSource = lo_dt_Data > > Chart1.AxisY.LabelsFormat.Format = AxisFormat.Date > > Please help. This is just a simple experiment before I delve into some more > complicated gantts. Thanks! > > Gavin Donoho > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.