Hey,In the previous version I used a gantt table in a dashboard.
I then decided to recreate this in 2020.I use the code below as described in the manual, but the gantt table does not appear. Am I missing something?// Place the following code in Startup Scriptgoogle.charts.load(‘current’, {‘packages’:[‘gantt’]});
google.charts.setOnLoadCallback(function() {
// Add <div> for chart
$(".ew-center").append('<div id="chart_div"></div>');
// Create data table
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');
Thanks.I 've already added h ttps://www.gstatic.com/charts/loader.js under Tools → Scripts & Stylesheets → Scripts (Global)Also in debug mode I see no indication of a gantt graph.
in the demo project there is also:
data.addRows(<?php echo ExecuteJson("SELECT TaskID, TaskName, ResourceID, Start, End, Duration, PercentComplete, Dependencies FROM tasks", ["header" => FALSE, "array" => TRUE, "convertdate" => TRUE, "datatypes" => [3 => "date", 4 => "date", 5 => "number", 6 => "number"]]); ?>);what is the purpose of those data types?when I add this I get an error and blank field
No errors, no warnings,
just: [Violation] Added synchronous DOM mutation listener to a ‘DOMNodeInserted’ event. Consider using MutationObserver to make the page more responsive.but also no google ganttThanks for all the help
tom wrote:
// Place the following code in Startup ScriptMake sure if you put in in Startup Script. If you put it in the Dashboard template directly, you need to enclose the code inloadjs.ready(“load”, function() {
// your code
});
tom wrote:
// Add
for chart
$(“.ew-center”).append(‘’);In dashboard report there is no div.ew-center, make sure you append add your chart div in an existing HTML element in your dashboard template, or you can put the in the dashboard template directly.