public void RenderChart2_Year() { Chart2.colorSet.Add(Color.FromArgb(99, 179, 202)); Bunifu.DataViz.WinForms.Canvas canvas = new Bunifu.DataViz.WinForms.Canvas(); Bunifu.DataViz.WinForms.DataPoint values = new Bunifu.DataViz.WinForms.DataPoint(Bunifu.DataViz.WinForms.BunifuDataViz._type.Bunifu_splineArea); int year1 = Convert.ToInt32(cBtuNam.SelectedItem); int year2 = Convert.ToInt32(cBdenNam.SelectedItem); SortedDictionary <int, float> totalofyear = statictisBLL.TotalofYear(year1, year2); if (totalofyear != null) { foreach (var item in totalofyear) { values.addLabely(item.Key.ToString(), item.Value); } canvas.addData(values); Chart2.Render(canvas); } }
public void RenderChart2_Date() { Chart2.colorSet.Add(Color.FromArgb(241, 160, 122)); Bunifu.DataViz.WinForms.Canvas canvas = new Bunifu.DataViz.WinForms.Canvas(); Bunifu.DataViz.WinForms.DataPoint values = new Bunifu.DataViz.WinForms.DataPoint(Bunifu.DataViz.WinForms.BunifuDataViz._type.Bunifu_splineArea); DateTime TuNgay = Convert.ToDateTime(dtpTu.Value).Date; DateTime DenNgay = Convert.ToDateTime(dtpDen.Value).Date.AddDays(1).AddTicks(-1); SortedDictionary <string, float> totalofdate = statictisBLL.TotalofDate(TuNgay, DenNgay); if (totalofdate != null) { foreach (var item in totalofdate) { values.addLabely(item.Key, item.Value); } canvas.addData(values); Chart2.Render(canvas); } }
public void RenderChart2_Month() { Chart2.colorSet.Add(Color.FromArgb(189, 127, 207)); Bunifu.DataViz.WinForms.Canvas canvas = new Bunifu.DataViz.WinForms.Canvas(); Bunifu.DataViz.WinForms.DataPoint values = new Bunifu.DataViz.WinForms.DataPoint(Bunifu.DataViz.WinForms.BunifuDataViz._type.Bunifu_splineArea); int month1 = Convert.ToInt32(cBtuThang.SelectedItem); int year1 = Convert.ToInt32(cBtuNamofThang.SelectedItem); int month2 = Convert.ToInt32(cBdenThang.SelectedItem); int year2 = Convert.ToInt32(cbdenNamofThang.SelectedItem); SortedDictionary <string, float> totalofmonth = statictisBLL.TotalofMonth(month1, year1, month2, year2); if (totalofmonth != null) { foreach (var item in totalofmonth) { values.addLabely(item.Key, item.Value); } canvas.addData(values); Chart2.Render(canvas); } }