// Load Specific Year Collection Reports private void LoadReports() { try { series = new SeriesCollection(); int mIndex = 0; for (int i = 0; i < gb.MonthList.Length; i++) { series.Add(new PieSeries() { Title = gb.MonthList[i], Values = new ChartValues <int> { sql.GetTotalTransByMonth(sql.CreateConnection(), gb.MonthIndex[mIndex], YearTextBox.Text) }, DataLabels = true, LabelPoint = labelPoint }); mIndex += 1; CollectablesPieChart.Series = series; CollectablesPieChart.LegendLocation = LegendLocation.Bottom; // fix for Negative/Black PieChart (Sean Baang) CollectablesPieChart.Hide(); CollectablesPieChart.Show(); } } catch (Exception e) { MessageBox.Show(e.ToString()); } }
// Load Current Year Collection Reports public void LoadCurrReportsAsync() { try { series = new SeriesCollection(); int mIndex = 0; for (int i = 0; i < gb.MonthList.Length; i++) { series.Add(new PieSeries() { Title = gb.MonthList[i], Values = new ChartValues <int> { sql.GetTotalTransByMonth(sql.CreateConnection(), gb.MonthIndex[mIndex], currYear) }, DataLabels = true, LabelPoint = labelPoint }); mIndex += 1; CollectablesPieChart.Series = series; CollectablesPieChart.LegendLocation = LegendLocation.Bottom; // fix for Negative/Black PieChart (Sean Baang) CollectablesPieChart.Hide(); CollectablesPieChart.Show(); } } catch { //TODO: Make exception output. } }