Jump to content
Software FX Community

gantt chart axis Y problem?


User (Legacy)
 Share

Recommended Posts

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

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...