We want to add many tasks on the same action.
Our script works well for one task usins addPoint.
Code: Select all
#
var series = chart.series[0],
name = addTask,
undef,
y = 10
)
maxEnd = reduce(series.points, function (acc, point) {
return point.y === y && point.end ? Math.max(acc, point.end) : acc;
}
, 0)
if (maxEnd === 0) {
maxEnd = today;
}
#Add point
series.addPoint({
start: addDateA,
end: addDateB,
user: '',
affair: '',
y: y,
color: thecolor,
name: addTask
});
Code: Select all
series.setData[{
start: addDateA,
end: addDateB,
user: '',
affair: '',
y: y,
color: thecolor,
name: addTask
}];