NUnitGoCore.CustomElements.ReportSections.MainInformationSection.MainInfoChart.MainInfoChart C# (CSharp) Method

MainInfoChart() public method

public MainInfoChart ( MainStatistics stats, string id ) : System.IO
stats NUnitGoCore.Utils.MainStatistics
id string
return System.IO
        public MainInfoChart(MainStatistics stats, string id)
        {
            var data = "[" + $"{{name: 'Passed', y: {stats.TotalPassed}, color: '" + Colors.TestPassed + "'}," +
                       $"{{name: 'Failed', y: {stats.TotalFailed}, color: '" + Colors.TestFailed + "'}," +
                       $"{{name: 'Broken', y: {stats.TotalBroken}, color: '" + Colors.TestBroken + "'}," +
                       $"{{name: 'Ignored', y: {stats.TotalIgnored}, color: '" + Colors.TestIgnored + "'}," +
                       $"{{name: 'Inconclusive', y: {stats.TotalInconclusive}, color: '" + Colors.TestInconclusive +
                       "'}" + "]";

            JsCode =
                $@"
                    $(function () {{
                        $('#{id}').highcharts({{
               	                chart: {{
                                    type: 'pie'
                                }},
                            title: {{
                                text: 'Test results'
                            }},
                            series:
                            [{{
                                name: 'Results',
                                data: {data}
                            }}]
                        }});
                }});";
        }