class anychart.core.axisMarkers.GanttText Improve this Doc
Extends: anychart.core.Text
Gantt text marker.
Methods Overview
| Specific settings | |
| scale() | Scale settings. |
| text() | Text settings. |
| value() | Text marker value settings. |
| Advanced Text Settings | |
| fontVariant() | Font variant settings. |
| letterSpacing() | Text letter spacing settings. |
| textDirection() | Text direction settings. |
| textIndent() | Text indent settings. |
| textOverflow() | Text overflow settings. |
| useHtml() | Text useHtml settings. |
| wordBreak() | Word break mode. |
| wordWrap() | Word-wrap mode. |
| Base Text Settings | |
| fontColor() | Font color settings. |
| fontDecoration() | Font decoration settings. |
| fontFamily() | Font family settings. |
| fontOpacity() | Font opacity settings. |
| fontSize() | Font size settings. |
| fontStyle() | Font style settings. |
| fontWeight() | Font weight settings. |
| hAlign() | Text horizontal align settings. |
| lineHeight() | Text line height settings. |
| vAlign() | Text vertical align settings. |
| Coloring | |
| background() | Background settings. |
| Events | |
| disablePointerEvents() | Pointer events settings. |
| Interactivity | |
| enabled() | Element state (enabled or disabled). |
| selectable() | Text selectable option. |
| Size and Position | |
| align() | Align settings. |
| anchor() | Anchor settings. |
| height() | Text marker height. |
| isHorizontal() | Whether a text marker has horizontal layout. |
| layout() | Layout settings. |
| offsetX() | Text marker offset by x. |
| offsetY() | Text marker offset by y. |
| padding() | Padding settings. |
| rotation() | Rotation settings. |
| width() | Text marker width. |
| zIndex() | Z-index of the element. |
| Text Settings | |
| textSettings() | Text settings. |
Methods Description
align
Returns:
anychart.enums.Align | string - The gantt text marker align.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var align = customTextMarker.align();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| align | anychart.enums.Align | string | 'center' | Text marker align. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
anchor
Returns:
anychart.enums.Anchor | string - Text marker anchor settings.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var anchor = customTextMarker.anchor();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| anchor | anychart.enums.Anchor | string | 'auto' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
background
- null/boolean - disable or enable text marker background.
- object - sets text marker background settings.
- string - sets fill for the text marker background.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| settings | string | Object | null | boolean | false | Background settings. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.disablePointerEvents
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | Enabled state to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
enabled
Returns:
boolean - Element state.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.if (!element.enabled()) element.enabled(true);
Try it:
fontColor
https://www.w3schools.com/html/html_colors.asp
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| color | string | '#7c868e' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontDecoration
Returns:
anychart.graphics.vector.Text.Decoration | string - Font decoration.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value | anychart.graphics.vector.Text.Decoration | string | 'none' | Font decoration to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontFamily
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| family | string | 'Verdana', Helvetica, Arial, sans-serif | Font family to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontOpacity
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| opacity | number | 1 | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontSize
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| size | string | number | 16 | Font size to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontStyle
Returns:
anychart.graphics.vector.Text.FontStyle | string - Font style.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| style | anychart.graphics.vector.Text.FontStyle | string | 'normal' | Font style to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontVariant
Returns:
anychart.graphics.vector.Text.FontVariant | string - Font variant.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value | anychart.graphics.vector.Text.FontVariant | string | 'normal' | Font variant to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
fontWeight
https://www.w3schools.com/cssref/pr_font_weight.asp
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| weight | string | number | 'normal' | Font weight to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
hAlign
Returns:
anychart.graphics.vector.Text.HAlign | string - Text horizontal align.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| align | anychart.graphics.vector.Text.HAlign | string | 'start' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
height
Returns:
number | string | null - The text marker height.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var height = customTextMarker.height();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| height | number | string | null | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
isHorizontal
Note: Any type of Gantt diagram will return "false", because markers in Gantt charts can be only vertical.
Layout is defined by anychart.core.axisMarkers.GanttLine#layout method.
Returns:
boolean - Returns false, because markers in Gantt charts can be only vertical.layout
Returns:
anychart.enums.Layout | string - Vertical layout.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var layoutSettings = customTextMarker.layout();Note: The layout method will not work here, only 'vertical' layout are available in Gantt Chart.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| layout | anychart.enums.Layout | string | 'vertical' | Text marker layout. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.letterSpacing
https://www.w3schools.com/cssref/pr_text_letter-spacing.asp
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| spacing | string | number | 'normal' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
lineHeight
https://www.w3schools.com/cssref/pr_dim_line-height.asp
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| height | string | number | 'normal' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
offsetX
Returns:
number | string - The text marker offset by x.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var offsetX = customTextMarker.offsetX();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| offset | number | string | 0 | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
offsetY
Returns:
number | string - The text marker offset by y.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var offsetY = customTextMarker.offsetY();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| offset | number | string | 0 | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
padding
Returns:
anychart.core.utils.Padding - The text marker padding.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| padding | Array.<(number|string)> | Object | An array of field values to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value1 | string | number | 5 | Top or top-bottom space. |
| value2 | string | number | 10 | Right or right-left space. |
| value3 | string | number | 5 | Bottom space. |
| value4 | string | number | 10 | Left space. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.// 1) top and bottom 10px, left and right 15px textMarker.padding(10, '15px'); // 2) top 10px, left and right 15px, bottom 5px textMarker.padding(10, '15px', 5); // 3) top 10px, right 15px, bottom 5px, left 12px textMarker.padding(10, '15px', '5px', 12);
Try it:
rotation
Returns:
null | number - The gantt text marker rotation.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var rotation = customTextMarker.rotation();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| rotation | number | null | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
scale
Returns:
anychart.scales.GanttDateTime - The gantt text marker scale.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var scaleSettings = customTextMarker.scale();Note: The scale method will not work here, only 'dateTime' scale are available in Gantt Chart. Learn more about scale.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| scale | anychart.scales.GanttDateTime | anychart.scales.GanttDateTime | Scale. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.selectable
Returns:
boolean - The text selectable option.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | Enabled state to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
text
Returns:
string - The gantt text setting.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| text | string | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
textDirection
Returns:
anychart.graphics.vector.Text.Direction | string - Text direction.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| direction | anychart.graphics.vector.Text.Direction | string | 'ltr' | Text direction to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
textIndent
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| indent | number | 0 | Text indent to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
textOverflow
Returns:
anychart.graphics.vector.Text.TextOverflow | string - Text overflow settings.var title = chart.title(); var textOverflow = title.textOverflow();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value | anychart.graphics.vector.Text.TextOverflow | string | "" | Text overflow settings to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
textSettings
Returns:
Object - A copy of settings object.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| name | string | Setting name. |
Returns:
string | number | boolean | undefined - Value of settings.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| objectWithSettings | Object | Settings object. Complete object looks like this:
{
'fontSize': smth,
'fontFamily': smth,
'fontColor': smth,
'fontOpacity': smth,
'fontDecoration': smth,
'fontStyle': smth,
'fontVariant': smth,
'fontWeight': smth,
'letterSpacing': smth,
'textDirection': smth,
'lineHeight': smth,
'textIndent': smth,
'vAlign': smth,
'hAlign': smth,
'wordWrap': smth,
'wordBreak': smth,
'textOverflow': smth,
'selectable': smth,
'useHtml': smth
'textShadow':smth
} |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| name | string | Setting name. |
| settings | string | number | boolean | function | Text settings. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
useHtml
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | Enabled state to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
vAlign
Returns:
anychart.graphics.vector.Text.VAlign | string - Text vertical align.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| align | anychart.graphics.vector.Text.VAlign | string | 'top' | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
value
Returns:
number | anychart.enums.GanttDateTimeMarkers | string - The gantt text marker value.var timeLine = chart.getTimeline(); var customTextMarker = timeLine.textMarker(); var value = customTextMarker.value();
Params:
| Name | Type | Description |
|---|---|---|
| value | number | anychart.enums.GanttDateTimeMarkers | string | Text marker value settings. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
width
Returns:
number | string | null - The text marker width.var timeLine = chart.getTimeline();
var customTextMarker = timeLine.textMarker();
customTextMarker.value('2000-02-27 00:00:00');
var width = customTextMarker.width();Params:
| Name | Type | Default | Description |
|---|---|---|---|
| width | number | string | null | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
wordBreak
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| mode | anychart.enums.WordBreak | string | "normal" | Word-break mode to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
wordWrap
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| mode | anychart.enums.WordWrap | string | 'normal' | Word-wrap mode to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
zIndex
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| zIndex | number | 0 | Value to set. |
Returns:
anychart.core.axisMarkers.GanttText - Self instance for method chaining.Try it:
