<commit_before><!-- Show the estimate graph with Chartjs -->
<script>
    $(document).ready(function() {
        // Get the current module estimation results
        <% attributes_array = current_module_project.pemodule.pe_attributes.all.map(&:alias).to_json.html_safe %>
        <% modules = current_project.pemodules.map(&:alias).to_json.html_safe %>
        var module_labels = <%= modules %>;

        <% data_array = []
           input_data_array = []
           cocomo_advanced_input_data_array = []
           #fillColor_array = ["rgba(220,220,220,0.5)", "rgba(151,187,205,0.5)", "rgba(151,187,205,1)", "rgba(220,220,220,1)"]
           #fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb((255,255,0)", "rgba(220,220,220,0.5)", "rgba(151,187,205,0.5)", "rgba(151,187,205,1)", "rgba(220,220,220,1)"]
           fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb(151,187,205)", "rgb(151,187,205)"]
           pie_fillColor_array = ["#F38630", "#E0E4CC", "#69D2E7", "#D97041", "#C7604C", "#21323D", "#9D9B7F", "#7D4F6D", "#584A5E"]
           iteration = -1
           input_iter = -1
           cocomo_ad_iter = -1
        %>
        var js_fillColor_array = fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb(151,187,205)", "rgb(151,187,205)"];
        var js_pie_fillColor_array = ["#F38630", "#E0E4CC", "#69D2E7", "#D97041", "#C7604C", "#21323D", "#9D9B7F", "#7D4F6D", "#584A5E"];


        ///============== datasets for input data Radar chart for Cocomo_Advanced =======================

        <% if @current_module_project.pemodule.alias == Projestimate::Application::COCOMO_ADVANCED %>
            //Radar option
            var radarOptions = {
                //Boolean - If we show the scale above the chart data
                scaleOverlay: true,
                //Boolean - Whether grid lines are shown across the chart
                scaleShowGridLines: true,
                //Boolean - If we want to override with a hard coded scale
                scaleOverride: true,
                //** Required if scaleOverride is true **
                //Number - The number of steps in a hard coded scale
                scaleSteps: 7,
                //Number - The value jump in the hard coded scale
                scaleStepWidth: 1,
                //Number - The scale starting value
                scaleStartValue: 0,
                //String - Colour of the scale line
                scaleLineColor: "rgba(0,0,0,.1)",
                //Number - Pixel width of the scale line
                scaleLineWidth: 1,
                //Boolean - Whether to show labels on the scale
                scaleShowLabels: true,
                //Number - Scale label font size in pixels
                scaleFontSize: 12,
                scaleFontColor: "#000",
                annotateLabel: true,

                // new attribute for the CharNew.js library
                annotateDisplay : true,
                savePng : true,
                canvasBorders : true,
                canvasBordersWidth : 2,
                canvasBordersColor : "black",
                yAxisLeft : true,
                yAxisRight : true,
                yAxisLabel : "Y axis",
                yAxisFontFamily : "'Arial'",
                yAxisFontSize : 14,
                yAxisFontStyle : "normal",
                yAxisFontColor : "#666",
                xAxisLabel : "",
                xAxisFontFamily : "'Arial'",
                xAxisFontSize : 14,
                xAxisFontStyle : "normal",
                xAxisFontColor : "#666",
                yAxisUnit : "UNIT",
                yAxisUnitFontFamily : "'Arial'",
                yAxisUnitFontSize : 12,
                yAxisUnitFontStyle : "normal",
                yAxisUnitFontColor : "#666",
                graphTitle : "",
                graphTitleFontFamily : "'Arial'",
                graphTitleFontSize : 24,
                graphTitleFontStyle : "bold",
                graphTitleFontColor : "#666",
                graphSubTitle : "",
                graphSubTitleFontFamily : "'Arial'",
                graphSubTitleFontSize : 18,
                graphSubTitleFontStyle : "normal",
                graphSubTitleFontColor : "#666",
                footNote : "Cocomo-advanced input data factors",
                footNoteFontFamily : "'Arial'",
                footNoteFontSize : 16,
                footNoteFontStyle : "bold",
                footNoteFontColor : "#666",
                legend : true,
                legendFontFamily : "'Arial'",
                legendFontSize : 14,
                legendFontStyle : "normal",
                legendFontColor : "#666",
                legendBlockSize : 12,
                legendBorders : true,
                legendBordersWidth : 2,
                legendBordersColor : "#666",
                //  ADDED PARAMETERS
                graphMin : "DEFAULT",
                graphMax : "DEFAULT"
            }

            // Cocomo-Advanced input data
            <% @cocomo_advanced_input_dataset.each do |corresponding_graph_name, array_value|
                factor_data_hash =
                    {
                       fillColor: fillColor_array[cocomo_ad_iter+=1],
                       strokeColor: "rgba(220,220,220,1)",
                       pointColor: "rgba(220,220,220,1)",
                       pointStrokeColor: "#fff",
                       data: array_value,
                       title: corresponding_graph_name
                    }
               cocomo_advanced_input_data_array << factor_data_hash
               puts "JS_COCOMO_DATA = #{cocomo_advanced_input_data_array}"
            end %>

            var cocomo_advanced_input_data = {
                labels: <%= @cocomo_advanced_factor_corresponding.to_json.html_safe %>,
                datasets: <%= cocomo_advanced_input_data_array.to_json.html_safe %>
            };

            //create the radar char div for the Cocomo-Advanced inputs factors
            $("#estimation_graph_box").append('<div class="span4" style="margin-left: 0px"><canvas id="canvas_radar" width="400" height="400"></canvas></div>');

            // Radar chart for input data
            var radar_ctx = $('#canvas_radar').get(0).getContext("2d");
            var radarChart = new Chart(radar_ctx).Radar(cocomo_advanced_input_data, radarOptions);

        <% end %>
        ///========================================= END COCOMO-ADVANCED  ===========================================



        //========================================= DATASET FOR THE CURRENT MODULE AND CURRENT COMPONENT ===========================================

        //create dynamique div and canvas for each output attribute graph
        var current_mp_outputs_attributes_aliases = <%= @current_mp_outputs_attributes_aliases.to_json.html_safe %>;
        $.each(current_mp_outputs_attributes_aliases, function( index, value ) {
//            $("#estimation_graph_box").append('<div class="span4"><canvas id="bar_canvas_'+value+'" width="300" height="500"></canvas></div>');
            $("#estimation_graph_box").append('<div class="span4" style="margin-left: 0px"><canvas id="'+value+'" class="canvas" width="400" height="400"></canvas></div>');
        });

        var outputs_data_levels = ["Low", "High", "Most Likely", "probable"];
        var output_iter = -1;

        //generate data for each attribute
        var js_current_mp_outputs_dataset = <%= @current_mp_outputs_dataset.to_json.html_safe %> ;
        var js_current_mp_outputs_attributes_aliases = <%= @current_mp_outputs_attributes_aliases.to_json.html_safe %> ;
        var graph_title = "";
        var pie_chart_effort_per_activity;

        $.each( js_current_mp_outputs_attributes_aliases, function( key, value ) {

            <%# if @current_module_project.pemodule.with_activities.in?(%w(yes_for_output_with_ratio yes_for_input_output_without_ratio yes_for_input_output_without_ratio yes_for_input_output_without_ratio)) %>
            <% if !@current_mp_effort_per_activity.empty? %>
                if((value == "effort_man_month") || (value == "effort_man_hour")){
                    graph_title = "Effort per activity (probable)";
                }

                //create div for the Pie chart
                $("#estimation_graph_box").append('<div class="span8" style="margin-left: 0px"><canvas id="canvas_pie_effort_per_activity" width="800" height="400"></canvas></div>');

                // only get the Probable value for the Pie chart
                <% r_pie_chart_effort_per_activity = []
                   pie_chart_iter = -1
                   hue = 0
                   effort_per_activity_probable_value = @current_mp_effort_per_activity["probable"]
                   if !effort_per_activity_probable_value.nil?
                        effort_per_activity_probable_value.each do |key, value|
                            activity_data = {
                                value: value,
                                color: "hsla(#{hue}, 75%, 50%, 0.5)", #"%06x" % (rand * 0xffffff), #pie_fillColor_array[pie_chart_iter+=1],
                                title: key
                            }
                            r_pie_chart_effort_per_activity << activity_data
                            hue += 222.5
                        end
                   end
                %>

                //create the Pie chart data
                pie_chart_effort_per_activity = <%= r_pie_chart_effort_per_activity.to_json.html_safe %> ;
            <% end %>

            var attr_data = {
                labels : outputs_data_levels,
                datasets : [
                    {
                        fillColor : js_fillColor_array[output_iter+=1],
                        strokeColor : "rgba(220,220,220,1)",
                        pointColor : "rgba(220,220,220,1)",
                        pointStrokeColor : "#fff",
                        data : js_current_mp_outputs_dataset[value],
                        title : value
                    }
                ]
            }

            var attr_options = {
                annotateLabel: true,
                // new attribute for the CharNew.js library
                annotateDisplay : true,
                savePng : true,
                canvasBorders : true,
                canvasBordersWidth : 2,
                canvasBordersColor : "black",
                yAxisLeft : true,
                yAxisRight : true,
                yAxisLabel : "Y axis",
                yAxisFontFamily : "'Arial'",
                yAxisFontSize : 14,
                yAxisFontStyle : "normal",
                yAxisFontColor : "#666",
                xAxisLabel : "",
                xAxisFontFamily : "'Arial'",
                xAxisFontSize : 14,
                xAxisFontStyle : "normal",
                xAxisFontColor : "#666",
                yAxisUnit : "UNIT",
                yAxisUnitFontFamily : "'Arial'",
                yAxisUnitFontSize : 12,
                yAxisUnitFontStyle : "normal",
                yAxisUnitFontColor : "#666",
                graphTitle : graph_title,
                graphTitleFontFamily : "'Arial'",
                graphTitleFontSize : 24,
                graphTitleFontStyle : "bold",
                graphTitleFontColor : "#666",
                graphSubTitle : "",
                graphSubTitleFontFamily : "'Arial'",
                graphSubTitleFontSize : 18,
                graphSubTitleFontStyle : "normal",
                graphSubTitleFontColor : "#666",
                footNote : ''+value,
                footNoteFontFamily : "'Arial'",
                footNoteFontSize : 16,
                footNoteFontStyle : "bold",
                footNoteFontColor : "#666",
                legend : true,
                legendFontFamily : "'Arial'",
                legendFontSize : 14,
                legendFontStyle : "normal",
                legendFontColor : "#666",
                legendBlockSize : 12,
                legendBorders : true,
                legendBordersWidth : 2,
                legendBordersColor : "#666",
                //  ADDED PARAMETERS
                graphMin : "DEFAULT",
                graphMax : "DEFAULT"
            };

            //generate Bar chart for current output attribute
            var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(attr_data, attr_options);

            //Pie chart for Effort per activity
            <% if !@current_mp_effort_per_activity.empty? %>
                var myPie = new Chart(document.getElementById("canvas_pie_effort_per_activity").getContext("2d")).Pie(pie_chart_effort_per_activity, attr_options);
            <% end %>
        });


        //========================================= DATASET FOR OUTPUT DATA  ===============================================

        // create de data
        <% @attributes_labels.each do |attr|
            attr_data_hash =
            {
                fillColor: fillColor_array[iteration+=1],
                strokeColor: "rgba(220,220,220,1)",
                pointColor: "rgba(220,220,220,1)",
                pointStrokeColor: "#fff",
                data: @dataset[:"#{attr}"],
                title: attr
            }
            data_array << attr_data_hash
        end %>

        // get the data
        var all_attribute_data = {
            labels : module_labels,
            datasets : <%= data_array.to_json.html_safe %>
        }

        //Get the context of the canvas element we want to select
        //var ctx = document.getElementById("myChart").getContext("2d");

        //Line chart
//        var line_ctx = $('#canvas_line').get(0).getContext("2d");
//        var lineChart =  new Chart(line_ctx).Line(all_attribute_data, options);
//
//        //Bar chart
//        var bar_ctx = $('#canvas_bar').get(0).getContext("2d");
//        var barChart =   new Chart(bar_ctx).Bar(all_attribute_data, options);

//        var js_current_mp_outputs_attributes_aliases = <%#= @current_mp_outputs_attributes_aliases.to_json.html_safe %> ;
//        $.each( js_current_mp_outputs_attributes_aliases, function( key, value ) {
//            //var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(all_attribute_data);
//            var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(outputs_data_hash[attribute_name], options);
//        });


        //==========
//        canvas = document.getElementById(value);
//
//        window.addEventListener('resize', resize, false);
//
//        function resize() {
//            canvas.width = window.innerWidth;
//            canvas.height = window.innerHeight;
//            //Do Something
//            stage.update();
//        }
        //===========

    });
