Sign in to follow this  
scorbett

Gantt Chart: Tasks Whose Start/end Dates Fall Outside The Range Of The Chart Cause Serious Date Parsing Problems

Recommended Posts

This is fairly easy to reproduce and is causing us some concern as we evaluate FusionWidgets. Consider the following chart xml, which has been simplified for demonstration purposes:

 

<chart palette='2' dateFormat='yyyy/mm/dd' caption='Gantt chart problem demo' subCaption='How important are accurate dates, anyway?'>
  <categories>
 	<category start='2011/01/01' end='2011/01/31' label='Jan' />
 	<category start='2011/02/01' end='2011/02/28' label='Feb' />
 	<category start='2011/03/01' end='2011/03/31' label='Mar' />
 	<category start='2011/04/01' end='2011/04/30' label='Apr' />
 	<category start='2011/05/01' end='2011/05/31' label='May' />
 	<category start='2011/06/01' end='2011/06/30' label='Jun' />
 	<category start='2011/07/01' end='2011/07/31' label='Jun' />  	
 	<category start='2011/08/01' end='2011/08/31' label='Aug' />
 	<category start='2011/09/01' end='2011/09/30' label='Sep' />
 	<category start='2011/10/01' end='2011/10/31' label='Oct' />
 	<category start='2011/11/01' end='2011/11/30' label='Nov' />
 	<category start='2011/12/01' end='2011/12/31' label='Dec' />
  </categories>
  <processes fontSize='11' isBold='1' align='right'>
<process label='Alligators' id='Alligators' />
<process label='Crocodiles' id='Crocodiles' />
<process label='Monkeys' id='Monkeys' />
<process label='Bears' id='Bears' />
  </processes>
  <tasks showLabels='1' showEndDate='0'>
<!--
<task processId='Alligators' color='999999' 
   	start='2010/11/03' end='2011/01/17' label='Foraging' 
   	height='25%' topPadding='25%' />
-->
<task processId='Alligators' color='559F58' 
   	start='2011/11/03' end='2011/11/17' label='Hunting' 
   	height='25%' topPadding='25%' />
<task processId='Monkeys' color='4567AA' 
   	start='2011/03/01' end='2011/04/30' label='Sleeping' 
   	height='25%' topPadding='25%' />
<task processId='Bears' color='999999' 
   	start='2011/04/25' end='2011/05/14' label='Eating' 
   	height='25%' topPadding='25%' />
<task processId='Crocodiles' color='559F58' 
   	start='2011/06/01' end='2011/07/30' label='Swimming' 
   	height='25%' topPadding='25%' />
  </tasks>
  <legend>
 	<item label='Complete' color='559F58' />
 	<item label='In Progress' color='4567AA' />
 	<item label='Planned' color='999999' />
  </legend>
  <trendlines>
 	<line start='2011/02/23' displayValue='Today' color='333333' thickness='2' dashed='1' />
  </trendlines>
</chart>

 

The code above works well, and produces the chart you can see in the first image attachment post-12627-015102700 1298509915_thumb.png. However, if you uncomment the task element that is currently commented out (the one that started in Nov of last year, before the beginning of the chart's overall date range), you can see some serious problems as shown in the second image attachment post-12627-032731000 1298509922_thumb.png. Specifically:

 

  1. The "Today" trend line has moved from late February (which was correct) to late April (which is fantastically incorrect)
  2. All other tasks on the chart have been shifted to the right by two months, except for the one which was in Nov, which only gets shifted by one month for some reason.
  3. The column widths become inconsistent, with the last column (Dec) getting much more horizontal space than the others for some reason.

I think that I can work around this by ensuring that the chart's overall date range always encompasses the full set of possible date ranges from all tasks in the chart, but this means that I can't restrict my chart to a given time period without either excluding tasks that start or finish outside that time period, or having all my dates get messed up. Either way, the workaround is not ideal.

Share this post


Link to post
Share on other sites

I just noticed I posted this in the wrong place - should have been in the FusionWidgets bug reports forum instead of the FusionCharts one, sorry about that. Anyway, just to reply to myself here, I've found a much better workaround for this problem: when I get the task data from the db, I "crop" the start/end dates to the date range of the chart, while being sure to use the "toolText" attribute to keep the popup tooltip showing the correct date values. For example, to correct the problematic Alligator task from above, I change the xml for the Task definition of it to the following:

 

<task processId='Alligators' color='999999' 
   	start='2011/01/01' end='2011/01/17' label='Foraging' 
   	height='25%' topPadding='25%' toolText='Foraging: 2010/11/03 - 2011/01/17' />

 

This avoids the chart display problems mentioned above while still keeping all the tooltips correct. This problem has now gone from Serious to merely Mildly Annoying.

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

Welcome to FusionCharts Forum!smile.gif

 

Glad to know that you have managed to resolve the issue.

 

Keep FusionCharting!biggrin.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this