AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.charts.Mekko Improve this Doc

Extends: anychart.core.SeparateChart

Mekko chart class.
To get the chart use any of these methods:

Methods Overview

Specific settings
annotations()Creates annotations.
getType()Definition of the chart type.
Axes and Scales
baseline()Set the baseline by the Y-Scale value.
getXAxesCount()Returns the number of X-axes.
getYAxesCount()Returns the number of Y-axes.
lineMarker()Line marker settings.
textMarker()Text marker settings.
xAxis()X-axis settings.
xScale()X-scale settings.
yAxis()Y-axis settings.
yScale()Y-scale settings.
Chart Coloring
dataArea()Data area settings.
hatchFillPalette()Hatch fill palette settings.
palette()Palette settings.
Chart Controls
credits()Credits settings
title()Title settings.
Data
noData()NoData settings.
Export
exports()Exports settings
Interactivity
crosshair()Crosshair settings
tooltip()Tooltip settings.
Point Elements
labels()Labels settings.
maxLabels()Maximum labels settings.
minLabels()Minimum labels settings.
Series
getSeries()Gets series by index.
mekko()Adds Mekko series.
Size and Position
getPlotBounds()Returns data bounds of the chart.
Specific Series Settings
addSeries()Adds series to the chart.
getSeriesAt()Returns series by index.
getSeriesCount()Returns the number of series in a chart.
pointsPadding()Settings for the space between space.
removeAllSeries()Removes all series from chart.
removeSeries()Removes one of series from chart by its id.
removeSeriesAt()Removes one of series from chart by its index.
Miscellaneous
autoRedraw()Redraw chart after changes or not.
data()Getter for the data.

Methods Description

addSeries

Adds series to the chart.

Params:

Name Type Description
var_args anychart.data.View | anychart.data.Set | Array Chart series data.

Returns:

Array.<anychart.core.mekko.series.Mekko> - Array of created series.

Try it:

annotations

Getter for the annotations.

Returns:

anychart.core.annotations.PlotController - The plot annotations.

Try it:

Setter for the annotations.

Params:

Name Type Description
annotationsList Array Annotations list to set.

Returns:

anychart.charts.Mekko - Self instance for method chaining

Try it:

autoRedraw

Getter for the autoRedraw flag.
Flag whether to automatically call chart.draw() on any changes or not.

Returns:

boolean - AutoRedraw flag.
See listing
var autoRedraw = chart.autoRedraw();
Setter for the autoRedraw flag.
Flag whether to automatically call chart.draw() on any changes or not.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

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

Try it:

baseline

Getter for the chart baseline.

Returns:

number - The baseline value by the Y-Scale.
See listing
var chart = anychart.barmekko();
var baseline = chart.baseline();
Setter for the chart baseline.
The baseline is the line relative to which the series with the negative or positive value is drawn and painted over.

Params:

Name Type Description
value number Y-Scale value for the baseline.

Returns:

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

credits

Getter for the credits.

Returns:

anychart.core.ui.ChartCredits - Chart credits.

Try it:

Setter for the chart credits. Learn more about credits settings.

Params:

Name Type Default Description
value Object | boolean | null
true
Credits settings

Returns:

anychart.core.Chart - An instance of the class for method chaining.

crosshair

Getter for crosshair settings.

Returns:

anychart.core.ui.Crosshair - Crosshair settings.

Try it:

Setter for crosshair settings.

Params:

Name Type Default Description
value Object | boolean | null
false
Crosshair settings.

Returns:

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

data

Getter for the data.

Returns:

anychart.data.View - The data view.

Try it:

Setter for the data.

Params:

Name Type Description
value anychart.data.Set | anychart.data.DataSettings | Array Value to set

Returns:

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

dataArea

Getter for the data area settings.

Returns:

anychart.core.ui.DataArea - Data area settings.

Try it:

Setter for the data area settings.
The data area is drawn along the data bounds.

Params:

Name Type Description
settings Object | boolean Data area settings to set.

Returns:

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

exports

Getter for the export charts.

Returns:

anychart.core.utils.Exports - Exports settings.
See listing
var exports = chart.exports();
Setter for the export charts.

Params:

Name Type Description
value Object Export settings.

Returns:

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

Try it:

getPlotBounds

Gets data bounds of the chart.
Note: Works only after anychart.charts.Mekko#draw is called.

Returns:

anychart.math.Rect - Data bounds of the chart.

Try it:

getSeries

Gets series by its id.

Params:

Name Type Description
id number | string Id of the series.

Returns:

anychart.core.mekko.series.Mekko - An instance of the created series.

Try it:

getSeriesAt

Getter for the series by its index.

Params:

Name Type Description
index number Index of the series.

Returns:

anychart.core.mekko.series.Mekko - An instance of the created series.

Try it:

getSeriesCount

Returns the number of series in a chart.

Returns:

number - Number of series.

Try it:

getType

Returns chart type.

Returns:

string - Chart type.

Try it:

getXAxesCount

Returns the number of X-axes.

Returns:

number - Number of X-axes.

getYAxesCount

Returns the number of Y-axes.

Returns:

number - Number of Y-axes.

hatchFillPalette

Getter for hatch fill palette settings.

Returns:

anychart.palettes.HatchFills - Chart hatch fill palette.
See listing
var hatchFillPalette = chart.hatchFillPalette();
Setter for 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.Mekko - Self instance for method chaining.

