<div class="row">
  <div class="x_panel">
    <div class="x_title">
      <h2>Bar charts</h2>
      <ul class="nav navbar-right panel_toolbox">
        <li><a class="close-link"><i class="fa fa-close"></i></a>
        </li>
      </ul>
      <div class="clearfix"></div>
    </div>
    <div class="x_content2">
      <div id="morris-bar-chart-{{count}}" style="height: 200px;"></div>
    </div>
  </div>
</div>
<script type="text/javascript" charset="utf-8">

var bar_chart_block_{{count}} = Morris.Bar({
  element: 'morris-bar-chart-{{count}}',
  data: [],
  xkey: 'y',
  ykeys: ['a'],
  labels: ['y'],
  smooth: true,
  resize: true
});

$(document).ready(function() {
  var barChartElements=[];
  {% for k, v in blockArray[count]["bar_charts"].iteritems() %}
  barChartElements.push("{{v[0]}}");
  {% endfor %}
  redrawBarChart(barChartElements, bar_chart_block_{{count}});
  setInterval(redrawBarChart,9000,barChartElements,bar_chart_block_{{count}});
});
</script>
