private void button_21_Click(object sender, EventArgs e) { QMS3.Classes.visifire vschart = new QMS3.Classes.visifire(); string str = System.AppDomain.CurrentDomain.BaseDirectory; Uri url = new Uri(str + "chart/Demo.htm"); webBrowser_21.Url = url; chartdata.updateData(5, dateTimePicker_21.Value, comboBoxCenter.SelectedIndex).ToString(); vschart.reSize(webBrowser_21.Size.Width, webBrowser_21.Size.Height); vschart.settitle("当日转运中心报表", "时间", "运输量"); string[] column=new string[16]; double[] data=new double[16]; for (int i = 0; i <= 15; i++) { column[i] = (i + 5).ToString() + ":00"; data[i]=chartdata.stationdaybox[i]; } vschart.set3D(true); Random rd = new Random(); vschart.setData(column, data, 16); string type = comboBox_21.Text; type = type.Replace("饼图","pie"); type = type.Replace("曲线图", "spline"); type = type.Replace("线图", "line"); type = type.Replace("条形图", "column"); vschart.setType(type); webBrowser_21.Url = vschart.displayChart(); }
private void button_23_2_Click(object sender, EventArgs e) { #region 月图表 QMS3.Classes.visifire vschart = new QMS3.Classes.visifire(); string str = System.AppDomain.CurrentDomain.BaseDirectory; Uri url = new Uri(str + "chart/Demo.htm"); webBrowser_23_2.Url = url; chartdata.updateData(3, dateTimePicker_23_2.Value, 0); if (comboBox_23_2.Text == " 去年同比 ") chartdata.updateData(6, dateTimePicker_23_2.Value, 0); if (comboBox_23_4.Text == " 本年环比 ") chartdata.updateData(4, dateTimePicker_23_2.Value, 0); vschart.reSize(webBrowser_23_2.Size.Width, webBrowser_23_2.Size.Height); vschart.settitle(dateTimePicker_23_2.Value.ToString("yyyy年MM月") + "报表", "日期", "运输量(单位:吨)"); if (comboBox_23_4.Text == " 去年同比 ") vschart.settitle(dateTimePicker_23_2.Value.ToString("MM月") + "年同比报表", "日期", "运输量(单位:吨)"); if (comboBox_23_4.Text == " 本年环比 ") vschart.settitle(dateTimePicker_23_2.Value.ToString("MM月") + "与上月环比报表", "日期", "运输量(单位:吨)"); string[] column = new string[31]; double[] data = new double[31]; double[] data2 = new double[31]; int daysofm = QMS3.Classes.Datetimecalc.daysofmonth(dateTimePicker_23_2.Value); if (comboBox_23_4.Text == " 去年同比 ") daysofm =System.Math.Max(QMS3.Classes.Datetimecalc.daysofmonth(dateTimePicker_23_2.Value),QMS3.Classes.Datetimecalc.daysofmonth(dateTimePicker_23_2.Value.AddMonths(-12))); if (comboBox_23_4.Text == " 本年环比 ") daysofm =System.Math.Max(QMS3.Classes.Datetimecalc.daysofmonth(dateTimePicker_23_2.Value),QMS3.Classes.Datetimecalc.daysofmonth(dateTimePicker_23_2.Value.AddMonths(-1))); for (int i = 0; i < daysofm; i++) { column[i] = (i + 1).ToString(); data[i] = chartdata.month[i]; if (comboBox_23_4.Text == " 去年同比 " || comboBox_23_4.Text == " 本年环比 ") data2[i] = chartdata.lastmonth[i]; } vschart.s1 = dateTimePicker_23_2.Value.ToString("yyyy年MM月"); if (comboBox_23_4.Text == " 去年同比 ") vschart.s2 = dateTimePicker_23_2.Value.AddMonths(-12).ToString("yyyy年MM月"); if (comboBox_23_4.Text == " 本年环比 ") vschart.s2 = dateTimePicker_23_2.Value.AddMonths(-1).ToString("yyyy年MM月"); vschart.set3D(true); vschart.setData(column, data, daysofm); if (comboBox_23_4.Text == " 去年同比 " || comboBox_23_4.Text == " 本年环比 ") vschart.setData2(data2); string type = comboBox_23_3.Text; type = type.Replace("雷达图", "Radar"); type = type.Replace("曲线图", "spline"); type = type.Replace("直线图", "line"); type = type.Replace("条形图", "column"); vschart.setType(type); webBrowser_23_2.Url = vschart.displayChart(); #endregion }
private void button5_Click(object sender, EventArgs e) { #region 年图表 QMS3.Classes.visifire vschart = new QMS3.Classes.visifire(); string str = System.AppDomain.CurrentDomain.BaseDirectory; Uri url = new Uri(str + "chart/Demo.htm"); webBrowser_23.Url = url; chartdata.updateData(1, dateTimePicker_23.Value, 0); if (comboBox_23_2.Text == " 去年同比 ") chartdata.updateData(2, dateTimePicker_23.Value, 0); vschart.reSize(webBrowser_23.Size.Width, webBrowser_23.Size.Height); vschart.settitle(dateTimePicker_23.Value.ToString("yyyy") + "年报表", "日期", "运输量(单位:吨)"); if (comboBox_23_2.Text == " 去年同比 ") vschart.settitle(dateTimePicker_23.Value.ToString("yyyy") + "年同比报表", "日期", "运输量(单位:吨)"); string[] column = new string[12]; double[] data = new double[12]; double[] data2 = new double[12]; for (int i = 0; i <= 11; i++) { column[i] = (i+1).ToString() + "月"; data[i] = chartdata.year[i]; if (comboBox_23_2.Text == " 去年同比 ") data2[i] = chartdata.lastyear[i]; } vschart.s1 = dateTimePicker_23.Value.ToString("yyyy") + "年"; vschart.s2 = dateTimePicker_23.Value.AddMonths(-12).ToString("yyyy")+"年"; vschart.set3D(true); vschart.setData(column, data, 12); if (comboBox_23_2.Text == " 去年同比 ") vschart.setData2(data2); string type = comboBox_23_1.Text; type = type.Replace("雷达图", "Radar"); type = type.Replace("曲线图", "spline"); type = type.Replace("直线图", "line"); type = type.Replace("条形图", "column"); vschart.setType(type); webBrowser_23.Url = vschart.displayChart(); #endregion }