<script type="text/javascript">
var options = {{chart.get_options_json|safe}};
var morris_dict = {
  // ID of the element in which to draw the chart.
  element: '{{ chart.get_html_id }}',
  // Chart data records -- each entry in this array corresponds to a point on
  // the chart.
  data: {{ chart.get_data_json|safe }},
  // The name of the data record attribute that contains x-values.
  xkey: '{{ chart.get_category_key }}',
  // A list of names of data record attributes that contain y-values.
  ykeys: {{ chart.get_y_keys|safe }},
  // Labels for the ykeys -- will be displayed when you hover over the
  // chart.
  labels: {{ chart.get_y_keys|safe }},
  // post units
  postUnits: '{{ chart.get_options.postUnits|safe }}',
  preUnits: '{{ chart.get_options.preUnits|safe }}',
};

for(option in options) {
  morris_dict[option] = options[option];
}
new Morris.{{ chart.chart_type }}(morris_dict);
</script>
