Top
You are looking at an outdated 7.5.0 version of this document. Switch to the 7.14.3 version to see the up to date information.

class anychart.charts.Pyramid Improve this Doc

Extends: anychart.core.SeparateChart

Pyramid Chart Class.
Note: Use method anychart.pyramid to get an instance of this class:

Methods Overview

Miscellaneous
baseWidth()Getter for the current width.
connectorLength()Getter for outside labels connector length.
connectorStroke()Getter for outside labels connectors stroke settings.
data()Gets current chart data.
fill()Getter for the pyramid points fill in normal state.
getType()Returns chart type.
hatchFill()Getter for current hatch fill settings.
hatchFillPalette()Getter for chart hatch fill palette settings.
hover()Sets the hover state on a slice by index.
hoverFill()Getter for the pyramid points fill in the hover state.
hoverHatchFill()Getter for current hover hatch fill settings.
hoverLabels()Getter for the pyramid hover data labels.
hoverMarkers()Getter for pyramid points data markers on hover.
hoverStroke()Getter for the pyramid points stroke in the hover state.
labels()Getter for the current pyramid labels.
markerPalette()Getter for chart markers palette settings.
markers()Getter for data markers.
overlapMode()Getter for overlap mode for labels.
palette()Getter for the current pyramid palette.
pointsPadding()Getter for the padding between points.
reversed()Getter for the flag of reverse pyramid.
stroke()Getter for the pyramid points stroke in the normal state.
tooltip()Getter for tooltip settings.
unhover()Removes hover from all chart points.

Methods Description

baseWidth

Getter for the current width.

Returns:

string number - The current width.
Setter for the width.

Params:

Name Type Default Description
value string | number
'90%'
Value to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

connectorLength

Getter for outside labels connector length.

Returns:

number string null - Outside labels connector length.

Try it:

Setter for outside labels connector length.

Params:

Name Type Default Description
value number | string
20
Value to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

connectorStroke

Getter for outside labels connectors stroke settings.

Returns:

anychart.graphics.vector.Stroke function - Current stroke settings.
Setter for outside labels connectors stroke settings. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
'black'
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

data

Gets current chart data.

Returns:

anychart.data.View - The current data view.

Try it:

Sets data for the current chart.

Params:

Name Type Description
value anychart.data.View | anychart.data.Mapping | anychart.data.Set | Array | string Value to set.
csvSettings Object.<string, (string|boolean)> If CSV string is passed by first param, you can pass CSV parser settings here as a hash map.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

fill

Getter for the pyramid points fill in normal state.

Returns:

anychart.graphics.vector.Fill function - Current fill in the normal state.
Setter for the pyramid points fill in the normal state. Learn more about coloring.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill | function
// return the fill from the default pallete.
function() {
  return this.sourceColor;
};
or Fill, or fill-function, which should look like this:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Fill - fill of the current point // } return myFill; //anychart.graphics.vector.Fill };.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

getType

Returns chart type.

Returns:

anychart.enums.ChartTypes - Current chart type.

Try it:

hatchFill

Getter for current hatch fill settings.
Setter for hatch fill settings. Learn more about hatch fill settings.

Params:

Name Type Default Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string | boolean
false
PatternFill or HatchFill instance or type of hatch fill.
color string
Color.
thickness number
Thickness.
size number
Pattern size.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

hatchFillPalette

Getter for chart hatch fill palette settings.

Returns:

anychart.palettes.HatchFills - Current chart hatch fill palette.
Setter for chart hatch fill palette settings.

Params:

Name Type Description
value Array.<anychart.graphics.vector.HatchFill.HatchFillType> | Object | anychart.palettes.HatchFills Chart hatch fill palette settings to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

hover

Sets the hover state on a slice by index.

Params:

Name Type Description
index number Slice index.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

hoverFill

Getter for the pyramid points fill in the hover state.

Returns:

anychart.graphics.vector.Fill function - Current fill in the hover state.
Setter for the pyramid points fill in the hover state. Learn more about coloring.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill | function
// return lighter fill of the default pallete.
function() {
  return anychart.color.lighten(this.sourceColor);
};
or Fill, or fill-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Fill - fill of the current point // } return myFill; //anychart.graphics.vector.Fill };.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

