Mercurial > hg > ugly-duckling
changeset 474:f2b62195a5a6
Use bin numbers for scale labels if bin names are not provided
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 30 Jun 2017 15:21:38 +0100 |
parents | de23ea6bcd0d |
children | 5df3ce3574e5 |
files | src/app/visualisations/grid/grid.component.ts |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/app/visualisations/grid/grid.component.ts Fri Jun 30 12:08:50 2017 +0100 +++ b/src/app/visualisations/grid/grid.component.ts Fri Jun 30 15:21:38 2017 +0100 @@ -67,6 +67,13 @@ } get binNames(): string[] { + if (!this.feature.binNames || this.feature.binNames.length === 0) { + const binCount = (this.feature.data.length > 0 ? + this.feature.data[0].length : 0); + for (let i = 0; i < binCount; ++i) { + this.feature.binNames.push("" + (i + 1)); + } + } return this.feature.binNames; } }