3 Replies Latest reply: Oct 27, 2011 12:21 PM by StewStryker RSS

    apex 4.1 gantt date truncated

    jareeq
      Hi Again,

      I'm trying to create gantt chart using apex.

      source sql is:
      select '' link,
             1 ID,
             'T1' TASK_NAME,
      
             null PARENT_ID,
             sysdate START_DATE,
             sysdate+ .011 END_DATE
      
        from dual union
      select '' link,
             2 ID,
             'T1' TASK_NAME,
      
             null PARENT_ID,
             to_date('2011-10-11 12:31','YYYY-MM-DD hh24:mi') START_DATE,
             to_date('2011-10-12 21:41','YYYY-MM-DD hh24:mi') END_DATE
      
        from dual union
      select '' link,
             3 ID,
             'T1' TASK_NAME,
      
             null PARENT_ID,
             sysdate+.4 START_DATE,
             sysdate+ .811 END_DATE
      
        from dual
      Like you see above I'm putting hours minutes and seconds but displayed chart contains only valid date, all other data looks like this (from XML debug message):
      <period resource_id="1" start="2011.10.21 00.00.00" end="2011.10.21 00.00.00" style="defaultStyle"/>
      <period resource_id="2" start="2011.10.11 00.00.00" end="2011.10.12 00.00.00" style="defaultStyle"/>
      <period resource_id="3" start="2011.10.21 00.00.00" end="2011.10.21 00.00.00" style="defaultStyle"/>
      Also created sample app available here:

      http://apex.oracle.com/pls/apex/f?p=56739

      but result is the same.

      According to some other user ( http://apex.oracle.com/pls/apex/f?p=36648:71:706382355392067::NO:::) apps this precision works fine in anycharts.

      I'm stuck here so little help will be appreciated.

      Thanks,
      jareeq

      Edited by: jareeq on 2011-10-21 02:43
        • 1. Re: apex 4.1 gantt date truncated
          Hilary Farrell-Oracle
          Hi Jareeq,

          As mentioned on my sample application example - http://apex.oracle.com/pls/apex/f?p=36648:71 - in order to generate Gantt charts where accurate time information is used, then the chart query must reference TIMESTAMP columns. In your sample query you're retrieving DATE values, but if you update the query to return TIMESTAMP values, and apply the correct associated Gantt Date Format, then you'll get the results you're trying to achieve. Here's an example: http://apex.oracle.com/pls/apex/f?p=36648:83. For further information on the AnyChart date/time formatting, please refer to their online documentation, here: http://anychart.com/products/anychart/docs/users-guide/datetime-formatting.html?fromtree

          I hope this helps.

          Regards,
          Hilary
          • 2. Re: apex 4.1 gantt date truncated
            jareeq
            Thanks Hilary,

            It looks like basic errors on the beginning relay destroy overall work.

            At the beginning really started from the timestamp (my source table), BUT as I notice also contained a timestamp time zone. Because I did not notice this error, threw this direction and started for conversions to the date and next desperately - to insert the data manually - because of course it could not display the hour (and never will).

            Thank you again for your extensive explanation - now i now this must bi exactly timestamp and no timestamp with time zone.

            Edited by: jareeq on 2011-10-24 05:51

            Edited by: jareeq on 2011-10-24 05:53
            • 3. Re: apex 4.1 gantt date truncated
              StewStryker
              Hilary,

              Do the settings on your example page work with a Project (vs Resource) Gantt? I'm totally failing at this with Apex 4.0.1.

              When I first created the chart and passed DATE values, it indeed displayed the default time of 12:10, but the query validation wouldn't accept start/stop date values other than DATE datatype. So I disabled the query validation on the following query (same as your recommended, but a single row):

              select '' link,
              1 ID,
              'T1' TASK_NAME,
              null PARENT_ID,
              to_timestamp(to_char(sysdate,'YYYY-MM-DD hh24:mi'),'YYYY-MM-DD hh24:mi') START_DATE,
              to_timestamp(to_char(sysdate+ .011,'YYYY-MM-DD hh24:mi'),'YYYY-MM-DD hh24:mi') END_DATE
              from dual

              I also changed the chart's date format to be your suggested: _%yyyy.%MM.%dd.%HH.%mm.%ss_ even though the to_timestamp format above is different.

              But the chart always gives an error like: No project data

              What am I missing here?

              Thanks,

              Stew