/// <summary>
        /// Method for populating the Charts
        /// </summary>
        public void populateCharts()
        {
            if (DbConnector.OpenSQLConnection()) // Open connection to the database
            {
                ReportsGenerator      reportGen     = new ReportsGenerator();
                List <StatusAnalysis> statusAnalyis = reportGen.StatusAnalysis();

                barChart.DataSource = statusAnalyis.OrderBy(i => i.Status);
                barChart.Series["Defect Count"].XValueMember  = "Status";
                barChart.Series["Defect Count"].YValueMembers = "Count";
                barChart.Series["Defect Count"].YValueType    = ChartValueType.Int32;

                doughnutChart.DataSource = statusAnalyis.OrderBy(i => i.Status);
                doughnutChart.Series["Count"].XValueMember  = "Status";
                doughnutChart.Series["Count"].YValueMembers = "Count";
                doughnutChart.Series["Count"].YValueType    = ChartValueType.Int32;

                DefectDataAccess defect = new DefectDataAccess();
                var defects             = defect.GetAllDefects();
                drePointChart.DataSource = defect.GetAllDefects();
                drePointChart.Series["DRE"].XValueMember  = "DefectId";
                drePointChart.Series["DRE"].YValueMembers = "DRE";
                drePointChart.Series["DRE"].YValueType    = ChartValueType.Int32;

                List <AgeAnalysis> ageAnalysis = new List <AgeAnalysis>();
                foreach (var d in defects.Zip(reportGen.calculateAge(defects), Tuple.Create))
                {
                    ageAnalysis.Add(new AgeAnalysis
                    {
                        DefectId = d.Item1.DefectId,
                        Age      = d.Item2
                    });
                }
                agePointChart.DataSource = ageAnalysis;
                agePointChart.Series["Age"].XValueMember  = "DefectId";
                agePointChart.Series["Age"].YValueMembers = "Age";
                agePointChart.Series["Age"].YValueType    = ChartValueType.Int32;
            }
            else
            {
                // Connection could not be opened
                MessageBox.Show("Connection to the database could not be established", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            DbConnector.CloseSQLConnection(); // Close connection to the database
        }