|
Using null or blank dates in a Gantt Chart BoxWhiskerLayer? |
Posted by Brent Hetland on Feb-18-2014 04:17 |
|
Hi,
I am using version 5.0.3 of ChartDirector for .NET
I have created a multi-layer Gantt chart similar to the example you have in your help file.
A problem with your example is that you don't create the same number of dates in both
your Planned and Actual date arrays. In your example you create 9 planned dates and 5
actual dates, and then your example forces the assumption that tasks will be completed
in order. But that isn't a real world example, because tasks aren't always completed in
order.
Let's say I have 10 tasks and tasks 1, 3, 5, 7 and 10 have been completed (they have
Actual dates). To correctly draw the chart, I need to have 10 dates in both my planned
and my actual arrays (or the completed task bars don't draw on the correct line).
So my question is: What dates can I use in my Actual Date array, for tasks that aren't
completed. I wanted to make my arrays Nullable (Of Date), but CTime can't use nullable
dates so the following line won't compile:
c.addBoxLayer(ChartDirector.Chart.CTime(completedTaskStartDateArray)
Do you have a constant or something I can use that equates to a null date (or no data
for that data point)???
I had just been using the planned dates, but the problem with that is that I also display a
tooltip on the series for the Actual Dates, and filling in Actual Dates for tasks that haven't
been completed, creates bogus tooltips (you can't visually see where the tooltips are, but
you can see them if you accidentally hover your mouse over them).
Thanks,
Brent |
Re: Using null or blank dates in a Gantt Chart BoxWhiskerLayer? |
Posted by Peter Kwan on Feb-18-2014 17:43 |
|
Hi Brent,
You can use an uninitialized DateTime object to mean a blank date. According to .NET
documentation, an uninitialized DateTime is equivalent to DateTime.MinValue (see
http://msdn.microsoft.com/en-us/library/system.datetime.minvalue(v=vs.110).aspx), so you
can also use DateTime.MinValue to mean a blank date.
Hope this can help.
Regards
Peter Kwan |
Re: Using null or blank dates in a Gantt Chart BoxWhiskerLayer? |
Posted by Brent Hetland on Feb-18-2014 20:15 |
|
Thanks for the reply Peter. I'll try that, but that shouldn't work because that is still a date
(1/1/0001), and I would imagine that the chart will then plot that date on the axis which
means my gantt chart will start at 1/1/0001, and of course then it will span over 2000
years...
I'll update the post when I know more. |
Re: Using null or blank dates in a Gantt Chart BoxWhiskerLayer? |
Posted by Brent Hetland on Feb-18-2014 21:07 |
|
I thought that the chart would have then displayed bars starting at 1/1/0001, but it
doesnt', so using DateTime.MinValue works Peter. It doesn't get plotted, so I no longer
have the undesired tooltips.
Thank you so much! |
|