new Charts()
Charts类
Extends
- Eventful
Methods
-
clear()
-
清除所有view、model以及事件
Returns:
-this
-
dispatchAction(model, type, payload, throttleopt)
-
触发事件
Parameters:
Name Type Attributes Default Description modelObject 组件model
typestring 事件名称
payloadany throttleboolean <optional>
true -
getDataModel(index)
-
获取指定的dataModel
Parameters:
Name Type Description indexnumber dataModel的序数
Returns:
-data model
- Deprecated:
- Yes
-
getDataUrl(optsopt)
-
生成dataUrl
Parameters:
Name Type Attributes Description optsObject <optional>
Properties
Name Type Attributes Description widthnumber | string <optional>
Can be 'auto' (the same as null/undefined)
heightnumber | string <optional>
Can be 'auto' (the same as null/undefined)
typestring <optional>
jpg | png
backgroundColorstring <optional>
Returns:
-data url
-
getDom()
-
获取dom
Returns:
-dom
-
getHeight() → {number}
-
Get container height
Returns:
number -height of container
-
getModel(typeopt, indexopt) → {Object}
-
获取指定的model,或者globalModel(无参数时)
Parameters:
Name Type Attributes Description typestring <optional>
组件名称
indexnumber | string | function <optional>
对应组件的index、name或方法选取
Returns:
Object -返回指定的model
-
getViewOfComponentModel(componentModel) → {Object}
-
获取model对应的view
Parameters:
Name Type Description componentModelObject 组件model
Returns:
Object -返回model对应的view
-
getWidth() → {number}
-
Get container width
Returns:
number -width of container
-
getZr()
-
获取zr实例
Returns:
-instance of zr
-
isError() → {boolean}
-
是否错误状态
Returns:
boolean -是否是错误状态
-
registerAction(model, type, callback, context)
-
注册事件
Parameters:
Name Type Description modelObject 组件model
typestring 事件名称
callbackfunction 回调函数
contextany -
resize(optsopt)
-
Resize the canvas. Should be invoked when container size is changed
Parameters:
Name Type Attributes Description optsObject <optional>
Properties
Name Type Attributes Description widthnumber | string <optional>
Can be 'auto' (the same as null/undefined)
heightnumber | string <optional>
Can be 'auto' (the same as null/undefined)
-
setOption(option, lazyUpdateopt)
-
设置参数
Parameters:
Name Type Attributes Default Description optionObject 配置参数
lazyUpdateObject <optional>
true 配置参数
Returns:
-this
-
stopAnimation()
-
停止所有动画
-
toggleEdit(boolopt)
-
切换编辑状态
Parameters:
Name Type Attributes Description boolboolean <optional>
true或false
-
update(forceopt)
-
调用globalModel的更新对标记为脏的model进行更新,并对有更新的model对应的view重新进行渲染
Parameters:
Name Type Attributes Description forceboolean <optional>
是否强制更新