(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config)
| 1241 | } |
| 1242 | |
| 1243 | function getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { |
| 1244 | var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; |
| 1245 | var points = []; |
| 1246 | var validHeight = opts.height - opts.area[0] - opts.area[2]; |
| 1247 | data.forEach(function(item, index) { |
| 1248 | if (item === null) { |
| 1249 | points.push(null); |
| 1250 | } else { |
| 1251 | var cPoints = []; |
| 1252 | item.forEach(function(items, indexs) { |
| 1253 | var point = {}; |
| 1254 | point.x = xAxisPoints[index] + Math.round(eachSpacing / 2); |
| 1255 | var value = items.value || items; |
| 1256 | var height = validHeight * (value - minRange) / (maxRange - minRange); |
| 1257 | height *= process; |
| 1258 | point.y = opts.height - Math.round(height) - opts.area[2]; |
| 1259 | cPoints.push(point); |
| 1260 | }); |
| 1261 | points.push(cPoints); |
| 1262 | } |
| 1263 | }); |
| 1264 | |
| 1265 | return points; |
| 1266 | } |
| 1267 | |
| 1268 | function getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { |
| 1269 | var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; |
no outgoing calls
no test coverage detected