Bug 1435320 - Specify a default empty object for the Chart.js table header. r=Honza
authorIan Moody <moz-ian@perix.co.uk>
Fri, 02 Feb 2018 17:50:09 +0000
changeset 402821 353a5c7a0bb3e975a299a340692a79342a87adcb
parent 402820 f784eac344d2718a9bffa2dc5e0302178fc1c1d7
child 402822 8228ef851efd6377eaec64e995b69ca86e4ee3e9
push id33404
push usershindli@mozilla.com
push dateThu, 08 Feb 2018 10:03:18 +0000
treeherdermozilla-central@06b5d7476ebd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1435320
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1435320 - Specify a default empty object for the Chart.js table header. r=Honza So it doesn't break if one isn't supplied. Also document the header argument. MozReview-Commit-ID: 8UAVztN12Gw
devtools/client/shared/widgets/Chart.js
--- a/devtools/client/shared/widgets/Chart.js
+++ b/devtools/client/shared/widgets/Chart.js
@@ -317,25 +317,32 @@ function createPieChart(document, { data
  *                       label1: value => l10n.getFormatStr("...", value)
  *                     }
  *          - totals: an object specifying for which rows in the `data` array
  *                    the sum of their cells is to be displayed in the chart;
  *                    e.g: {
  *                      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
  *           - "mouseout", when the mouse leaves a row
  *           - "click", when the mouse clicks a row
  */
 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.
   if (!data) {
     data = loadingTableChartData();
     isPlaceholder = true;
   }
   if (!data.length) {