gojs - how to set nodespacing in timeline layout -


i working on gojs timeline sample(http://gojs.net/latest/samples/timeline.html) default functionality based on dates.i have added more number of nodes existing nodes due overlapping each other. how set nodespacing in layout.

in prototype code in example, find part, rewrite:

var bar = line.findobject("bar");       var length = 100;       var cellw = 100;       if (bar && numweeks > 0) {         length = bar.actualbounds.width;         cellw = length / numweeks;         // set size of each cell         bar.gridcellsize = new go.size(cellw, bar.gridcellsize.height);         // offset account starting on non-first day of week         bar.gridorigin = new go.point(convertdatetox(firstsunday), bar.gridorigin.y);       } 

here have 3 options (actually two, 3. suggestion):

  1. change vars:

    var length = /*the length want bar have (you take number of cells * cellw below)*/ var cellw = /*the length want each cell have*/ 
  2. make configurable:

    do

    timelinelayout.prototype.setcellw = function(newcellw){ this.cellw = newcellw; } 

    then reference in part shown above.

  3. use gridlayout instead: here see if sufficient needs.

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -