@sensecare/roc-chart
v1.0.3
Published
rocchart
Downloads
7
Readme
ROC分析图
/**
* 名称:ROC分析图
* @param {*} id 当前选中容器
* @param {*} seriesData 当前数据
* @param {*} chartMap 当前图表实例组合
* @param {*} color 自定义bar颜色集合
**/
import { initRocCharts } from 'xxx'
const chartMap = new Map()
// mock数据
function quadraticOut (k) {
return k * (2 - k)
}
const N_POINT = [30, 80, 10]
const seriesData = []
var data = []
N_POINT.forEach((item, idx) => {
for (var i = 0; i <= item; i++) {
var x = i / item
var y = quadraticOut(x)
data.push([x, y])
}
seriesData.push({
name: 'quadraticOut' + idx,
data: data
})
})
// 生成ROC分析图实例
initRocCharts({
seriesData,
id: 'rocChart',
chartMap,
color: ['purple', '#cccccc']
})