Fill with dashes instead of slashes or nulls

pull/10616/head
ebb-tide 2018-04-18 16:50:42 -07:00
parent cb265aeb8c
commit d721fe590f
1 changed files with 3 additions and 4 deletions

View File

@ -132,8 +132,7 @@ export const groupByTimeSeriesTransform = (raw = [], queryASTs = []) => {
const sortedLabels = _.sortBy(labels, 'label') const sortedLabels = _.sortBy(labels, 'label')
const tsMemo = {} const tsMemo = {}
const nullArray = Array(sortedLabels.length).fill('null') const dashArray = Array(sortedLabels.length).fill('-')
const slashArray = Array(sortedLabels.length).fill('-')
const labelsToValueIndex = reduce( const labelsToValueIndex = reduce(
sortedLabels, sortedLabels,
@ -150,7 +149,7 @@ export const groupByTimeSeriesTransform = (raw = [], queryASTs = []) => {
forEach(serieses, s => { forEach(serieses, s => {
if (groupBys[s.responseIndex]) { if (groupBys[s.responseIndex]) {
forEach(s.values, vs => { forEach(s.values, vs => {
timeSeries.push({time: vs[0], values: clone(slashArray)}) timeSeries.push({time: vs[0], values: clone(dashArray)})
existingRowIndex = timeSeries.length - 1 existingRowIndex = timeSeries.length - 1
forEach(vs.slice(1), (v, i) => { forEach(vs.slice(1), (v, i) => {
const label = s.unsortedLabels[i].label const label = s.unsortedLabels[i].label
@ -179,7 +178,7 @@ export const groupByTimeSeriesTransform = (raw = [], queryASTs = []) => {
if (existingRowIndex === undefined) { if (existingRowIndex === undefined) {
timeSeries.push({ timeSeries.push({
time, time,
values: clone(slashArray), values: clone(dashArray),
}) })
existingRowIndex = timeSeries.length - 1 existingRowIndex = timeSeries.length - 1