Top
You are looking at an outdated 7.7.0 version of this document. Switch to the 8.0.1 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

Specific settings
connectorLength()Labels connector length.
getType()Definition of the chart type.
overlapMode()Overlap mode for labels.
pointsPadding()Padding between points.
Chart Coloring
hatchFillPalette()Hatch fill palette settings.
markerPalette()Markers palette settings.
palette()Palette settings.
Coloring
connectorStroke()Labels connector stroke settings.
fill()Fill settings.
hatchFill()Hatch fill settings.
hoverFill()Fill settings on hover state.
hoverHatchFill()Hatch fill settings on hover state.
hoverStroke()Stroke settings on hover state.
selectFill()Fill settings in selected state.
selectHatchFill()Hatch fill settings in selected state.
selectStroke()Stroke settings in selected state.
stroke()Stroke settings.
Data
data()Data settings.
Interactivity
hover()Hover state of the slice.
select()Imitation selecting a point.
tooltip()Tooltip settings.
unhover()Removal of hover state from all chart points.
unselect()Deselects all points.
Point Elements
hoverLabels()Labels settings on hover state.
hoverMarkers()Markers settings on hover state.
labels()Labels settings.
markers()Markers settings.
selectLabels()Labels settings in selected mode.
selectMarkers()Markers settings in selected mode.
Size and Position
baseWidth()Width settings.
reversed()Reverses pyramid

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
"#7c868e"
Stroke settings.
thickness number
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 Default Description
value Object | boolean | null
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.charts.Pyramid - Self instance for method chaining.

Try it:

select

Imitates selection a point of the series by its index. Note: Works only after anychart.charts.Pyramid#draw is called.

Params:

Name Type Description
index number Index of the point to select.

Returns:

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

Try it:

Imitates selection a points of the series by several indexes. Note: Works only after anychart.charts.Pyramid#draw is called.

Params:

Name Type Description
indexes Array.<number> Array of indexes of the point to select.

Returns:

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

Try it:

selectFill

Getter for the funnel points fill in selected state.

Returns:

anychart.graphics.vector.Fill function - The current fill in selected state.
Setter for the funnel points fill in selected state. Press "ctrl" or "shift" and click on the slice to enable mode of multiple select slices. Learn more about coloring.

Params:

Name Type Default Description
function function
// return the fill from the default pallete.
function() {
   return this.sourceColor;
};
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:

Sets fill settings in selected state using an array or a string. Learn more about coloring.

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
undefined
Color as an object or a string.

Returns:

anychart.charts.Pyramid - Self instance for method chaining.
Fill color in selected state with opacity.
Fill as a string or an object.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

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

Try it:

Linear gradient fill in selected state. 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.charts.Pyramid - Self instance for method chaining.

Try it:

Radial gradient fill in selected state. 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.charts.Pyramid - Self instance for method chaining.

Try it:

Image fill in selected state. Learn more about coloring.

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

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

Try it:

selectHatchFill

Getter for the current hatch fill settings in selected state.

Returns:

anychart.graphics.vector.PatternFill anychart.graphics.vector.HatchFill function boolean - The current hatch fill.
Setter for the hatch fill settings in selected state.

Params:

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

Returns:

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

Try it:

selectLabels

Gets the current series select data labels.

Returns:

anychart.core.ui.LabelsFactory - Labels instance.

Try it:

Sets the series select data labels.

Params:

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

Returns:

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

selectMarkers

Gets the current series select data markers.

Returns:

anychart.core.ui.MarkersFactory - Markers instance.

Try it:

Sets series select data markers.

Params:

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

Returns:

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

selectStroke

Gets funnel points stroke in selected state.

Returns:

anychart.graphics.vector.Stroke function - Current stroke in the normal state.
Sets funnel points stroke in selected state using function. Learn more about stroke settings.

Params:

Name Type Default Description
function function
// return stroke from the default pallete.
function() {
  return anychart.color.darken(this.sourceColor);
};
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:

Sets funnel points stroke in selected state using several parameters.

Params:

Name Type Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null Stroke settings.
thickness number 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:

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:

unselect

Deselects all points. Note: Works only after anychart.charts.Pyramid#draw is called.

Returns:

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

Try it: