All Elements

You can access almost all elements of a Project chart at once: tasks of all types, baselines, and progress bars (but not connectors and markers). They are defined as instances of the anychart.core.gantt.elements.TimelineElement class.

The same is true for the Resource chart, but it makes little difference since only two types of elements are supported – periods and connectors.

To configure elements, combine getTimeline() and elements() with the following methods:

In the sample below, the elements() method is used to access elements of a Project chart. The normal() and selected() methods are combined with fill() and stroke() to configure the appearance settings in two states: normal and selected.

// configure timeline elements
var elements = chart.getTimeline().elements();
elements.normal().fill("#455a64 0.5");
elements.selected().fill("#dd2c00");
elements.normal().stroke("#455a64");
elements.selected().stroke("#dd2c00");

Playground