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):
change
var
s:var length = /*the length want bar have (you take number of cells * cellw below)*/ var cellw = /*the length want each cell have*/
make configurable:
do
timelinelayout.prototype.setcellw = function(newcellw){ this.cellw = newcellw; }
then reference in part shown above.
- use gridlayout instead: here see if sufficient needs.
Comments
Post a Comment