AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.gantt.elements.MilestonesElement Improve this Doc

Extends: anychart.core.gantt.elements.TimelineElement

Milestones element settings.

Methods Overview

Coloring
fill()Fill elements settings.
stroke()Element stroke settings.
Events
listen()Adds an event listener.
listenOnce()Adds a single time event listener.
removeAllListeners()Removes all listeners.
unlisten()Removes the listener.
unlistenByKey()Removes the listener by the key.
Interactivity
edit()Live edit mode.
normal()Normal state settings.
rendering()Rendering settings.
selected()Selected state settings.
Labels
labels()Element labels settings.
Size and Position
anchor()Element anchor.
height()Element height.
offset()Element vertical offset.
position()Element position.

Methods Description

anchor

Getter for the element anchor.

Returns:

string | anychart.enums.Anchor - Element anchor.
See listing
var elements = timeLine.elements();
var anchor = elements.anchor();
Setter for the element anchor.

Params:

NameTypeDescription
anchorstring | anychart.enums.AnchorValue to set.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

edit

Getter for live edit settings.

Returns:

anychart.core.gantt.edit.ElementEdit - Live edit settings.
Setter for live edit settings. Learn more about Live editing.

Params:

NameTypeDefaultDescription
settingsObject | boolean
false
Live edit settings to set.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

fill

Getter for the element fill.

Returns:

anychart.graphics.vector.Fill | string - Element fill.
Setter for element fill settings using an object or a string. Learn more about coloring.

Params:

NameTypeDescription
coloranychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)>Color as an object, an array or a string.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Setter for fill settings using function.

Params:

NameTypeDefaultDescription
fillFunctionfunction():anychart.graphics.vector.Fill
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like:
function(){
   // this.sourceColor - Color with type anychart.graphics.vector.Fill (directly resolvable color).
   Type is anychart.graphics.vector.Fill, anychart.graphics.vector.PatternFill. The color is set from a theme
   or palette and is determined automatically for each colorized element.
   // this.item - the item of the visual element to which the coloring is applied. Type is anychart.data.Tree.DataItem or anychart.data.TreeView.DataItem
   // this.itemIndex - the linear index of the item. Type is number
   // this.period - the period for anychart#ganttResource. Type is object. A period object with the index
   this.periodIndex at the data point this.item, corresponding to the visual display element.
   // this.periodIndex - the index of the period for anychart#ganttResource.

   return fillValue; // type anychart.graphics.vector.Fill
}

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

height

Getter for the element height.

Returns:

string | number - Element height.
See listing
var elements = timeLine.elements();
var height = elements.height();
Setter for the element height.

Params:

NameTypeDescription
heightstring | numberValue to set.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

labels

Getter for elements labels.

Returns:

anychart.core.ui.LabelsFactory - Labels instance.
Setter for element labels.

Params:

NameTypeDescription
settingsObject | boolean | nullLabels settings.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
Callback method. Function that looks like:
function(event){
   // event.actualTarget - actual event target
   // event.currentTarget - current event target
   // event.iterator - event iterator
   // event.originalEvent - original event
   // event.point - event point
   // event.pointIndex - event point index
}
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

normal

Getter for normal state settings.

Returns:

anychart.core.StateSettings - Normal state settings.
Setter for normal state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

offset

Getter for the vertical offset.

Returns:

string | number - Element vertical offset.
See listing
var elements = timeLine.elements();
var offset = elements.offset();
Setter for the vertical offset.

Params:

NameTypeDescription
offsetstring | numberValue to set.

Returns:

anychart.core.ui.Timeline - Self instance for method chaining.

position

Getter for the element position.

Returns:

string | anychart.enums.Anchor - The element position.
See listing
var elements = timeLine.elements();
var position = elements.position();
Setter for the element position.

Params:

NameTypeDescription
positionstring | anychart.enums.AnchorValue to set.

Returns:

anychart.core.ui.Timeline - Self instance for method chaining.

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

rendering

Getter for rendering settings.

Returns:

anychart.core.gantt.rendering.Settings - Rendering settings.
Setter for rendering settings.

Params:

NameTypeDescription
settingsObjectRendering settings from anychart.core.gantt.rendering.Settings.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

selected

Getter for selected state settings.

Returns:

anychart.core.StateSettings - Selected state settings
Setter for selected state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

stroke

Getter for element stroke settings.

Returns:

anychart.graphics.vector.Stroke | string - Element stroke settings.
Setter for element stroke settings. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Setter for element stroke settings using function.

Params:

NameTypeDefaultDescription
strokeFunctionfunction():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill
function() {
}
Function that looks like:
function(){
   // this.sourceColor - Color with type anychart.graphics.vector.Stroke (directly resolvable color).
   Type is anychart.graphics.vector.Stroke. The color is set from a theme or palette and is determined automatically for each colorized element.
   // this.item - the item of the visual element to which the coloring is applied. Type is anychart.data.Tree.DataItem or anychart.data.TreeView.DataItem
   // this.itemIndex - the linear index of the item. Type is number
   // this.period - the period for anychart#ganttResource. Type is object. A period object with the index
   this.periodIndex at the data point this.item, corresponding to the visual display element.
   // this.periodIndex - the index of the period for anychart#ganttResource.

   return strokeValue; // type anychart.graphics.vector.Stroke
}

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.
Setter for the thumb stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

anychart.core.gantt.elements.MilestonesElement - Self instance for method chaining.

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object):boolean|undefined
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.