def _CreateChartStats(loss_stats):
  """Creates the Chart object to interface with Google Charts drawChart method.

  https://developers.google.com/chart/interactive/docs/reference#google.visualization.drawchart

  Args:
    loss_stats: A dictionary of years paired to square meters.

  Returns:
    A Python dictionary with all of the parameters required to draw a Chart.
  """
  chart_data = {
      'type': 'area',
      'options': {},
  }

  columns = [
      {'id': 'name', 'label': 'Year', 'type': 'string'},
      {'id': 'year', 'label': 'Loss (sq. km)', 'type': 'number'}]
  rows = []

  for loss_year in sorted(loss_stats.keys()):
    entry = {
        # The loss stats are in m2; convert them to km2.
        'c': [{'v': loss_year}, {'v': loss_stats[loss_year]/1000/1000}]
    }
    rows.append(entry)

  chart_data['data'] = {'cols': columns, 'rows': rows}

  return chart_data