</script><commit_msg>Graphs superosition refs:#719<commit_after><!-- Show the estimate graph with Chartjs -->
<script>
    $(document).ready(function() {
        // Get the current module estimation results
        <% attributes_array = current_module_project.pemodule.pe_attributes.all.map(&:alias).to_json.html_safe %>
        <% modules = current_project.pemodules.map(&:alias).to_json.html_safe %>
        var module_labels = <%= modules %>;

        <% data_array = []
           input_data_array = []
           cocomo_advanced_input_data_array = []
           #fillColor_array = ["rgba(220,220,220,0.5)", "rgba(151,187,205,0.5)", "rgba(151,187,205,1)", "rgba(220,220,220,1)"]
           #fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb((255,255,0)", "rgba(220,220,220,0.5)", "rgba(151,187,205,0.5)", "rgba(151,187,205,1)", "rgba(220,220,220,1)"]
           fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb(151,187,205)", "rgb(151,187,205)"]
           pie_fillColor_array = ["#F38630", "#E0E4CC", "#69D2E7", "#D97041", "#C7604C", "#21323D", "#9D9B7F", "#7D4F6D", "#584A5E"]
           iteration = -1
           input_iter = -1
           cocomo_ad_iter = -1
        %>
        var js_fillColor_array = fillColor_array = ["rgb(135,206,250)", "rgb(255,165,0)", "rgb(0,255,255)", "rgb(151,187,205)", "rgb(151,187,205)"];
        var js_pie_fillColor_array = ["#F38630", "#E0E4CC", "#69D2E7", "#D97041", "#C7604C", "#21323D", "#9D9B7F", "#7D4F6D", "#584A5E"];


        ///============== datasets for input data Radar chart for Cocomo_Advanced =======================

        <% if @current_module_project.pemodule.alias == Projestimate::Application::COCOMO_ADVANCED %>
            //Radar option
            var radarOptions = {
                //Boolean - If we show the scale above the chart data
                scaleOverlay: true,
                //Boolean - Whether grid lines are shown across the chart
                scaleShowGridLines: true,
                //Boolean - If we want to override with a hard coded scale
                scaleOverride: true,
                //** Required if scaleOverride is true **
                //Number - The number of steps in a hard coded scale
                scaleSteps: 7,
                //Number - The value jump in the hard coded scale
                scaleStepWidth: 1,
                //Number - The scale starting value
                scaleStartValue: 0,
                //String - Colour of the scale line
                scaleLineColor: "rgba(0,0,0,.1)",
                //Number - Pixel width of the scale line
                scaleLineWidth: 1,
                //Boolean - Whether to show labels on the scale
                scaleShowLabels: true,
                //Number - Scale label font size in pixels
                scaleFontSize: 12,
                scaleFontColor: "#000",
                annotateLabel: true,

                // new attribute for the CharNew.js library
                annotateDisplay : true,
                savePng : true,
                canvasBorders : true,
                canvasBordersWidth : 2,
                canvasBordersColor : "black",
                yAxisLeft : true,
                yAxisRight : true,
                yAxisLabel : "Y axis",
                yAxisFontFamily : "'Arial'",
                yAxisFontSize : 14,
                yAxisFontStyle : "normal",
                yAxisFontColor : "#666",
                xAxisLabel : "",
                xAxisFontFamily : "'Arial'",
                xAxisFontSize : 14,
                xAxisFontStyle : "normal",
                xAxisFontColor : "#666",
                yAxisUnit : "UNIT",
                yAxisUnitFontFamily : "'Arial'",
                yAxisUnitFontSize : 12,
                yAxisUnitFontStyle : "normal",
                yAxisUnitFontColor : "#666",
                graphTitle : "",
                graphTitleFontFamily : "'Arial'",
                graphTitleFontSize : 18,
                graphTitleFontStyle : "bold",
                graphTitleFontColor : "#666",
                graphSubTitle : "",
                graphSubTitleFontFamily : "'Arial'",
                graphSubTitleFontSize : 16,
                graphSubTitleFontStyle : "normal",
                graphSubTitleFontColor : "#666",
                footNote : "Cocomo-advanced input data factors",
                footNoteFontFamily : "'Arial'",
                footNoteFontSize : 14,
                footNoteFontStyle : "bold",
                footNoteFontColor : "#666",
                legend : true,
                legendFontFamily : "'Arial'",
                legendFontSize : 14,
                legendFontStyle : "normal",
                legendFontColor : "#666",
                legendBlockSize : 12,
                legendBorders : true,
                legendBordersWidth : 1,
                legendBordersColor : "#666",
                //  ADDED PARAMETERS
                graphMin : "DEFAULT",
                graphMax : "DEFAULT"
            }

            // Cocomo-Advanced input data
            <% @cocomo_advanced_input_dataset.each do |corresponding_graph_name, array_value|
                factor_data_hash =
                    {
                       fillColor: fillColor_array[cocomo_ad_iter+=1],
                       strokeColor: "rgba(220,220,220,1)",
                       pointColor: "rgba(220,220,220,1)",
                       pointStrokeColor: "#fff",
                       data: array_value,
                       title: corresponding_graph_name
                    }
               cocomo_advanced_input_data_array << factor_data_hash
               puts "JS_COCOMO_DATA = #{cocomo_advanced_input_data_array}"
            end %>

            var cocomo_advanced_input_data = {
                labels: <%= @cocomo_advanced_factor_corresponding.to_json.html_safe %>,
                datasets: <%= cocomo_advanced_input_data_array.to_json.html_safe %>
            };

            //create the radar char div for the Cocomo-Advanced inputs factors
//            $("#estimation_graph_box").append('<div class="span4" style="margin-left: 0px"><canvas id="canvas_radar" width="400" height="400"></canvas></div>');
            $("#estimation_graph_box").append('<div class="span4" style="margin-left: 0px"><canvas id="canvas_radar" class="canvas" width="350" height="300"></canvas></div>');

            // Radar chart for input data
            var radar_ctx = $('#canvas_radar').get(0).getContext("2d");
            var radarChart = new Chart(radar_ctx).Radar(cocomo_advanced_input_data, radarOptions);

        <% end %>
        ///========================================= END COCOMO-ADVANCED  ===========================================



        //========================================= DATASET FOR THE CURRENT MODULE AND CURRENT COMPONENT ===========================================

        //create dynamique div and canvas for each output attribute graph
        var current_mp_outputs_attributes_aliases = <%= @current_mp_outputs_attributes_aliases.to_json.html_safe %>;
        $.each(current_mp_outputs_attributes_aliases, function( index, value ) {
            $("#estimation_graph_box").append('<div class="span4" style="margin-left: 0px"><canvas id="'+value+'" class="canvas" width="350" height="300"></canvas></div>');
        });

        var outputs_data_levels = ["Low", "High", "Most Likely", "probable"];
        var output_iter = -1;

        //generate data for each attribute
        var js_current_mp_outputs_dataset = <%= @current_mp_outputs_dataset.to_json.html_safe %> ;
        var js_current_mp_outputs_attributes_aliases = <%= @current_mp_outputs_attributes_aliases.to_json.html_safe %> ;
        var graph_title = "";
        var pie_chart_effort_per_activity;

        $.each( js_current_mp_outputs_attributes_aliases, function( key, value ) {

            <%# if @current_module_project.pemodule.with_activities.in?(%w(yes_for_output_with_ratio yes_for_input_output_without_ratio yes_for_input_output_without_ratio yes_for_input_output_without_ratio)) %>
            <% if !@current_mp_effort_per_activity.empty? %>
                if((value == "effort_man_month") || (value == "effort_man_hour")){
                    graph_title = "Effort per activity (probable)";
                }

                //create div for the Pie chart
                $("#estimation_graph_box").append('<div class="span8" style="margin-left: 0px"><canvas id="canvas_pie_effort_per_activity" class="canvas" width="700" height="300"></canvas></div>');

                // only get the Probable value for the Pie chart
                <% r_pie_chart_effort_per_activity = []
                   pie_chart_iter = -1
                   hue = 0
                   effort_per_activity_probable_value = @current_mp_effort_per_activity["probable"]
                   if !effort_per_activity_probable_value.nil?
                        effort_per_activity_probable_value.each do |key, value|
                            activity_data = {
                                value: value,
                                color: "hsla(#{hue}, 75%, 50%, 0.5)", #"%06x" % (rand * 0xffffff), #pie_fillColor_array[pie_chart_iter+=1],
                                title: key
                            }
                            r_pie_chart_effort_per_activity << activity_data
                            hue += 222.5
                        end
                   end
                %>

                //create the Pie chart data
                pie_chart_effort_per_activity = <%= r_pie_chart_effort_per_activity.to_json.html_safe %> ;
            <% end %>

            var attr_data = {
                labels : outputs_data_levels,
                datasets : [
                    {
                        fillColor : js_fillColor_array[output_iter+=1],
                        strokeColor : "rgba(220,220,220,1)",
                        pointColor : "rgba(220,220,220,1)",
                        pointStrokeColor : "#fff",
                        data : js_current_mp_outputs_dataset[value],
                        title : value
                    }
                ]
            }

            var attr_options = {
                annotateLabel: true,
                // new attribute for the CharNew.js library
                annotateDisplay : true,
                savePng : true,
                canvasBorders : true,
                canvasBordersWidth : 2,
                canvasBordersColor : "black",
                yAxisLeft : true,
                yAxisRight : true,
                yAxisLabel : "Y axis",
                yAxisFontFamily : "'Arial'",
                yAxisFontSize : 14,
                yAxisFontStyle : "normal",
                yAxisFontColor : "#666",
                xAxisLabel : "",
                xAxisFontFamily : "'Arial'",
                xAxisFontSize : 14,
                xAxisFontStyle : "normal",
                xAxisFontColor : "#666",
                yAxisUnit : "UNIT",
                yAxisUnitFontFamily : "'Arial'",
                yAxisUnitFontSize : 12,
                yAxisUnitFontStyle : "normal",
                yAxisUnitFontColor : "#666",
                graphTitle : graph_title,
                graphTitleFontFamily : "'Arial'",
                graphTitleFontSize : 24,
                graphTitleFontStyle : "normal",
                graphTitleFontColor : "#666",
                graphSubTitle : "",
                graphSubTitleFontFamily : "'Arial'",
                graphSubTitleFontSize : 16,
                graphSubTitleFontStyle : "normal", //"bold"
                graphSubTitleFontColor : "#666",
                footNote : ''+value,
                footNoteFontFamily : "'Arial'",
                footNoteFontSize : 16,
                footNoteFontStyle : "bold",
                footNoteFontColor : "#666",
                legend : true,
                legendFontFamily : "'Arial'",
                legendFontSize : 14,
                legendFontStyle : "normal",
                legendFontColor : "#666",
                legendBlockSize : 12,
                legendBorders : true,
                legendBordersWidth : 2,
                legendBordersColor : "#666",
                //  ADDED PARAMETERS
                graphMin : "DEFAULT",
                graphMax : "DEFAULT"
            };

            //generate Bar chart for current output attribute
            var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(attr_data, attr_options);

            //Pie chart for Effort per activity
            <% if !@current_mp_effort_per_activity.empty? %>
                var myPie = new Chart(document.getElementById("canvas_pie_effort_per_activity").getContext("2d")).Pie(pie_chart_effort_per_activity, attr_options);
            <% end %>
        });


        //========================================= DATASET FOR OUTPUT DATA  ===============================================

        // create de data
        <% @attributes_labels.each do |attr|
            attr_data_hash =
            {
                fillColor: fillColor_array[iteration+=1],
                strokeColor: "rgba(220,220,220,1)",
                pointColor: "rgba(220,220,220,1)",
                pointStrokeColor: "#fff",
                data: @dataset[:"#{attr}"],
                title: attr
            }
            data_array << attr_data_hash
        end %>

        // get the data
        var all_attribute_data = {
            labels : module_labels,
            datasets : <%= data_array.to_json.html_safe %>
        }

        //Get the context of the canvas element we want to select
        //var ctx = document.getElementById("myChart").getContext("2d");

        //Line chart
//        var line_ctx = $('#canvas_line').get(0).getContext("2d");
//        var lineChart =  new Chart(line_ctx).Line(all_attribute_data, options);
//
//        //Bar chart
//        var bar_ctx = $('#canvas_bar').get(0).getContext("2d");
//        var barChart =   new Chart(bar_ctx).Bar(all_attribute_data, options);

//        var js_current_mp_outputs_attributes_aliases = <%#= @current_mp_outputs_attributes_aliases.to_json.html_safe %> ;
//        $.each( js_current_mp_outputs_attributes_aliases, function( key, value ) {
//            //var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(all_attribute_data);
//            var myBar = new Chart(document.getElementById(value).getContext("2d")).Bar(outputs_data_hash[attribute_name], options);
//        });

    });
</script>
{'fraction_non_alphanumeric': 0.1317813696587713, 'fraction_numerical': 0.03320795635525736, 'mean_word_length': 1.7527282902714298, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4814283', 'n_tokens_mistral': 8888, 'n_tokens_neox': 7787, 'n_words': 1540}