hoverHatchFill

Getter for current hover hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill anychart.graphics.vector.HatchFill function - Current hover hatch fill.
Setter for hover hatch fill settings. Learn more about hatch fill settings.

Params:

Name Type Default Description
patternFillOrType anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string | boolean
false
PatternFill or HatchFill instance or type of hatch fill.
color string
Color.
thickness number
Thickness.
size number
Pattern size.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

hoverLabels

Getter for the pyramid hover data labels.

Returns:

anychart.core.ui.LabelsFactory - Current labels instance.

Try it:

Setter for the pyramid hover data labels.

Params:

Name Type Description
value Object | boolean | null Pyramid hover data labels settings.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

hoverMarkers

Getter for pyramid points data markers on hover.

Returns:

anychart.core.ui.MarkersFactory - Markers instance.

Try it:

Setter for pyramid points data markers on hover.

Params:

Name Type Description
value Object | boolean | null | string Series data markers settings.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

hoverStroke

Getter for the pyramid points stroke in the hover state.

Returns:

anychart.graphics.vector.Stroke function - Current stroke in the hover state.
Setter for the pyramid points stroke in the hover state. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | function
// return stroke from the default pallete.
function() {
  return anychart.color.darken(this.sourceColor);
};
or Stroke, or stroke-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Stroke - stroke of the current point // } return myStroke; //anychart.graphics.vector.Stroke };.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

Setter for the pyramid points stroke in the hover state. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

labels

Getter for the current pyramid labels.

Returns:

anychart.core.ui.LabelsFactory - LabelsFactory instance.

Try it:

Setter for the pyramid labels.

Params:

Name Type Default Description
value Object | boolean | null
true
Chart data labels settings.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

markerPalette

Getter for chart markers palette settings.

Returns:

anychart.palettes.Markers - The current chart markers palette.
Setter for chart markers palette settings.

Params:

Name Type Description
value anychart.palettes.Markers | Object | Array.<anychart.enums.MarkerType> Chart marker palette settings to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

markers

Getter for data markers.

Returns:

anychart.core.ui.MarkersFactory - Markers instance.

Try it:

Setter for data markers.

Params:

Name Type Default Description
value Object | boolean | null | string
false
Data markers settings.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

overlapMode

Getter for overlap mode for labels.

Returns:

anychart.enums.LabelsOverlapMode - Overlap mode flag.

Try it:

Setter for overlap mode for labels.

Params:

Name Type Default Description
value anychart.enums.LabelsOverlapMode | string | boolean
'noOverlap'
Value to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

palette

Getter for the current pyramid palette.
Setter for the pyramid palette.

Params:

Name Type Description
value anychart.palettes.RangeColors | anychart.palettes.DistinctColors | Object | Array.<string> Color palette instance.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

pointsPadding

Getter for the padding between points.

Returns:

string number - Current padding.
Setter for the padding between points.

Params:

Name Type Default Description
value string | number
5
Value to set.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

reversed

Getter for the flag of reverse pyramid.

Returns:

boolean - The current flag.
Sets the flag of reverse pyramid.

Params:

Name Type Default Description
value boolean
false
Flag to set.

Returns:

anychart.core.Pyramid - Self instance for method chaining.

Try it:

stroke

Getter for the pyramid points stroke in the normal state.

Returns:

anychart.graphics.vector.Stroke function - Current stroke in the normal state.
Setter for the pyramid points stroke in the normal state. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | function
// return stroke from the default pallete.
function() {
  return anychart.color.darken(this.sourceColor);
};
or Stroke, or stroke-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Stroke - stroke of the current point // } return myStroke; //anychart.graphics.vector.Stroke };.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

Setter for the pyramid points stroke in the normal state. Learn more about stroke settings.

Params:

Name Type Default Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it:

tooltip

Getter for tooltip settings.

Returns:

anychart.core.ui.Tooltip - Tooltip instance.

Try it:

Setter for tooltip settings.

Params:

Name Type Default Description
value Object | boolean | null
true
Tooltip settings.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

unhover

Removes hover from all chart points.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.

Try it: