Gantt chart, Label fontColor not working

29 views
Skip to first unread message

JAda_1111

unread,
Oct 20, 2021, 8:03:56 PM10/20/21
to Google Visualization API
Hey all.  I'm having troubles with the Google Chart - Gantt code.  I have noticed that the fontColor doesn't seem to work.  It doesn't break anything, but it doesn't change the color, either.


Here's my source code:
<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 daysToMilliseconds(days) { return days * 24 * 60 * 60 * 1000;  }

    function drawChart() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Task ID');
      data.addColumn('string', 'Task Name');
      data.addColumn('string', 'Resource');
      data.addColumn('date', 'Start Date');
      data.addColumn('date', 'End Date');
      data.addColumn('number', 'Duration');
      data.addColumn('number', 'Percent Complete');
      data.addColumn('string', 'Dependencies');

      data.addRows([
          ["20E1EB9656C9", "Admin", "3F79DBE5", new Date (2021, 10, 6), null, 243000000, 0, null]
        , ["BCF1D33486DA", "Task2", "3F79DBE5", new Date (2021, 10, 7), null, 21600000, 0, null]
        , ["8AC89CD0F30C", "Task3", "3F79DBE5", new Date (2021, 10, 6), null, 108000000, 0, null]
        , ["A239BA5A4375", "Task4", "3F79DBE5", new Date (2021, 10, 11), null, 69120000, 0, null]
]);
      var options = {
        height: 350,
        gantt: {
          criticalPathEnabled: false,
          innerGridHorizLine: {
                stroke: '#ffe0b2',
                strokeWidth: 2
            },
            innerGridTrack: {fill: '#fff3e0'},
            innerGridDarkTrack: {fill: '#ffcc80'},
            labelStyle: {
              fontName: 'Tahoma',
              fontSize: 18,
              color: '#ffffff'
            }
          }
      };

      var chart = new google.visualization.Gantt(document.getElementById('chart_div'));

      chart.draw(data, options);
    }
  </script>
</head>
<body>
  <div id="chart_div"></div>
</body>
</html>
Reply all
Reply to author
Forward
0 new messages