class anychart.core.gantt.elements.MilestonesPreviewElement Improve this Doc
Extends: anychart.core.gantt.elements.MilestonesElement
Milestones Preview element settings.
Methods Overview
| Specific settings | |
| depth() | Depth value. |
| drawOnCollapsedOnly() | Should preview be drawn only on collapsed parent tasks. |
| Coloring | |
| fill() | Fill elements settings. |
| stroke() | Element stroke settings. |
| Enabling/Disabling | |
| enabled() | Gets element's 'enabled' state. |
| Interactivity | |
| edit() | Live edit mode. |
| rendering() | Rendering settings. |
| selected() | Selected state settings. |
| Labels | |
| labels() | Element labels settings. |
| Size and Position | |
| anchor() | Element anchor. |
| height() | Element height. |
| Miscellaneous | |
| markerType() | Getter for marker type |
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:
| Name | Type | Description |
|---|---|---|
| anchor | string | anychart.enums.Anchor | Value to set. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
depth
Getter for milestone's preview depth option value.
Returns:
null | number - Depth option value.Try it:
Setter for milestone's preview depth option value.
Depth value means how many child levels in depth grouping task will use to display milestones preview:
Depth value means how many child levels in depth grouping task will use to display milestones preview:
- null means that all child milestone previews will be displayed.
- 0 means that no previews will appear on grouping task.
- 1 means that first-level child milestones will be shown.
- 2, etc deeper levels to be shown.
Params:
| Name | Type | Description |
|---|---|---|
| value | number | Depth value to set. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
drawOnCollapsedOnly
Should preview be drawn only on collapsed parent tasks.
Returns:
boolean - Should preview be drawn only on collapsed parent tasks. See listing
var milestones = chart.getTimeline().milestones(); var preview = milestones.preview(); var drawOnCollapsedOnly = preview.drawOnCollapsedOnly();
Try it:
Whether preview element should be drawn on collapsed tasks only.
Params:
| Name | Type | Description |
|---|---|---|
| value | boolean |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining. See listing
var milestones = chart.getTimeline().milestones(); var preview = milestones.preview(); preview.drawOnCollapsedOnly(true);
Try it:
edit
Getter for live edit settings.
Returns:
anychart.core.gantt.edit.ElementEdit - Live edit settings.Try it:
Setter for live edit settings.
Learn more about Live editing.
Detailed description
Sets live edit settings depending on parameter type:
- boolean - disable or enable live edit.
- object - sets live edit settings.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| settings | Object | boolean | false | Live edit settings to set. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.enabled
Setter for element enabled state.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| settings | boolean | true | Whether to enable element. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
fill
Getter for the element fill.
Returns:
anychart.graphics.vector.Fill | string - Element fill. See listing
var elements = timeLine.elements(); var fill = elements.fill();
Setter for element fill settings using an object or a string.
Learn more about coloring.
Params:
| Name | Type | Description |
|---|---|---|
| color | anychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)> | Color as an object, an array or a string. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Setter for fill settings using function.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| fillFunction | function():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.MilestonesPreviewElement - Self instance for method chaining.Try it:
Fill color with opacity. Fill as a string or an object.
Detailed description
Note: If color is set as a string (e.g. 'red .5') it has a priority over opt_opacity, which
means: color set like this rect.fill('red 0.3', 0.7) will have 0.3 opacity.
Params:
| Name | Type | Description |
|---|---|---|
| color | string | Color as a string. |
| opacity | number | Color opacity. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
Linear gradient fill.
Learn more about coloring.
Params:
| Name | Type | Description |
|---|---|---|
| keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Gradient keys. |
| angle | number | Gradient angle. |
| mode | boolean | anychart.graphics.vector.Rect | Object | Gradient mode. |
| opacity | number | Gradient opacity. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
Radial gradient fill.
Learn more about coloring.
Params:
| Name | Type | Description |
|---|---|---|
| keys | Array.<(anychart.graphics.vector.GradientKey|string)> | Color-stop gradient keys. |
| cx | number | X ratio of center radial gradient. |
| cy | number | Y ratio of center radial gradient. |
| mode | anychart.graphics.math.Rect | If defined then userSpaceOnUse mode, else objectBoundingBox. |
| opacity | number | Opacity of the gradient. |
| fx | number | X ratio of focal point. |
| fy | number | Y ratio of focal point. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
Image fill.
Learn more about coloring.
Params:
| Name | Type | Description |
|---|---|---|
| imageSettings | anychart.graphics.vector.Fill | Object with settings. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
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:
| Name | Type | Description |
|---|---|---|
| height | string | number | Value to set. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
labels
Setter for element labels.
Detailed description
Sets labels settings depending on parameter type:
- null/boolean - disable or enable base labels.
- object - sets base labels settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | boolean | null | Labels settings. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.markerType
Getter for marker type
Returns:
anychart.enums.MarkerType - markerType See listing
var milestones = chart.getTimeline().milestones(); var preview = milestones.preview(); var markerType = preview.markerType();
Try it:
Setter for marker type
Params:
| Name | Type | Description |
|---|---|---|
| markerType | anychart.enums.MarkerType |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining. See listing
var markerType = 'star5'; var milestones = chart.getTimeline().milestones(); var preview = milestones.preview(); preview.markerType(markerType);
Try it:
rendering
Getter for rendering settings.
Returns:
anychart.core.gantt.rendering.Settings - Rendering settings.Try it:
Setter for rendering settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | Rendering settings from anychart.core.gantt.rendering.Settings. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
selected
Getter for selected state settings.
Returns:
anychart.core.StateSettings - Selected state settingsSetter for selected state settings.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.stroke
Getter for element stroke settings.
Returns:
anychart.graphics.vector.Stroke | string - Element stroke settings. See listing
var elements = timeLine.elements(); var stroke = elements.stroke();
Setter for element stroke settings.
Learn more about stroke settings.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null | Stroke settings. | |
| thickness | number | 1 | Line thickness. |
| dashpattern | string | Controls the pattern of dashes and gaps used to stroke paths. | |
| lineJoin | string | anychart.graphics.vector.StrokeLineJoin | Line join style. | |
| lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
Setter for element stroke settings using function.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| strokeFunction | function():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.MilestonesPreviewElement - Self instance for method chaining.Try it:
Setter for the thumb stroke using an object.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | Stroke settings from anychart.graphics.vector.Stroke. |
Returns:
anychart.core.gantt.elements.MilestonesPreviewElement - Self instance for method chaining.Try it:
