Gantt Chart Problem

julius3419
2004-10-22
2013-01-13
  • julius3419
    julius3419
    2004-10-22

    public Object produceDataset(Map params) throws DatasetProduceException {
            ... //data were dynamically generated
            date1, date2, date3, date4 in the same day, but different time.

           Task task1 = new Task("Task1", new SimpleTimePeriod(date1,date2 ));
          

     
    • julius3419
      julius3419
      2004-10-22

      public Object produceDataset(Map params) throws DatasetProduceException {
      ... //data were dynamically generated
      date1, date2, date3, date4, date5 in the same day, but different time.
      TaskSeriesCollection tsc = new
      TaskSeries ts1 = new TaskSeries("ts1");
      Task task1 = new Task("Task1", new SimpleTimePeriod(date1,date2 ));
      Task task2 = new Task("Task2", SimpleDatePeriod (date2, date3));
      Task task3 = new Task("Task3", SimpleDatePeriod (date3, date4));
      ts1.add(task1);
      ts1.add(task2);
      ts1.add(task3);
      tsc.add(ts1);
      return tsc;
      The problem is the gantt chart only show some part of the time range....eg. 08.00 to 13.00 and truncate the rest of it (13.00 and above).
      And what is the way to change the data axis in there?

       
    • julius3419
      julius3419
      2004-10-28

      Found the solution....

      public void processChart(Object chart, Map params) {
      CategoryPlot plot = (CategoryPlot)((JFreeChart)chart).getPlot();
      DateAxis dateAxis = (DateAxis)plot.getRangeAxis();
      dateAxis.setRange(beginTime, endTime);
              DateTickUnit dtu = new DateTickUnit(DateTickUnit.MINUTE,30, new SimpleDateFormat("HH:mm"));
              dateAxis.setTickUnit(dtu);
      }

       
    • julius3419
      julius3419
      2004-10-28

      i got another problem....

      it seems that there is the limit to the number of tasks and subtasks allowed in the gantt chart. I can only created 2 tasks and 2 subtasks (dynamically created)..... Anything i should do to enabled more tasks and subtasks? any help would be appreciated....