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.core.stock.Plot Improve this Doc

Extends: anychart.core.VisualBaseWithBounds

Stock Plot class.

Methods Overview

Axes and Scales
grid()Grid settings.
minorGrid()Minor grid settings.
xAxis()X-axis settings.
yAxis()Y-axis settings.
yScale()Y-scale settings.
Coloring
background()Background settings.
dateTimeHighlighter()Highlighter settings.
Series
column()Addition of the column series.
getSeries()Gets series by index.
line()Addition of the line series.
ohlc()Addition of the OHLC series.

Methods Description

background

Getter for the current plot background.

Returns:

anychart.core.ui.Background - The current chart background.

Try it:

Setter for the plot background.

Params:

Name Type Description
value string | Object | null | boolean Background settings.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

column

Creates and returns a new column series.

Params:

Name Type Description
data anychart.data.TableMapping | anychart.data.Table | Array.<Array.<*>> | string Value to set.
mappingSettings Object.<({column: number, type: anychart.enums.AggregationType, weights: number}|number)> An object where keys are field names and values are objects with fields: - 'column': number - Column index, that the field should get values from; - 'type': anychart.enums.AggregationType - How to group values for the field. Defaults to 'close'. - 'weights': number - Column to get weights from for 'weightedAverage' grouping type. Note: If type set to 'weightedAverage', but opt_weightsColumn is not passed - uses 'average' grouping instead. or numbers - just the column index to get values from. In this case the grouping type will be set to 'close'.
csvSettings Object CSV parser settings if the string is passed.

Returns:

anychart.core.stock.series.Base - An instance of class for method chaining.

Try it:

dateTimeHighlighter

Getter for the current highlighter.

Returns:

anychart.graphics.vector.Stroke - The current highlighter.

Try it:

Setter for the highlighter.

Params:

Name Type Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null Stroke settings
thickness number Line thickness. If empty - set to 1.
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 Style of line cap.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

Try it:

getSeries

Gets series by index.

Params:

Name Type Description
index number Series index

Returns:

anychart.core.stock.series.Base - An instance of class for method chaining.

Try it:

grid

Getter for the current plot grid.

Params:

Name Type Description
index number Grid index.

Returns:

anychart.core.grids.Stock - Grid instance by index.

Try it:

Setter for the plot grid.

Params:

Name Type Description
value Object | boolean | null Grid settings to set.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.
Setter for the plot grid by index.

Params:

Name Type Description
index number Grid index.
value Object | boolean | null Grid settings to set.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

line

Creates and returns a new line series.

Params:

Name Type Description
data anychart.data.TableMapping | anychart.data.Table | Array.<Array.<*>> | string Value to set.
mappingSettings Object.<({column: number, type: anychart.enums.AggregationType, weights: number}|number)> An object where keys are field names and values are objects with fields: - 'column': number - Column index, that the field should get values from; - 'type': anychart.enums.AggregationType - How to group values for the field. Defaults to 'close'. - 'weights': number - Column to get weights from for 'weightedAverage' grouping type. Note: If type set to 'weightedAverage', but opt_weightsColumn is not passed - uses 'average' grouping instead. or numbers - just the column index to get values from. In this case the grouping type will be set to 'close'.
csvSettings Object CSV parser settings if the string is passed.

Returns:

anychart.core.stock.series.Base - An instance of class for method chaining.

Try it:

minorGrid

Getter for the current plot grid.

Params:

Name Type Description
index number Minor grid index.

Returns:

anychart.core.grids.Stock - Minor grid instance by index.

Try it:

Setter for the plot grid.

Params:

Name Type Description
value Object | boolean | null Minor grid settings to set.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.
Setter for the plot grid by index.

Params:

Name Type Description
indexOrValue number Minor grid index.
value Object | boolean | null Minor grid settings to set.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

ohlc

Creates and returns a new ohlc series.

Params:

Name Type Description
data anychart.data.TableMapping | anychart.data.Table | Array.<Array.<*>> | string Value to set.
mappingSettings Object.<({column: number, type: anychart.enums.AggregationType, weights: number}|number)> An object where keys are field names and values are objects with fields: - 'column': number - Column index, that the field should get values from; - 'type': anychart.enums.AggregationType - How to group values for the field. Defaults to 'close'. - 'weights': number - Column to get weights from for 'weightedAverage' grouping type. Note: If type set to 'weightedAverage', but opt_weightsColumn is not passed - uses 'average' grouping instead. or numbers - just the column index to get values from. In this case the grouping type will be set to 'close'.
csvSettings Object CSV parser settings if the string is passed.

Returns:

anychart.core.stock.series.Base - An instance of class for method chaining.

Try it:

xAxis

Getter for the current X-axis.

Returns:

anychart.core.axes.StockDateTime - Axis instance.

Try it:

Setter for the X-axis.

Params:

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

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

yAxis

Getter for the current plot Y-axis.

Params:

Name Type Description
index number Axis index.

Returns:

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

Try it:

Setter for the plot Y-axis.

Params:

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

Returns:

anychart.core.stock.Plot - Self instance for method chaining.
Setter for the Y-axis by index.

Params:

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

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

yScale

Getter for the default plot Y-scale.

Returns:

anychart.scales.ScatterBase - Default chart scale value.
See listing
var myPlot = chart.plot();
myPlot.yScale();
Setter for the plot Y-scale.

Params:

Name Type Description
value anychart.enums.ScatterScaleTypes | anychart.scales.ScatterBase Y-scale to set.

Returns:

anychart.core.stock.Plot - Self instance for method chaining.

Try it: