跳到主要内容

bn.createChartContext

createChartContext<T>(chartId, options?): ChartContext<T>

description return a chart instance for given chart id

remark supported jssdk >= 4.14.0

example

const chartContext = bn.createChartContext('chartId')
cameraContext.setOption({
tooltip: {
formatter: {
type: 'function',
value: ['params', 'return "$" + params[0].data']
}
}
})

Type parameters

NameType
T""

Parameters

NameType
chartIdstring
options?Object
options.rendererId?number

Returns

ChartContext<T>

ChartContext

Ƭ ChartContext<T>: T extends "flutter" ? FlCharts : ECharts

Type parameters

NameType
T""

Interface: FlCharts

NameTypeDescription
setOption(options, duration?, curves?): void
resize(options): void

setOption

setOption(options, duration?, curves?): void

Parameters

NameType
optionsFlChartLineChartDataOptions
duration?number
curves?string

Returns

void


resize

resize(options): void

Parameters

NameType
optionsany

Returns

void

Interface: FlChartLineChartDataOptions

NameTypeDescription
lineBarsData?FlChartLineChartBarData[]
titlesData?FlChartTitlesDataOptions
lineTouchData?LineTouchDataOptions
showingTooltipIndicators?number[]
gridData?FlChartGridDataOptions
minX?number
maxX?number
baselineX?number
minY?number
maxY?number
baselineY?number
clipData?string
backgroundColor?[string]