as I do that in this diagram the data "duration" shows me 2 months

1
<html>
<head>
  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  <script type="text/javascript">
    google.charts.load('current', {'packages':['gantt']});
    google.charts.setOnLoadCallback(drawChart);

    function drawChart() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Task ID');
      data.addColumn('string', 'Task Name');
      data.addColumn('date', 'Fecha Inicial');
      data.addColumn('date', 'Fecha Final');
      data.addColumn('number', 'Duracion');
      data.addColumn('number', 'Percentaje Complado');
      data.addColumn('string', 'Dependencias');

      data.addRows([
        ['Tema', 'Definir el Tema',
         new Date(2018, 0, 20), new Date(2018, 2, 20), null, 90, null],
        ['Objetivos', 'Definir Objetivos',
         new Date(2018, 1, 20), new Date(2018, 2, 20), null, 90, 'Tema'],
        ['Justificacion', 'Justificacion',
         new Date(2018, 5, 20), new Date(2018, 6, 20), null, 90, 'Tema'],
        ['Metodologia', 'Elegir la Metodologia',
         new Date(2018, 3, 20), new Date(2018, 4, 20), null, 90, 'Tema'],
        ['Bibliografia', 'Crear la Bibliografia',
         new Date(2018, 4, 20), new Date(2018, 5, 20), null, 90, 'Tema'],
         ]);

      var options = {
        height: 275
      };

      var chart = new google.visualization.Gantt(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
  </script>
</head>
<body>
  <div id="chart_div"></div>
</body>
</html>
    
asked by walter 12.12.2018 в 23:41
source

1 answer

0

The first item Define the Theme is two months old: 0 is January and 2 is March ... Just give it a period of two months from the item that requires it, for example, in Choose Methodology put new Date(2018, 3, 20), new Date(2018, 5, 20), null, 90, 'Tema'],

<html>
<head>
  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  <script type="text/javascript">
    google.charts.load('current', {'packages':['gantt']});
    google.charts.setOnLoadCallback(drawChart);

    function drawChart() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Task ID');
      data.addColumn('string', 'Task Name');
      data.addColumn('date', 'Fecha Inicial');
      data.addColumn('date', 'Fecha Final');
      data.addColumn('number', 'Duracion');
      data.addColumn('number', 'Percentaje Complado');
      data.addColumn('string', 'Dependencias');

      data.addRows([
        ['Tema', 'Definir el Tema',
         new Date(2018, 0, 20), new Date(2018, 2, 20), null, 90, null],
        ['Objetivos', 'Definir Objetivos',
         new Date(2018, 1, 20), new Date(2018, 2, 20), null, 90, 'Tema'],
        ['Justificacion', 'Justificacion',
         new Date(2018, 5, 20), new Date(2018, 6, 20), null, 90, 'Tema'],
        ['Metodologia', 'Elegir la Metodologia',
         new Date(2018, 3, 20), new Date(2018, 5, 20), null, 90, 'Tema'],
        ['Bibliografia', 'Crear la Bibliografia',
         new Date(2018, 4, 20), new Date(2018, 5, 20), null, 90, 'Tema'],
         ]);

      var options = {
        height: 275
      };

      var chart = new google.visualization.Gantt(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
  </script>
</head>
<body>
  <div id="chart_div"></div>
</body>
</html>
    
answered by 13.12.2018 в 00:01