//同年对比 public void sameYearCompire() { //选择的类别 li = null; li = new List <int>(); for (int i = 0; i < checkedList.Items.Count; i++) { if (checkedList.GetItemChecked(i)) { li.Add(i + 1); } } //选择的年份 year = tableCmb.SelectedItem.ToString(); //数据库操作 dt = this.dataSearch(year); //图表生成 chartForm chart0 = new chartForm(); chart0.li = li; chart0.year = year; chart0.dt = dt; chart0.attri = attri; chart0.classGraph = 1; chart0.Visible = true; }
//不同年对比 private void differYearCompire() { //选择的类别 li = null; li = new List <int>(); for (int i = 0; i < checkedListBox1.Items.Count; i++) { if (checkedListBox1.GetItemChecked(i)) { li.Add(i + 1); } } //选择的年份 years = null; years = new List <string>(); for (int i = 0; i < checkedListyear.Items.Count; i++) { if (checkedListyear.GetItemChecked(i)) { string temp = checkedListyear.Items[i].ToString(); temp = temp.Replace("年", ""); years.Add(temp); DataTable dtTemp = this.dataSearch(temp); dtList.Add(dtTemp); //数据库操作 } } //图表生成 chartForm chart0 = new chartForm(); chart0.li = li; chart0.years = years; chart0.dtList = dtList; chart0.attri = attri; chart0.classGraph = 2; chart0.Visible = true; }