Fix for issues with generating diagrams using the cli: default style for clusters and fixes for autoscaling side effects

This commit is contained in:
knsv
2015-06-21 17:25:58 +02:00
parent 4ed345101a
commit 50219cf2d9
8 changed files with 27 additions and 13 deletions

View File

@@ -26,16 +26,18 @@ var w;
module.exports.draw = function (text, id) {
gantt.yy.clear();
gantt.parse(text);
var elem = document.getElementById(id);
w = elem.parentElement.offsetWidth;
console.log('id='+id,' w='+w);
console.log(elem.parentElement);
if (typeof w === 'undefined') {
w = 1200;
}
if(typeof conf.useWidth !== 'undefined'){
w = conf.useWidth;
}
var taskArray = gantt.yy.getTasks();
// Set height based on number of tasks
@@ -83,6 +85,10 @@ module.exports.draw = function (text, id) {
makeGant(taskArray, w, h);
if(typeof conf.useWidth !== 'undefined'){
elem.setAttribute('width', w);
}
var title = svg.append("text")
.text(gantt.yy.getTitle())