RSS Git Download  Clone
Raw Blame History
<!-- BEGIN [% component.name %] -->
  <!-- highcharts lab-test totals -->
    <div>
    [% FOREACH section IN lab_test_data;
        div_id = section.key.replace(' ','-').replace('/','-').lower; # INCLUDE dumper.tt dump = div_id;
        div_width = section.value.size * 10; # approx width, between min & max

        total = 0;
        FOREACH test IN section.value;
            total = total + data.sum_this(test.value);
        END;
    %]
        <div id="[% div_id %]-total" style="min-width: 30%; max-width: 90%; height: 320px;
            width: [% div_width %]%; margin-left: 30px">
        </div>

        <script type="text/javascript">
            $(function () {
                $('#[% div_id %]-total').highcharts({
                    chart: {
                        type: 'column'
                    },
                    title: {
                        style: {
                            fontSize: '14px',
                        },
                        text: '[% section.key %] [[% total %]]',
                        align: 'left',
                    },
                    xAxis: {
                        type: 'category',
                        labels: {
                            rotation: -45,
                            style: {
                                fontSize: '11px',
                                fontFamily: 'Verdana, sans-serif'
                            }
                        }
                    },
                    yAxis: {
                        min: 0,
                        title: {
                            text: 'No. of tests'
                        }
                    },
                    legend: {
                        enabled: false
                    },
                    tooltip: {
                        pointFormat: 'n = <b>{point.y}</b>'
                    },
                    series: [{
                        name: '[% div_id %]',
                        data: [
					         [% INCLUDE drilldown_series_data
                                FOREACH test IN section.value +%]
                        ],
                        dataLabels: {
                            enabled: false,
                        }
                    }]
                });
            });
		</script>
    [% END %]
    </div>
<!-- END [% component.name %] -->