From 2de4c582131a9424f8d18d22c5a55f07b1fdea1b Mon Sep 17 00:00:00 2001 From: Gilberto Stankiewicz Date: Sat, 15 Jul 2017 15:03:10 -0700 Subject: [PATCH] Fix: Category columns can have blank values (#7, #4) --- waffleChart/pbiviz.json | 2 +- waffleChart/src/visual.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/waffleChart/pbiviz.json b/waffleChart/pbiviz.json index 787edb6..aa2b538 100644 --- a/waffleChart/pbiviz.json +++ b/waffleChart/pbiviz.json @@ -4,7 +4,7 @@ "displayName": "Waffle Chart", "guid": "WaffleChart1453776852267", "visualClassName": "Visual", - "version": "2.0.6", + "version": "2.0.7", "description": "A Waffle Chart uses a 10x10 grid of dots to visually show a percentage value. Each dot represents one percentage point, so a block of 43 highlighted dots would represent 43%. Multiple Waffle Charts can be used to visually compare multiple percentage values.", "supportUrl": "https://github.com/kiewic/PowerBI-WaffleChart", "gitHubUrl": "https://github.com/kiewic/PowerBI-WaffleChart" diff --git a/waffleChart/src/visual.ts b/waffleChart/src/visual.ts index c77df15..9c112f3 100644 --- a/waffleChart/src/visual.ts +++ b/waffleChart/src/visual.ts @@ -183,7 +183,7 @@ module powerbi.extensibility.visual { } } - private static formatCategoryValue(value: PrimitiveValue, type: ValueTypeDescriptor): string { + private static formatCategoryValue(value: PrimitiveValue | null, type: ValueTypeDescriptor): string { if (type.dateTime) { let formatter : IValueFormatter; @@ -197,7 +197,7 @@ module powerbi.extensibility.visual { return formatter.format(value); } - return value.toString(); + return value && value.toString(); } public static converter(dataView: DataView): WaffleChartViewModel {