anychart.onDocumentReady(function () {
{id: "1", duration: 1, name: "Task A"},
{id: "2", duration: 3, name: "Task B"},
{id: "3", duration: 4, name: "Task C"},
{id: "4", duration: 1, name: "Task D"},
{id: "5", duration: 2, name: "Task AD", dependsOn: ["1", "4"]},
{id: "6", duration: 2, name: "Task BC", dependsOn: ["2", "3"]}
var chart = anychart.pert();
chart.milestones().size(50);
chart.data(data, "as-table");
chart.title("PERT Chart");
chart.interactivity().selectionMode("single-select");
chart.listen("pointsselect", function(e){
for (var i = 0; i < e.selectedMilestones.length; i++){
if (e.selectedMilestones[i].isCritical === true) {
chart.title("This milestone belongs to the critical path");
chart.title("This milestone does not belong to the critical path");
for (var i = 0; i < e.selectedTasks.length; i++){
if (e.selectedTasks[i].slack == 0) {
chart.title("This task belongs to the critical path");
chart.title("This task does not belong to the critical path");
chart.container("container");