<% include_jqplot_scripts %>
<%
   unless defined?(autostart_chart_rendering)
     autostart_chart_rendering = true
   end
   block_name ||= ''
%>
<% url = chart_easy_queries_path(easy_query_type: easy_query.type, id: easy_query.id, project_id: easy_query.project, format: 'json') unless easy_query.new_record?  %>
<% url ||= chart_easy_queries_path(easy_query.to_params.merge(:project_id => easy_query.project, :format => 'json')) %>
<div id="<%= block_name %>_chart" class="easy_query_chart" data-url="<%= raw url %>"  data-renderchart="<%= autostart_chart_rendering %>" data-uuid="<%= easy_query.page_module && easy_query.page_module.uuid %>">
  <%= l(:label_chart_is_loading) %>
</div>
<script type="text/javascript">
  $(function () {
    $('#<%= block_name %>_chart').easy_chart();
  });
</script>
