1.柱状图api数据过滤器
//doSomething var result = []; data.forEach(function (point) { result.push( { x: point.data.datastreams[7].id, y1: point.data.datastreams[7].datapoints[1].value, }, { x: point.data.datastreams[10].id, y1: point.data.datastreams[10].datapoints[1].value }, { x: point.data.datastreams[9].id, y1: point.data.datastreams[9].datapoints[1].value }, { x: point.data.datastreams[12].id, y1: point.data.datastreams[12].datapoints[1].value }, { x: point.data.datastreams[11].id, y1: point.data.datastreams[11].datapoints[1].value } ) })
return result; 2.多条折线图api数据过滤器 //doSomething var result = []; data.forEach(function (point) { for (var i = 0; i < 10; i++) { result.push( { x:point.data.datastreams[0].datapoints[9-i].at, id1:point.data.datastreams[8].id, value1: point.data.datastreams[8].datapoints[9-i].value, id2:point.data.datastreams[11].id, value2:point.data.datastreams[11].datapoints[9-i].value, id3:point.data.datastreams[10].id, value3: point.data.datastreams[10].datapoints[9-i].value, id4:point.data.datastreams[16].id, value4:point.data.datastreams[16].datapoints[9-i].value, id5:point.data.datastreams[12].id, value5:point.data.datastreams[12].datapoints[9-i].value } ) } })
return result; 3.水球过滤器 //doSomething var result = []; data.forEach(function (point) { result.push({ wave: [point.data.datastreams[5].datapoints[1].value / 100], }) }) return result; 4.表盘过滤器 var result = []; data.forEach(function (point) { result.push({ value: point.data.datastreams[10].datapoints[1].value, name: '土壤2#' }) }) return result; 5.项目展示 https://open.iot.10086.cn/view/main/#/share2d?id=61223938fe013c00409cff30 6.参考文档 链接:https://pan.baidu.com/s/1NqNq-r0FseEfLzgcC-htxA
提取码:wdf1
|