Try it:

labels

Getter for chart data labels.

Returns:

anychart.core.ui.LabelsFactory - Labels instance.

Try it:

Setter for chart data labels.

Params:

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

Returns:

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

lineMarker

Getter for the line marker.

Params:

Name Type Default Description
index number
0
Chart line marker index. If not set - creates a new instance and adds it to the end of the array.

Returns:

anychart.core.axisMarkers.Line - Line marker instance by index.

Try it:

Setter for the line marker settings.

Params:

Name Type Default Description
value Object | boolean | null
false
Chart line marker settings to set.

Returns:

anychart.charts.Mekko - Self instance for method chaining.
Setter for the line marker settings by index.

Params:

Name Type Default Description
index number
0
Chart line marker index.
value Object | boolean | null
Chart line marker settings to set.

Returns:

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

maxLabels

Getter for maximum labels.

Returns:

anychart.core.ui.LabelsFactory - Labels instance.

Try it:

Setter for maximum labels.

Params:

Name Type Description
value Object | boolean | null Maximum labels settings.

Returns:

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

mekko

Adds Mekko series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array Data for the series.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.core.mekko.series.Mekko - An instance of the created series.

Try it:

minLabels

Getter for minimum labels.

Returns:

anychart.core.ui.LabelsFactory - Labels instance.

Try it:

Setter for minimum labels.

Params:

Name Type Description
value Object | boolean | null Minimum labels settings.

Returns:

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

noData

Getter for noData settings.

Returns:

anychart.core.NoDataSettings - NoData settings.

Try it:

Setter for noData settings.
Learn more about "No data" feature

Params:

Name Type Description
value Object NoData settings.

Returns:

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

Try it:

palette

Getter for the series colors palette.
See listing
var palette = chart.palette();
Setter for the series colors palette. Note: You can use predefined palettes from anychart.palettes.

Params:

Name Type Description
value anychart.palettes.RangeColors | anychart.palettes.DistinctColors | Object | Array.<string> Value to set.

Returns:

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

pointsPadding

Getter for points padding.

Returns:

number - Points padding
See listing
var pointsPadding = chart.pointsPadding();
Setter for points padding.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

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

Try it:

removeAllSeries

Removes all series from chart.

Returns:

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

Try it:

removeSeries

Removes one of series from chart by its id.

Params:

Name Type Description
id number | string Series id.

Returns:

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

Try it:

removeSeriesAt

Removes one of series from chart by its index.

Params:

Name Type Description
index number Series index.

Returns:

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

Try it:

textMarker

Getter for the text marker.

Params:

Name Type Default Description
index number
0
Chart text marker index. If not set - creates a new instance and adds it to the end of the array.

Returns:

anychart.core.axisMarkers.Text - Text marker instance by index.

Try it:

Setter for the text marker.

Params:

Name Type Default Description
value Object | boolean | null
false
Chart text marker settings to set.

Returns:

anychart.charts.Mekko - Self instance for method chaining.
Setter for the text marker by index.

Params:

Name Type Default Description
index number
0
Chart text marker index.
value Object | boolean | null
Chart text marker settings to set.

Returns:

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

title

Getter for the chart title.

Returns:

anychart.core.ui.Title - Chart title.

Try it:

Setter for the chart title.

Params:

Name Type Default Description
value null | boolean | Object | string
false
Chart title text or title instance for copy settings from.

Returns:

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

tooltip

Getter for the chart tooltip.

Returns:

anychart.core.ui.Tooltip - Tooltip instance.
Example
var tooltipSettings = chart.tooltip();
Setter for the chart tooltip.

Params:

Name Type Description
tooltipSettings Object | boolean | null Tooltip settings to set.

Returns:

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

xAxis

Getter for chart X-axis.

Params:

Name Type Default Description
index number
0
Chart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axes.Linear - Axis instance by index.

Try it:

Setter for chart X-axis.

Params:

Name Type Default Description
value Object | boolean | null
true
Chart axis settings to set.

Returns:

anychart.charts.Mekko - Self instance for method chaining.
Setter for chart X-axis by index.

Params:

Name Type Default Description
index number
0
Chart axis index.
value Object | boolean | null
Chart axis settings to set.

Returns:

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

xScale

Getter for default chart X scale.

Returns:

anychart.scales.Ordinal - Default chart scale value.

Try it:

Setter for default chart X scale.

Params:

Name Type Default Description
value Object | anychart.enums.ScaleTypes | string | anychart.scales.Ordinal
anychart.scales.Ordinal
X Scale to set.

Returns:

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

Try it:

yAxis

Getter for chart Y-axis.

Params:

Name Type Default Description
index number
0
Chart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axes.Linear - Axis instance by index.

Try it:

Setter for chart Y-axis.

Params:

Name Type Default Description
value Object | boolean | null
true
Chart axis settings to set.

Returns:

anychart.charts.Mekko - Self instance for method chaining.
Setter for chart Y-axis by index.

Params:

Name Type Default Description
index number
0
Chart axis index.
value Object | boolean | null
Chart axis settings to set.

Returns:

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

yScale

Getter for default chart Y scale.

Returns:

anychart.scales.Base - Default chart scale value.

Try it:

Setter for default chart Y scale.

Params:

Name Type Default Description
value Object | anychart.enums.ScaleTypes | string | anychart.scales.Base
anychart.scales.Linear
Y Scale to set.

Returns:

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

Try it: