You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/app/views/analyze/_grouped_bar_chart.html.erb

42 lines
2.6 KiB

<svg width="100%" height="<%= svg_height %>" >
<g id="graph-background">
<rect x="0" y="0" width="100%" height="<%= analyze_zone_height * 2 %>%" fill="#edecf0"/>
<rect x="0" y="<%= analyze_zone_height * 2 %>%" width="100%" height="<%= analyze_zone_height * 3 %>%" fill="#fffaee"/>
<rect x="0" y="0" width="100%" height="<%= analyze_graph_height %>%" fill="none" stroke="grey"/>
<line x1="<%= grouped_chart_divider_x(1) %>%" y1="0" x2="<%= grouped_chart_divider_x(1) %>%" y2="85%" stroke="grey" stroke-width="1" stroke-dasharray="5,2"/>
<line x1="<%= grouped_chart_divider_x(2) %>%" y1="0" x2="<%= grouped_chart_divider_x(2) %>%" y2="85%" stroke="grey" stroke-width="1" stroke-dasharray="5,2"/>
<rect x="0" y="<%= benchmark_y %>%" width="100%" height="<%= benchmark_height %>%" fill="black"/>
<g id="zone-dividers" stroke-width="1" >
<line x1="0" y1="17%" x2="100%" y2="17%" stroke="white" />
<line x1="0" y1="51%" x2="100%" y2="51%" stroke="#edecf0" />
<line x1="0" y1="68%" x2="100%" y2="68%" stroke="#edecf0" />
</g>
<g id="zone-labels">
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(1) %>%" text-anchor="start" dominant-baseline="middle">
Ideal
</text>
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(2) %>%" text-anchor="start" dominant-baseline="middle">
Approval
</text>
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(3) %>%" text-anchor="start" dominant-baseline="middle">
Growth
</text>
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(4) %>%" text-anchor="start" dominant-baseline="middle">
Watch
</text>
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(5) %>%" text-anchor="start" dominant-baseline="middle">
Warning
</text>
</g>
</g>
<% presenter = GroupedBarColumnPresenter.new(measure: measure, score: measure.student_score(school: @school, academic_year: @academic_year), position: 1, type: :student) %>
<%= render partial: "grouped_bar_column", locals: {presenter: presenter} %>
<% presenter = GroupedBarColumnPresenter.new(measure: measure, score: measure.teacher_score(school: @school, academic_year: @academic_year), position: 2, type: :teacher) %>
<%= render partial: "grouped_bar_column", locals: {presenter: presenter} %>
<% presenter = GroupedBarColumnPresenter.new(measure: measure, score: measure.score(school: @school, academic_year: @academic_year), position: 3, type: :all) %>
<%= render partial: "grouped_bar_column", locals: {presenter: presenter} %>
</svg>