Instance API â
getDom(paneId, position) â
(paneId?: string, position?: 'root' | 'main' | 'yAxis') => HTMLElement
Get the dom container.
paneId
window id, the default is the entire chart containerposition
supportsroot
,main
,yAxis
, the default isroot
getSize(paneId, position) â
(paneId?: string, position?: 'root' | 'main' | 'yAxis') => {
width: number
height: number
left: number
top: number
right: number
bottom: number
}
Get the dimensions.
paneId
window id, the default is the entire chart containerposition
position, supportsroot
,main
,yAxis
, the default isroot
setStyles(styles) â
(styles: string | object) => HTMLElement
Set style configuration.
styles
style configuration, which can be the style name registered throughregisterStyles
. When it is an object, please refer to styles for details, and it supports merging.
getStyles() â
() => object
Get the style configuration, return the complete type refer to styles.
setPriceVolumePrecision(pricePrecision, volumePrecision) â
(pricePrecision: number, volumePrecision: number) => void
Setting the price and volume precision, while the technical indicator series is 'price' or 'volume' will also be affected.
pricePrecision
price precisionvolumePrecision
volume precision
setTimezone(timezone) â
(timezone: string) => void
Set the time zone.
timezone
time zone name, such as 'Asia/Shanghai', if not set, it will automatically get the local time zone, please refer to Time Zone List.
getTimezone() â
() => string
Get the chart time zone name.
setZoomEnabled(enabled) â
(enabled: boolean) => void
Set whether to scale.
isZoomEnabled() â
() => boolean
Whether it can be scaled.
setScrollEnabled(enabled) â
(enabled: boolean) => void
Set whether dragging and scrolling is possible.
isScrollEnabled() â
() => boolean
Whether dragging and scrolling is possible.
setOffsetRightDistance(distance) â
(distance: number) => void
Set the gap that can be left to the right of the chart.
getOffsetRightDistance() ^9.2.0 â
() => number
Get the gap that can be left to the right of the chart.
setMaxOffsetLeftDistance() ^9.7.0 â
(distance: number) => void
Set the maximum available gap on the left side of the chart.
setMaxOffsetRightDistance() ^9.7.0 â
(distance: number) => void
Set the maximum available gap on the right side of the chart.
setLeftMinVisibleBarCount(barCount) â
(barCount: number) => void
Set the minimum number of visible candles to the left.
setRightMinVisibleBarCount(barCount) â
(barCount: number) => void
Set the minimum number of visible candles to the right.
setBarSpace(space) â
(space: number) => void
Set the width of a single candlestick of the chart.
getBarSpace() â
() => number
Gets the width of a single candlestick on the chart.
getVisibleRange() â
() => {
from: number
to: number
realFrom: number
realTo: number
}
Get visible range.
applyNewData(dataList, more, callback) â
(
dataList: Array<{
timestamp: number
open: number
close: number
high: number
low: number
volume?: number
turnover?: number
}>,
more?: boolean,
callback?: () => void
) => void
Add new data, this method will clear the chart data, no need to call the clearData method additionally.
dataList
is an array of K-line data. For details of the data type, please refer to datamore
tells the chart whether there is more historical data, can be defaulted, the default is truecallback
success callback ^9.2.0
Note
callback
has been deprecated since version 9.8.0, use subscribeAction('onDataReady', () => {})
instead.
applyMoreData(dataList, more, callback) â
(
dataList: Array<{
timestamp: number
open: number
close: number
high: number
low: number
volume?: number
turnover?: number
}>,
more?: boolean,
callback?: () => void
) => void
Add more historical data.
dataList
is an array of K-line data. For details of the data type, please refer to datamore
tells the chart whether there is more historical data, can be defaulted, the default is truecallback
success callback ^9.2.0
Note
This api has been deprecated since version 9.8.0.
updateData(data, callback) â
(
data: {
timestamp: number
open: number
close: number
high: number
low: number
volume?: number
turnover?: number
},
callback?: () => void
) => void
Update data. Currently, only the timestamp of the last piece of data will be matched. If it is the same, it will be overwritten, and if it is different, it will be appended.
data
single k-line data, please refer to data for details of data typecallback
success callback ^9.2.0
Note
callback
has been deprecated since version 9.8.0, use subscribeAction('onDataReady', () => {})
instead.
getDataList() â
() => Array<{
timestamp: number
open: number
close: number
high: number
low: number
volume?: number
turnover?: number
}>
Get the current data source of the chart. For the returned data type, please refer to data.
clearData() â
() => void
Clear the data of the chart. Generally, it is not necessary to call it manually. In order to avoid repeated drawing, the data is only cleared here, and the chart will not be redrawn.
loadMore(cb) â
(cb: (timestamp: number | null) => void) => void
Set load more callback function.
cb
is a callback method,timestamp
is the timestamp of the first piece of data
Note
This api has been deprecated since version 9.8.0, use setLoadDataCallback
instead.
setLoadDataCallback(cb) ^9.8.0 â
(
cb: (params: {
type: 'forward' | 'backward'
data: Nullable<KLineData>
callback: (dataList: KLineData[], more?: boolean) => void
}) => void
) => void
Set auto load data callback
cb
callbackparams
paramstype
forward or backwarddata
boundary datacallback
used for returning data to chart
createIndicator(value, isStack, paneOptions, callback) â
(
value: string | {
name: string
shortName?: string
precision?: number
calcParams?: any[]
shouldOhlc?: boolean
shouldFormatBigNumber?: boolean
visible?: boolean
zLevel?: number
extendData?: any
series?: 'normal' | 'price' | 'volume'
figures?: Array<{
key: string
title?: string
type?: string
baseValue?: number
attrs?: ({
data: object
coordinate: object
bounding: object
barSpace: object
xAxis: object
yAxis: object
}) => object
styles?: (
data: object,
indicator: object,
defaultStyles: object
) => ({
style?: 'solid' | 'dashed' | 'stroke' | 'fill' | 'stroke_fill'
color?: string
})
}>
minValue?: number
maxValue?: number
styles?: object
calc?: (dataList: KLineData[], indicator: object) => Promise<object[]> | object[]
regenerateFigures?: (calcParms: any[]) => Array<{
key: string
title?: string
type?: string
baseValue?: number
styles?: (
data: object,
indicator: object,
defaultStyles: object
) => ({
style?: 'solid' | 'dashed' | 'stroke' | 'fill' | 'stroke_fill'
color?: string
})
}>
createTooltipDataSource?: (params: object) => ({
name?: string
calcParamsText?: string
values?: Array<{
title: string | {
text: string
color: string
}
value: string | {
text: string
color: string
}
}>
})
draw?: (params: object) => boolean
},
isStack?: boolean,
paneOptions?: {
id?: string
height?: number
minHeight?: number
dragEnabled?: boolean
position?: 'top' | 'bottom'
gap?: {
top?: number
bottom?: number
}
axisOptions?: {
name?: string
scrollZoomEnabled?: boolean
}
} | null,
callback?: () => void
) => string | null
Create a technical indicator, the return value is a string that identifies the window, which is very important, and this identification is required for some subsequent operations on the window.
value
technical indicator name or technical indicator object, when it is an object, the type is consistent with the input parameter of the chart methodoverrideIndicator
isStack
is overridespaneOptions
window configuration information, can be defaultid
window id, can be defaultheight
window height, can be defaultminHeight
minimum height of the window, can be defaulteddragEnabled
Whether the window can be dragged to adjust the height, it can be defaultedposition
Only valid when creating a new pane ^9.6.0gap
marginstop
top margin, value less than 1 is a percentagebottom
bottom margin, value less than 1 is a percentage
axisOptions
name
is sameaxis.name
in registerYAxis(axis) of chart api, default is 'default' ^9.8.0scrollZoomEnabled
Scroll zoom flag ^9.3.0
callback
success callback
Special id
'candle_pane', the window id of the main picture.
Example:
chart.createIndicator('MA', false, {
id: 'pane_1',
height: 100,
minHeight: 30,
dragEnabled: true,
gap: { top: 0.2, bottom: 0.1 },
axisOptions: { scrollZoomEnabled: true }
}, () => {})
overrideIndicator(override, paneId, callback) â
(
override: {
name: string
shortName?: string
precision?: number
calcParams?: any[]
shouldOhlc?: boolean
shouldFormatBigNumber?: boolean
visible?: boolean
zLevel?: number
extendData?: any
series?: 'normal' | 'price' | 'volume'
figures?: Array<{
key: string
title?: string
type?: string
baseValue?: number
attrs?: ({
data: object
coordinate: object
bounding: object
barSpace: object
xAxis: object
yAxis: object
}) => object
styles?: (
data: object,
indicator: object,
defaultStyles: object
) => ({
style?: 'solid' | 'dashed' | 'stroke' | 'fill' | 'stroke_fill'
color?: string
})
}>
minValue?: number
maxValue?: number
styles?: object
calc?: (dataList: KLineData[], indicator: object) => Promise<object[]> | object[]
regenerateFigures?: (calcParms: any[]) => Array<{
key: string
title?: string
type?: string
baseValue?: number
styles?: (
data: object,
indicator: object,
defaultStyles: object
) => ({
style?: 'solid' | 'dashed' | 'stroke' | 'fill' | 'stroke_fill'
color?: string
})
}>
createTooltipDataSource?: (params: object) => {
name?: string
calcParamsText?: string
values?: Array<{
title: string | { text: string, color: string }
value: string | { text: string, color: string }
}>
}
draw?: (params: object) => boolean
},
paneId?: string | null,
callback?: () => void
) => void
Overlay technical indicator information.
override
some parameters that need to be overriddenname
metric name, unique identifier for creation and operationshortName
short name for displayprecision
precisioncalcParams
calculation parametersshouldOhlc
needs ohlc auxiliary graphicsshouldFormatBigNumber
should format large numbers. For example, 1000 is converted to 1k, 1000000 is converted to 1M, etc.visible
visible or notzLevel
z level ^9.7.0extendData
extended dataseries
indicator series, optional options are 'normal', 'price' and 'volume'figures
graphics configurationminValue
specifies the minimum valuemaxValue
specifies the maximum valuestyles
stylescalc
calculation methodregenerateFigures
method to regenerate figure informationcreateTooltipDataSource
method to create custom tip informationdraw
custom drawing method
paneId
window id, default is set to allcallback
success callback
Special id
'candle_pane', the window id of the main picture.
Example:
chart.overrideIndicator({
name: 'BOLL',
showName: 'BOLL'
calcParams: [20, 5.5],
precision: 4,
shouldOhlc: true,
shouldFormatBigNumber: false,
visible: true,
zLevel: 1,
extendData: 2432435,
series: 'price',
figures: [],
minValue: null,
maxValue: null,
calc: () => [],
regenerateFigures: () => [],
draw: () => {},
styles: {
bars: [{
style: 'fill,
borderStyle: 'solid,
borderSize: 1,
borderDashedValue: [2, 2],
upColor: '#26A69A',
downColor: '#EF5350',
noChangeColor: '#888888'
}],
lines: [{
size: 1,
style: 'solid',
dashedValue: [2, 2],
color: '#FF9600'
}],
circles: [{
style: 'fill,
borderStyle: 'solid,
borderSize: 1,
borderDashedValue: [2, 2],
upColor: '#26A69A',
downColor: '#EF5350',
noChangeColor: '#888888'
}]
}
}, 'candle_pane', () => {})
getIndicatorByPaneId(paneId, name) â
(paneId?: string, name?: string) => object
Obtain technical indicator information according to the window id.
paneId
window id, that is, the window ID returned when calling thecreateIndicator
method, can be defaulted, and all will be returned by default.name
technical indicator name
Special id
'candle_pane', the window id of the main picture.
removeIndicator(paneId, name) â
(paneId: string, name?: string) => object
Remove technical indicators.
paneId
window id, that is, the window ID returned when calling thecreateIndicator
methodname
technical indicator name, if default, will remove all
Special id
'candle_pane', the window id of the main picture.
createOverlay(value, paneId) â
(
value: string | {
name: string
id?: string
groupId?: string
lock?: boolean
visible?: boolean
zLevel?: number
needDefaultPointFigure?: boolean
needDefaultXAxisFigure?: boolean
needDefaultYAxisFigure?: boolean
mode?: 'normal' | 'weak_magnet' | 'strong_magnet'
modeSensitivity?: number
points?: Array<{
timestamp?: number
dataIndex?: number
value?: number
}>
extendData?: any
styles?: object
onDrawStart?: (event: object) => boolean
onDrawing?: (event: object) => boolean
onDrawEnd?: (event: object) => boolean
onClick?: (event: object) => boolean
onDoubleClick?: (event: object) => boolean
onRightClick?: (event: object) => boolean
onPressedMoveStart?: (event: object) => boolean
onPressedMoving?: (event: object) => boolean
onPressedMoveEnd?: (event: object) => boolean
onMouseEnter?: (event: object) => boolean
onMouseLeave?: (event: object) => boolean
onRemoved?: (event: object) => boolean
onSelected?: (event: object) => boolean
onDeselected?: (event: object) => boolean
} | Array<string | {
name: string
id?: string
groupId?: string
lock?: boolean
visible?: boolean
zLevel?: number
needDefaultPointFigure?: boolean
needDefaultXAxisFigure?: boolean
needDefaultYAxisFigure?: boolean
mode?: 'normal' | 'weak_magnet' | 'strong_magnet'
modeSensitivity?: number
points?: Array<{
timestamp?: number
dataIndex?: number
value?: number
}>
extendData?: any
styles?: object
onDrawStart?: (event: object) => boolean
onDrawing?: (event: object) => boolean
onDrawEnd?: (event: object) => boolean
onClick?: (event: object) => boolean
onDoubleClick?: (event: object) => boolean
onRightClick?: (event: object) => boolean
onPressedMoveStart?: (event: object) => boolean
onPressedMoving?: (event: object) => boolean
onPressedMoveEnd?: (event: object) => boolean
onMouseEnter?: (event: object) => boolean
onMouseLeave?: (event: object) => boolean
onRemoved?: (event: object) => boolean
onSelected?: (event: object) => boolean
onDeselected?: (event: object) => boolean
}>,
paneId?: string
) => string | null
Creates an overlay, returning an identifier of type String.
value
Overlay name or object, when it is an object, the parameters are consistent withoverrideOverlay
paneId
window id, can be default
Special id
'candle_pane', the window id of the main picture.
Example:
chart.createOverlay({
name: 'segment',
id: 'segment_1',
groupId: 'segment',
points: [
{ timestamp: 1614171282000, value: 18987 },
{ timestamp: 1614171202000, value: 16098 },
],
styles: {
line: {
style: 'solid',
dashedValue: [2, 2],
color: '#f00',
size: 2
}
},
lock: false,
visible: true,
zLevel: 0,
mode: 'weak_magnet',
modeSensitivity: 8,
extendData: 'xxxxxxxx',
needDefaultPointFigure: false,
needDefaultXAxisFigure: false,
needDefaultYAxisFigure: false,
onDrawStart: function (event) { console. log(event) },
onDrawing: function (event) { console. log(event) },
onDrawEnd: function (event) { console. log(event) },
onClick: function (event) { console. log(event) },
onDoubleClick: function (event) { console. log(event) },
onRightClick: function (event) {
console. log(event)
return false
},
onMouseEnter: function (event) { console. log(event) },
onMouseLeave: function (event) { console. log(event) },
onPressedMoveStart: function (event) { console. log(event) },
onPressedMoving: function (event) { console. log(event) },
onPressedMoveEnd: function (event) { console. log(event) },
onRemoved: function (event) { console. log(event) },
onSelected: function (event) { console. log(event) },
onDeselected: function (event) { console. log(event) }
})
getOverlayById(id) â
(id: string) => object
Get overlay information by id.
id
calls thecreateOverlay
method to return the ID
overrideOverlay(override) â
(
override: {
name: string
id?: string
groupId?: string
lock?: boolean
visible?: boolean
zLevel?: number
needDefaultPointFigure?: boolean
needDefaultXAxisFigure?: boolean
needDefaultYAxisFigure?: boolean
mode?: 'normal' | 'weak_magnet' | 'strong_magnet'
modeSensitivity?: number
points?: Array<{
timestamp?: number
dataIndex?: number
value?: number
}>
extendData?: any
styles?: object
onDrawStart?: (event: object) => boolean
onDrawing?: (event: object) => boolean
onDrawEnd?: (event: object) => boolean
onClick?: (event: object) => boolean
onDoubleClick?: (event: object) => boolean
onRightClick?: (event: object) => boolean
onPressedMoveStart?: (event: object) => boolean
onPressedMoving?: (event: object) => boolean
onPressedMoveEnd?: (event: object) => boolean
onMouseEnter?: (event: object) => boolean
onMouseLeave?: (event: object) => boolean
onRemoved?: (event: object) => boolean
onSelected?: (event: object) => boolean
onDeselected?: (event: object) => boolean
}
) => string | null
Overlays that have been drawn.
override
parameters that need to be overriddenname
overlay name, unique identifier for creationid
Overlay identification, if the id exists, it will be based on the id to overwritegroupId
Group idlock
is locked to prevent draggingvisible
visible or notzLevel
Draw levelneedDefaultPointFigure
needs a default point figureneedDefaultXAxisFigure
needs the default x-axis figureneedDefaultYAxisFigure
needs the default y-axis figuremode
mode, options are 'normal', 'weak_magnet' and 'strong_magnet'modeSensitivity
mode sensitivity, only valid when mode is weak_magnet ^9.5.0points
point informationextendData
extended datastyles
stylesonDrawStart
start drawing eventonDrawing
drawing eventonDrawEnd
draw end eventonClick
click eventonDoubleClick
double click event ^9.5.0onRightClick
right click eventonPressedMoveStart
press start move eventonPressedMoving
Press and move eventonPressedMoveEnd
Press and move end eventonMouseEnter
mouse enter eventonMouseLeave
mouse out eventonRemoved
delete eventonSelected
selected eventonDeselected
deselected event
Example:
chart.overrideOverlay({
name: 'segment',
id: 'segment_1',
groupId: 'segment',
points: [
{ timestamp: 1614171282000, value: 18987 },
{ timestamp: 1614171202000, value: 16098 },
],
styles: {
line: {
style: 'solid',
dashedValue: [2, 2],
color: '#f00',
size: 2
}
},
lock: false,
visible: true,
zLevel: 0,
mode: 'weak_magnet',
modeSensitivity: 8
extendData: 'xxxxxxxx',
needDefaultPointFigure: false,
needDefaultXAxisFigure: false,
needDefaultYAxisFigure: false,
onDrawStart: function (event) { console. log(event) },
onDrawing: function (event) { console. log(event) },
onDrawEnd: function (event) { console. log(event) },
onClick: function (event) { console. log(event) },
onDoubleClick: function (event) { console. log(event) },
onRightClick: function (event) {
console. log(event)
return false
},
onMouseEnter: function (event) { console. log(event) },
onMouseLeave: function (event) { console. log(event) },
onPressedMoveStart: function (event) { console. log(event) },
onPressedMoving: function (event) { console. log(event) },
onPressedMoveEnd: function (event) { console. log(event) },
onRemoved: function (event) { console. log(event) },
onSelected: function (event) { console. log(event) },
onDeselected: function (event) { console. log(event) }
})
removeOverlay(remove) â
(
remove: string | {
id?: string
groupId?: string
name?: string
}
) => void
Remove graphics.
id
The ID returned by calling thecreateOverlay
method.groupId
Group idname
Overlay name
scrollByDistance(distance, animationDuration) â
(distance: number, animationDuration?: number) => void
Scroll a certain distance.
distance
distanceanimationDuration
animation time, can be default, default is no animation
scrollToRealTime(animationDuration) â
(distance: number, animationDuration?: number) => void
Scroll to original position.
animationDuration
animation time, can be default, default is no animation
scrollToDataIndex(dataIndex, animationDuration) â
(dataIndex: number, animationDuration?: number) => void
Scroll to the specified location.
dataIndex
the index of the dataanimationDuration
animation time, can be default, default is no animation
scrollToTimestamp(timestamp, animationDuration) â
(timestamp: number, animationDuration?: number) => void
Scroll to the specified timestamp.
timestamp
timestampanimationDuration
animation time, can be default, default is no animation
zoomAtCoordinate(scale, coordinate, animationDuration) â
(
scale: number,
coordinate?: {
x: number
y: number
},
animationDuration?: number
) => void
Scale at a certain coordinate point.
scale
scaling factorcoordinate
coordinate point, can be defaulted, the default is to zoom in the middle of the chartanimationDuration
animation time, can be default, default is no animation
zoomAtDataIndex(scale, dataIndex, animationDuration) â
(scale: number, dataIndex: number, animationDuration?: number) => void
Scale at a certain position.
scale
scaling factordataIndex
the index of the dataanimationDuration
animation time, can be default, default is no animation
zoomAtTimestamp(scale, timestamp, animationDuration) â
(scale: number, timestamp: number, animationDuration?: number) => void
Scale on the specified timestamp.
scale
scaling factortimestamp
timestampanimationDuration
animation time, can be default, default is no animation
setPaneOptions(options) â
(
options: {
id: string
height?: number
minHeight?: number
dragEnabled?: boolean
gap?: {
top?: number
bottom?: number
}
axisOptions?: {
name?: string
scrollZoomEnabled?: boolean
}
}
) => void
Set window configuration.
options
window configuration information, can be defaultid
window idheight
window height, can be defaultminHeight
minimum height of the window, can be defaulteddragEnabled
Whether the window can be dragged to adjust the height, it can be defaultedgap
marginstop
top margin, value less than 1 is a percentagebottom
bottom margin, value less than 1 is a percentage
axisOptions
name
axis name ^9.8.0scrollZoomEnabled
Scroll zoom flag ^9.3.0
Special id
'candle_pane', the window id of the main picture.
Example:
chart.setPaneOptions({
id: 'pane_1',
height: 100,
minHeight: 3,
dragEnabled: true,
gap: { top: 0.2, bottom: 0.1 },
axisOptions: { name: 'default', scrollZoomEnabled: true }
})
executeAction(type, data) ^9.2.0 â
(
type: 'onCrosshairChange',
data: any => void
) => void
Execute chart action.
type
only supported 'onCrosshairChange'data
data required for execution
subscribeAction(type, callback) â
(
type: 'onDataReady' | 'onZoom' | 'onScroll' | 'onVisibleRangeChange' | 'onCrosshairChange' | 'onCandleBarClick' | 'onTooltipIconClick' | 'onPaneDrag',
callback: (data?: any) => void
) => void
Subscribe to chart actions.
type
options are 'onDataReady', 'onZoom', 'onScroll', 'onVisibleRangeChange', 'onCandleBarClick', 'onTooltipIconClick', 'onCrosshairChange' and 'onPaneDrag'callback
is a callback method
unsubscribeAction(type, callback) â
(
type: 'onDataReady' | 'onZoom' | 'onScroll' | 'onVisibleRangeChange' | 'onCrosshairChange' | 'onCandleBarClick' | 'onTooltipIconClick' | 'onPaneDrag',
callback?: (data?: any) => void
) => void
Unsubscribe from chart actions.
type
options are 'onDataReady', 'onZoom', 'onScroll', 'onVisibleRangeChange', 'onCandleBarClick', 'onTooltipIconClick', 'onCrosshairChange' and 'onPaneDrag'callback
is the callback method when subscribing, the default is to cancel all the current types
convertToPixel(value, finder) â
(
value: {
dataIndex?: number
timestamp?: number
value?: number
} | Array<{
dataIndex?: number
timestamp?: number
value?: number
}>,
finder: {
paneId?: string,
absolute?: boolean
}
) => { x: number?, y?: number } | Array<{ x?: number, y?: number }>
Convert values to coordinates.
value
The value to be converted, it can be an object or an arraydataIndex
data index, ifdataIndex
andtimestamp
exist at the same time, it will be converted according to the indextimestamp
timestampvalue
corresponds to the value of the y-axis
finder
filterpaneId
window idabsolute
is an absolute coordinate, only works on the y axis
convertFromPixel(coordinate, finder) â
(
coordinate: {
x?: number
y?: number
} | Array<{
x?: number
y?: number
},
finder: {
paneId?: string
absolute?: boolean
}
) => {
dataIndex?: number
timestamp?: number
value?: number
} | Array<{
dataIndex?: number
timestamp?: number
value?: number
}>
Convert coordinates to values.
coordinate
needs to be converted, it can be an object or an arrayfinder
filterpaneId
window idabsolute
is an absolute coordinate, only works on the y axis
getConvertPictureUrl(includeOverlay, type, backgroundColor) â
(includeOverlay?: boolean, type?: string, backgroundColor?: string) => string
Get the image url after the chart is converted into an image.
includeOverlay
needs to include the overlay layer, it can be defaultedtype
The converted image type, one of the three types of 'png', 'jpeg', 'bmp', can be defaulted, the default is 'jpeg'backgroundColor
background color, can be defaulted, the default is '#FFFFFF'
resize() â
() => void
Resizing the chart will always fill the container size.
Note
This method will recalculate the size of each module in the entire chart, frequent calls may affect performance, please call with caution.