public void getLabelData() { try { tot_submit.Text = DBTool.getTotSubmit().ToString(); tot_AC.Text = DBTool.getTotAC().ToString(); tot_judging.Text = (DBTool.getTotResult(2) + DBTool.getTotResult(3)).ToString(); tot_pending.Text = (DBTool.getTotResult(0) + DBTool.getTotResult(1)).ToString(); } catch (Exception ex) { print("网络连接中断!"); Application.Exit(); } }
public void getPieChart() { //提交分类统计 pieChart1.Series = new SeriesCollection { new PieSeries { Title = "RTE", Values = new ChartValues <double> { DBTool.getTotResult(10) }, PushOut = 15, DataLabels = true }, new PieSeries { Title = "WA", Values = new ChartValues <double> { DBTool.getTotResult(6) }, DataLabels = true }, new PieSeries { Title = "AC", Values = new ChartValues <double> { DBTool.getTotResult(4) }, DataLabels = true }, new PieSeries { Title = "TLE", Values = new ChartValues <double> { DBTool.getTotResult(7) }, DataLabels = true } }; //提交语言分类 pieChart2.Series = new SeriesCollection { new PieSeries { Title = "C", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(0) + DBTool.getTotResultBylanguage(13) }, PushOut = 15, DataLabels = true }, new PieSeries { Title = "C++", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(1) + DBTool.getTotResultBylanguage(14) }, DataLabels = true }, new PieSeries { Title = "JAVA", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(3) }, DataLabels = true }, new PieSeries { Title = "Python", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(6) + DBTool.getTotResultBylanguage(18) }, DataLabels = true } }; }
public MainPieChart() { InitializeComponent(); pieChart1.InnerRadius = 8; pieChart1.LegendLocation = LegendLocation.Right; pieChart2.InnerRadius = 8; pieChart2.LegendLocation = LegendLocation.Right; //提交分类统计 pieChart1.Series = new SeriesCollection { new PieSeries { Title = "RTE", Values = new ChartValues <double> { DBTool.getTotResult(10) }, PushOut = 15, DataLabels = true }, new PieSeries { Title = "WA", Values = new ChartValues <double> { DBTool.getTotResult(6) }, DataLabels = true }, new PieSeries { Title = "AC", Values = new ChartValues <double> { DBTool.getTotResult(4) }, DataLabels = true }, new PieSeries { Title = "TLE", Values = new ChartValues <double> { DBTool.getTotResult(7) }, DataLabels = true } }; //提交语言分类 pieChart2.Series = new SeriesCollection { new PieSeries { Title = "C", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(0) + DBTool.getTotResultBylanguage(13) }, PushOut = 15, DataLabels = true }, new PieSeries { Title = "C++", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(1) + DBTool.getTotResultBylanguage(14) }, DataLabels = true }, new PieSeries { Title = "JAVA", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(3) }, DataLabels = true }, new PieSeries { Title = "Python", Values = new ChartValues <double> { DBTool.getTotResultBylanguage(6) + DBTool.getTotResultBylanguage(18) }, DataLabels = true } }; }