Template.homeActivityCountsByFacilitatorRole.onCreated(function () {
  // Set up reactive variable for chart data

  // Call method to fetch data, assigning it to reactive variable
});

Template.homeActivityCountsByFacilitatorRole.onCreated(function () {
  // Autorun to render chart when reactive data available
});

@@ -71,246 +71,2051 @@
  // 
-Set up reactive variable for chart data%0A%0A  // Call method to fetch data, assigning it to reactive variable%0A%7D);%0A%0ATemplate.homeActivityCountsByFacilitatorRole.onCreated(function () %7B%0A  // Autorun to render chart when reactive data available
+Get reference to template instance%0A  const templateInstance = this;%0A%0A  // Get home ID from template instance%0A  const homeId = templateInstance.data.homeId;%0A%0A  // Set up reactive variable for chart data%0A  templateInstance.chartData = new ReactiveVar();%0A%0A  // Call method to fetch data, assigning it to reactive variable%0A  Meteor.call('getHomeActivitiesFacilitatorRolesCountsLast30days', homeId, function (error, chartData) %7B%0A    console.log('chartData', chartData);%0A    // update chart data reactive variable%0A    templateInstance.chartData.set(chartData);%0A  %7D);%0A%7D);%0A%0ATemplate.homeActivityCountsByFacilitatorRole.onCreated(function () %7B%0A  // Get reference to template instance%0A  const templateInstance = this;%0A%0A  // Autorun to render chart when reactive data available%0A  templateInstance.autorun(function () %7B%0A    const chartData = templateInstance.chartData.get();%0A%0A    if (chartData) %7B%0A      // Get reference to chart container%0A      const svg = dimple.newSvg(%22#facilitatorRolesChart%22, %22100%25%22, %22100%25%22);%0A%0A      // Initialize the activity type chart%0A      const facilitatorRolesChart = new dimple.chart(svg, chartData);%0A%0A      // Set chart boundaries based on parent container size%0A      facilitatorRolesChart.setBounds(%2220%25%22, %225%25%22, %2275%25%22, %2260%25%22);%0A%0A      // Add facilitator roles to x axis%0A      const xAxis = facilitatorRolesChart.addMeasureAxis(%22x%22, %22value%22);%0A%0A      // Set x axis title%0A      const xAxisTitle = TAPi18n.__(%22residentFacilitatorRolesChart-xAxis-title%22);%0A      xAxis.title = xAxisTitle;%0A%0A      // Disable grid lines%0A      xAxis.showGridlines = false;%0A%0A      // Add facilitator role counts to y axis%0A      const yAxis = facilitatorRolesChart.addCategoryAxis(%22y%22, %22key%22);%0A%0A      // Set y axis title%0A      const yAxisTitle = TAPi18n.__(%22residentFacilitatorRolesChart-yAxis-title%22);%0A      yAxis.title = yAxisTitle;%0A%0A      // Disable grid lines%0A      yAxis.showGridlines = false;%0A%0A      // Add bar plot%0A      facilitatorRolesChart.addSeries(null, dimple.plot.bar);%0A%0A      // Render chart%0A      facilitatorRolesChart.draw();%0A    %7D%0A  %7D)
 %0A%7D);

Add data handling and render chart