The chart subtitle. The subtitle has an update method that
allows modifying the options directly or indirectly via
chart.update.
Extends
Members
-
element :Highcharts.SVGDOMElement|Highcharts.HTMLDOMElement
-
The primary DOM node. Each
SVGElementinstance wraps a main DOM node, but may also represent more nodes.Type:
- Inherited From:
-
renderer :Highcharts.SVGRenderer
-
The renderer that the SVGElement belongs to.
Type:
- Inherited From:
Methods
-
add( [parent])
-
Add the element to the DOM. All elements must be added this way.
Parameters:
Name Type Argument Description parentHighcharts.SVGElement <optional>
The parent item to add it to. If undefined, the element is added to the Highcharts.SVGRenderer.box.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
Try it
-
addClass(className [, replace])
-
Add a class name to an element.
Parameters:
Name Type Argument Default Description classNamestring The new class name to add.
replaceboolean <optional>
false When true, the existing class name(s) will be overwritten with the new one. When false, the new one is added.
- Inherited From:
Returns:
Highcharts.SVGElement .Return the SVG element for chainability.
-
align( [alignOptions] [, alignByTranslate] [, box])
-
Align the element relative to the chart or another box.
Parameters:
Name Type Argument Description alignOptionsHighcharts.AlignObject <optional>
The alignment options. The function can be called without this parameter in order to re-align an element after the box has been updated.
alignByTranslateboolean <optional>
Align element by translation.
boxstring | Highcharts.BBoxObject <optional>
The box to align to, needs a width and height. When the box is a string, it refers to an object in the Renderer. For example, when box is
spacingBox, it refers toRenderer.spacingBoxwhich holdswidth,height,xandyproperties.- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
-
animate(params [, options] [, complete])
-
Animate to given attributes or CSS properties.
Parameters:
Name Type Argument Description paramsHighcharts.SVGAttributes SVG attributes or CSS to animate.
optionsboolean | Partial.<Highcharts.AnimationOptionsObject> <optional>
Animation options.
completefunction <optional>
Function to perform at the end of animation.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
Try it
-
attr(key)
-
Parameters:
Name Type Description keystring - Inherited From:
- Overrides:
Returns:
-
clip( [clipRect])
-
Apply a clipping rectangle to this element.
Parameters:
Name Type Argument Description clipRectHighcharts.ClipRectElement <optional>
The clipping rectangle. If skipped, the current clip is removed.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVG element to allow chaining.
-
crisp(rect [, strokeWidth])
-
Calculate the coordinates needed for drawing a rectangle crisply and return the calculated attributes.
Parameters:
Name Type Argument Description rectHighcharts.RectangleObject Rectangle to crisp.
strokeWidthnumber <optional>
The stroke width to consider when computing crisp positioning. It can also be set directly on the rect parameter.
- Inherited From:
Returns:
Highcharts.RectangleObject .The modified rectangle arguments.
-
css(styles)
-
Set styles for the element. In addition to CSS styles supported by native SVG and HTML elements, there are also some custom made for Highcharts, like
width,ellipsisandtextOverflowfor SVG text elements.Parameters:
Name Type Description stylesHighcharts.CSSObject The new CSS styles.
- Inherited From:
Returns:
Highcharts.SVGElement .Return the SVG element for chaining.
Try it
-
destroy()
-
Destroy the element and element wrapper and clear up the DOM and event hooks.
- Inherited From:
-
fadeIn( [animation])
-
A general fadeIn method.
Parameters:
Name Type Argument Description animationboolean | Partial.<Highcharts.AnimationOptionsObject> <optional>
The animation options for the element fade.
- Inherited From:
Requires:
- module:modules/drilldown
-
fadeOut( [duration])
-
Fade out an element by animating its opacity down to 0, and hide it on complete. Used internally for the tooltip.
Parameters:
Name Type Argument Default Description durationnumber <optional>
150 The fade duration in milliseconds.
- Inherited From:
-
getBBox( [reload] [, rot])
-
Get the bounding box (width, height, x and y) for the element. Generally used to get rendered text size. Since this is called a lot in charts, the results are cached based on text properties, in order to save DOM traffic. The returned bounding box includes the rotation, so for example a single text line of rotation 90 will report a greater height, and a width corresponding to the line-height.
Parameters:
Name Type Argument Description reloadboolean <optional>
Skip the cache and get the updated DOM bouding box.
rotnumber <optional>
Override the element's rotation. This is internally used on axis labels with a value of 0 to find out what the bounding box would be have been if it were not rotated.
- Inherited From:
Returns:
Highcharts.BBoxObject .The bounding box with
x,y,widthandheightproperties.Try it
-
getStyle(prop)
-
Get the computed style. Only in styled mode.
Parameters:
Name Type Description propstring The property name to check for.
- Inherited From:
Returns:
string .The current computed value.
Example
chart.series[0].points[0].graphic.getStyle('stroke-width'); // => '1px' -
hasClass(className)
-
Check if an element has the given class name.
Parameters:
Name Type Description classNamestring The class name to check for.
- Inherited From:
Returns:
boolean .Whether the class name is found.
-
hide( [hideByTranslation])
-
Hide the element, similar to setting the
visibilityattribute tohidden.Parameters:
Name Type Argument Default Description hideByTranslationboolean <optional>
false The flag to determine if element should be hidden by moving out of the viewport. Used for example for dataLabels.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
-
init(renderer, nodeName)
-
Initialize the SVG element. This function only exists to make the initialization process overridable. It should not be called directly.
Parameters:
Name Type Description rendererHighcharts.SVGRenderer The SVGRenderer instance to initialize to.
nodeNamestring The SVG node name.
- Inherited From:
-
invert(inverted)
-
Invert a group, rotate and flip. This is used internally on inverted charts, where the points and graphs are drawn as if not inverted, then the series group elements are inverted.
Parameters:
Name Type Description invertedboolean Whether to invert or not. An inverted shape can be un-inverted by setting it to false.
- Inherited From:
Returns:
Highcharts.SVGElement .Return the SVGElement for chaining.
-
on(eventType, handler)
-
Add an event listener. This is a simple setter that replaces all other events of the same type, opposed to the Highcharts#addEvent function.
Parameters:
Name Type Description eventTypestring The event type. If the type is
click, Highcharts will internally translate it to atouchstartevent on touch devices, to prevent the browser from waiting for a click event from firing.handlerfunction The handler callback.
- Inherited From:
Returns:
Highcharts.SVGElement .The SVGElement for chaining.
Try it
-
removeClass(className)
-
Remove a class name from the element.
Parameters:
Name Type Description classNamestring | RegExp The class name to remove.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVG element for chainability.
-
setRadialReference(coordinates)
-
Set the coordinates needed to draw a consistent radial gradient across a shape regardless of positioning inside the chart. Used on pie slices to make all the slices have the same radial reference point.
Parameters:
Name Type Description coordinatesArray.<number> The center reference. The format is
[centerX, centerY, diameter]in pixels.- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
-
shadow( [shadowOptions] [, group] [, cutOff])
-
Add a shadow to the element. Must be called after the element is added to the DOM. In styled mode, this method is not used, instead use
defsand filters.Parameters:
Name Type Argument Description shadowOptionsboolean | Highcharts.ShadowOptionsObject <optional>
The shadow options. If
true, the default options are applied. Iffalse, the current shadow will be removed.groupHighcharts.SVGElement <optional>
The SVG group element where the shadows will be applied. The default is to add it to the same parent as the current element. Internally, this is ised for pie slices, where all the shadows are added to an element behind all the slices.
cutOffboolean <optional>
Used internally for column shadows.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
Example
renderer.rect(10, 100, 100, 100) .attr({ fill: 'red' }) .shadow(true); -
show( [inherit])
-
Show the element after it has been hidden.
Parameters:
Name Type Argument Default Description inheritboolean <optional>
false Set the visibility attribute to
inheritrather thanvisible. The difference is that an element withvisibility="visible"will be visible even if the parent is hidden.- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
-
strokeWidth()
-
Get the computed stroke width in pixel values. This is used extensively when drawing shapes to ensure the shapes are rendered crisp and positioned correctly relative to each other. Using
shape-rendering: crispEdgesleaves us less control over positioning, for example when we want to stack columns next to each other, or position things pixel-perfectly within the plot box.The common pattern when placing a shape is:
- Create the SVGElement and add it to the DOM. In styled mode, it will
now receive a stroke width from the style sheet. In classic mode we
will add the
stroke-widthattribute. - Read the computed
elem.strokeWidth(). - Place it based on the stroke width.
- Inherited From:
Returns:
number .The stroke width in pixels. Even if the given stroke widtch (in CSS or by attributes) is based on
emor other units, the pixel size is returned. - Create the SVGElement and add it to the DOM. In styled mode, it will
now receive a stroke width from the style sheet. In classic mode we
will add the
-
toFront()
-
Bring the element to the front. Alternatively, a new zIndex can be set.
- Inherited From:
Returns:
Highcharts.SVGElement .Returns the SVGElement for chaining.
Try it
-
translate(x, y)
-
Move an object and its children by x and y values.
Parameters:
Name Type Description xnumber The x value.
ynumber The y value.
- Inherited From:
Returns:
-
update(subtitleOptions [, redraw])
-
Modify options for the subtitle.
Parameters:
Name Type Argument Default Description subtitleOptionsHighcharts.SubtitleOptions Options to modify.
redrawboolean <optional>
true Whether to redraw the chart after the subtitle is altered. If doing more operations on the chart, it is a good idea to set redraw to false and call Highcharts.Chart#redraw after.