<canvas>
or a canvas context must be created before drawing a chart.id
String
el
HTMLElement
context
CanvasRenderingContext2D
id
, el
, context
must be set one.width
Number
<canvas>
is set, you don't have to set the property.height
Number
<canvas>
is set, you don't have to set the property.padding
Number
/ Array
/ String
Number
/ Array
/ String
appendPadding
value to the four sides based on the padding. The default is 15 px.pixelRatio
Number
pixelRatio
to a value other than 1 will force the canvas size to be scaled by that amount, relative to the container size. There should be no visible difference on screen; the difference will only be visible when the image is zoomed or printed.plugins
Object
/ Array
animate
Boolean
limitInPlot
Boolean
syncY
Boolean
chart.get()
chart.get('width')
. The properties are listed as follows:id
data
width
height
pixelRatio
el
canvas
geoms
chart.source(data)
data
: Array, chart's datachart.source(data, colDefs)
data
: Array, chart's datacolDefs
: Object, scale configuration for each data field. Optional.linear
: Numerical data type, such 1, 2,3,4cat
: Quantize data, such 'dog', 'pig'timeCat
: Time datachart.source()
and chart.scale()
, the configuration which is defined latter will override previous configuration.chart.scale('field', colDef)
field
: String, data field namechart.scale(colDef)
chart.lengend()
chart.tooltip()
chart.guide()
guideController
instancechart.animate()
chart.point()
chart.line()
chart.area()
chart.path()
chart.interval()
chart.polygon()
chart.schema()
chart.render()
chart.clear()
chart.repaint()
chart.changeData(data)
data
: Array, chart.changeSize(width, height)
width
: Number / null, if null is specified, the width remains unchanged; height
: Number / null, if null is specified, the he remains unchanged;chart.changeSize(300)
only changes the width; chart.changeSize(300, 500)
changes both width and height; chart.changeSize(, 300)
only changes height.chart.destroy()
<canvas>
won't be destroyedchart.getPosition(record)
record
: Object, is the data object{x: , y: }
chart.getRecord(point)
point
: Object, is a coordinate object describes the coordinate on canvas, in the format of {x: , y: }
chart.getSnapRecords(point)
point
: Object, is the coordinate object in the format of {x: , y: }
chart.getLegendItems()
chart.getXScale()
chart.getYScales()
chart.showTooltip(point)
point
: Object, which is the coordinate on canvas, in the format of {x: , y: }
chart.hideTooltip()