5 Replies Latest reply on May 9, 2019 3:00 PM by Hilary Farrell-Oracle

    Gantt Chart - Multiple Tasks Per Row

    hari-Oracle

      Hi Team,

       

      APEX Version: 18.2.0.00.12

       

      I am trying to create Gantt Chart with multiple tasks per row option. My expected output is like below.

       

      https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=gantt&demo=multipleTasks

       

      I did set-up a simple example to demonstrate my problem. (not in apex.oraclecorp.com as it's not on APEX 18.2)

       

      Gantt Chart Series query:

       

      SELECT 1 emp_id, 'Srihari' as emp_name, 1000 task_id, 'task 1000' task_name, sysdate - 5 start_date, sysdate - 3 end_date, 0 status from dual
      union
      SELECT 1 emp_id, 'Srihari' as emp_name, 1001 task_id, 'task 1001' task_name, sysdate - 1 start_date, sysdate + 1 end_date, 0 status from dual
      union
      SELECT 1 emp_id, 'Srihari' as emp_name, 1002 task_id, 'task 1002' task_name, sysdate + 2 start_date, sysdate + 3 end_date, 0 status from dual
      union
      SELECT 2 emp_id, 'Murari' as emp_name, 1003 task_id, 'task 1003' task_name, sysdate - 5 start_date, sysdate + 1 end_date, 0 status from dual
      union
      SELECT 2 emp_id, 'Murari' as emp_name, 1004 task_id, 'task 1004' task_name, sysdate + 2 start_date, sysdate + 5 end_date, 0 status from dual
      

       

      Gantt Chart Series Attributes:

       

       

      P16_START_DATE and P16_END_DATE are page items and I am setting initial values to these page items during page load.

       

      But, when I run the page it says "No Data to Display Message".

       

       

      Any idea what could be wrong with this Gantt chart? Am I missing something obvious somewhere? Please advise.

       

      Regards,

      Srihari

        • 1. Re: Gantt Chart - Multiple Tasks Per Row
          Hilary Farrell-Oracle

          Hi Srihari,

           

          You've already raised this question internally on Einstein, and as we're actively discussing it there, lets please stick to one location to address your query - in Einstein.

           

          Thanks,

          Hilary

          • 2. Re: Gantt Chart - Multiple Tasks Per Row
            Mint-Innit

            Hi Hilary, I've asked this question on here before and had no response. And I've not been able to reproduce the Jet example in Apex myself.

             

            So I'd be really interested that, if there is a solution, it could be eventually posted here too (even if it's discussed in detail elsewhere!).

             

            Cheers.

            • 3. Re: Gantt Chart - Multiple Tasks Per Row
              Hilary Farrell-Oracle

              Hi Mint-Innit,

               

              For the multiple tasks per row, you're working with hierarchical data - as you will see if you inspect the example in the Sample Charts app.  Try running the query in SQL Commands, and you'll see how there's a TASK_ID and PARENT_TASK_ID column - with the PARENT_TASK_ID holding the association to a given high level task.  The 'Row ID' attribute is mapped to the column PARENT_TASK_ID.  It's similar to the hierarchical tree, if you're familiar with working with that component.

               

              Regards,

              Hilary

              • 4. Re: Gantt Chart - Multiple Tasks Per Row
                Mint-Innit

                Hi Hilary, thanks for responding. Yes I've tried before to reproduce the cookbook example by tweaking the sample chart app - but in the past I never got very far.

                 

                I've just had another go and your tip about the PARENT_TASK_ID / Row Id seems to have been the piece of the puzzle that I was missing before. There are still several quirks I'm struggling with (getting the axis formatting to be sensible for example) but getting the 'tasks' neatly on one line is a great start. It's given me the chance to make some progress on this again, many thanks.

                 

                Cheers.

                • 5. Re: Gantt Chart - Multiple Tasks Per Row
                  Hilary Farrell-Oracle

                  No worries, Mint-Innit,

                   

                  That's great to hear things are progressing now with your use of the gantt.....and sorry I didn't see your previous posting on this topic.  I try to keep on top of forum posts as frequently as possible, but some do escape my attention.  With the Gantt chart, the JSON needs to be emitted in order of the rows being processed - with a unique ID for each row, and a unique ID for each task.  So if you're trying to render multiple tasks per row, the use of a hierarchical query will ensure that the data is emitted in the order in which the JSON expects it.  In relation to the axes, there are a number of scaling options there, so the settings you choose there will depend on your chart data.  Let me know if you have any issues with those axes attributes.

                   

                  Regards,

                  Hilary