commit 8b513c9c65e5 Author: Ian Moody Date: Fri Feb 2 17:50:09 2018 +0000 Bug 1435320 - Specify a default empty object for the Chart.js table header. r=Honza a=lizzard So it doesn't break if one isn't supplied. Also document the header argument. MozReview-Commit-ID: 8UAVztN12Gw --HG-- extra : source : 353a5c7a0bb3e975a299a340692a79342a87adcb --- devtools/client/shared/widgets/Chart.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git devtools/client/shared/widgets/Chart.js devtools/client/shared/widgets/Chart.js index 069fc673e8f6..acc7bfa28a25 100644 --- devtools/client/shared/widgets/Chart.js +++ devtools/client/shared/widgets/Chart.js @@ -322,6 +322,12 @@ function createPieChart(document, { data, width, height, centerX, centerY, radiu * label1: total => l10n.getFormatStr("...", total), // 5 * label2: total => l10n.getFormatStr("...", total), // 9 * } + * - header: an object specifying strings to use for table column + * headers + * e.g. { + * label1: l10n.getStr(...), + * label2: l10n.getStr(...), + * } * @return TableChart * A table chart proxy instance, which emits the following events: * - "mouseover", when the mouse enters a row @@ -331,6 +337,7 @@ function createPieChart(document, { data, width, height, centerX, centerY, radiu function createTableChart(document, { title, data, strings, totals, header }) { strings = strings || {}; totals = totals || {}; + header = header || {}; let isPlaceholder = false; // If there's no data available, display an empty placeholder.