TypeError: Cannot read property "getDataRange" from null. (line 3, file "Code")
<p>I have decided to use Google Scripts when I can when using spreadsheets, just to start increasing knowledge. BUT I am untrained and got stuck quite quickly.</p>

<p>I saw some code on youtube for a different script but I thought I extracted what I needed and could get this to work...</p>

<pre><code>function doGet() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var range = data.getRange();

  var countFilter = Charts.newNumberRangeFilter().setFilterColumnIndex(2).build();
  var categoryFilter = Charts.newCategoryFilter().setFilterColumnIndex(0).build();
  var categorysearchFilter = Charts.newStringFilter().setFilterColumnIndex(0).build();
  var monthFilter = Charts.newCategoryFilter().setFilterColumnIndex(1).build();

  var tableChart = Charts.newTableChart().setDataViewDefinition(
        Charts.newDataViewDefinition().setColumns([0, 1, 2]))
      .build();
  var pieChart = Charts.newPieChart() .setDataViewDefinition(
        Charts.newDataViewDefinition().setColumns([0, 1, 2]))
      .build();

  var dashboard = Charts.newDashboardPanel()
      .setDataTable(data)
      .bind([countFilter, categoryFilter, categorysearchFilter, monthFilter],
            [tableChart, pieChart])
      .build();

  var app = UiApp.createApplication();
  var filterPanel = app.createVerticalPanel();
  var chartPanel = app.createHorizontalPanel();
  filterPanel.add(countFilter).add(categoryFilter).add(categorysearchFilter)
      .add(monthFilter).setSpacing(10);
  chartPanel.add(tableChart).add(pieChart).setSpacing(10);

  dashboard.add(app.createVerticalPanel().add(filterPanel).add(chartPanel));
  app.add(dashboard);
  return app;
}
</code></pre>

<p>Error I received => TypeError: Cannot read property "getDataRange" from null. (line 3, file "Code")</p>

<p>Can you help me?</p>