All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.js.scenarios-chart.js.vm Maven / Gradle / Ivy

Go to download

Provides pretty html reports for Cucumber. It works by generating html from the cucumber json file.

There is a newer version: 5.8.2
Show newest version
$(document).ready(function() {

    var chartData = {
        datasets: [{
            data: [
                $report_summary.getPassedScenarios(),
                $report_summary.getFailedScenarios()
            ],
            backgroundColor: [
                "#00B000",
                "#FF3030"
            ]
        }],
        labels: [
            "Passed",
            "Failed"
        ]
    };

    var context = document.getElementById("scenarios-chart");
    window.myBar = new Chart(context, {
        type: "doughnut",
        data: chartData,
        options: {
            title: {
                display: true,
                fontSize: 20,
                text: "Scenarios"
            },
            circumference: Math.PI,
            rotation: Math.PI,
            cutoutPercentage: 70,
            responsive: true,
            legend: {
                display: false
            },
            tooltips: {
                callbacks: {
                    label: function(tooltipItem, data) {
                        var allData = data.datasets[tooltipItem.datasetIndex].data;
                        var tooltipLabel = data.labels[tooltipItem.index];
                        var tooltipData = allData[tooltipItem.index];
                        var tooltipPercentage = Math.round(10000 * tooltipData / $report_summary.getScenarios()) / 100;
                        return tooltipLabel + ": " + tooltipData + " (" + tooltipPercentage + "%)";
                    }
                }
            }
        }
    });

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy