private void ReportServices_DailyGrab_GenVehicleData_CurrentByPacks(Vehicles v, DateTime dt) { GetChartData gd = new GetChartData(); DataTable dataTable = gd.Dt_DailyGrab_GetCurrentbyPacks(v.VinID, dt, Rounding); string mainTitle = string.Format("Current Daily - {0}", dt.ToString("MM/dd/yy")); string subTitle = string.Format("{0} - {1}", v.CustomerName, v.Vin); hcVendas.Title = new Title(mainTitle); hcVendas.SubTitle = new SubTitle(subTitle); hcVendas.Theme = "grid"; hcVendas.Legend = new Legend { align = Align.right, layout = Layout.vertical, verticalAlign = VerticalAlign.top, x = -10, y = 70, borderWidth = 0 }; hcVendas.Appearance = new Appearance { renderTo = "container", animation = false }; hcVendas.YAxis.Add(new YAxisItem { title = new Title("Current Amps "), minorGridLineWidth = 0, gridLineWidth = 0 }); hcVendas.XAxis.Add(new XAxisItem { type = AxisDataType.datetime, dateTimeLabelFormats = new DateTimeLabelFormats { hour = "%H" }, title = new Title("Time in Hours") }); hcVendas.Tooltip = new ToolTip("Highcharts.dateFormat('%H:%M', this.x) +': '+ this.y"); //Get point collection var pointCollectionCurrent = new PointCollection(); var pointCollectionCurrentPack0 = new PointCollection(); var pointCollectionCurrentPack1 = new PointCollection(); var pointCollectionCurrentPack2 = new PointCollection(); var pointCollectionCurrentPack3 = new PointCollection(); var pointCollectionCurrentPack4 = new PointCollection(); var pointCollectionCurrentPack5 = new PointCollection(); var pointCollectionCurrentPack6 = new PointCollection(); var pointCollectionCurrentPack7 = new PointCollection(); foreach (DataRow row in dataTable.Rows) { // pointCollectionCurrent.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCes_usi_Current_pct"]))); pointCollectionCurrentPack0.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm0_uin_PackI_a"]))); pointCollectionCurrentPack1.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm1_uin_PackI_a"]))); pointCollectionCurrentPack2.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm2_uin_PackI_a"]))); pointCollectionCurrentPack3.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm3_uin_PackI_a"]))); pointCollectionCurrentPack4.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm4_uin_PackI_a"]))); pointCollectionCurrentPack5.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm5_uin_PackI_a"]))); pointCollectionCurrentPack6.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm6_uin_PackI_a"]))); pointCollectionCurrentPack7.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm7_uin_PackI_a"]))); } //Add data to serie var series = new Collection<Serie> { // new Serie { name = "Current", data = pointCollectionCurrent.ToArray() }, new Serie { name = "P0", data = pointCollectionCurrentPack0.ToArray() }, new Serie { name = "P1", data = pointCollectionCurrentPack1.ToArray() }, new Serie { name = "P2", data = pointCollectionCurrentPack2.ToArray() }, new Serie { name = "P3", data = pointCollectionCurrentPack3.ToArray() }, new Serie { name = "P4", data = pointCollectionCurrentPack4.ToArray() }, new Serie { name = "P5", data = pointCollectionCurrentPack5.ToArray() }, new Serie { name = "P6", data = pointCollectionCurrentPack6.ToArray() }, new Serie { name = "P7", data = pointCollectionCurrentPack7.ToArray() } }; hcVendas.DataSource = series; hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = false }, dataLabels = new DataLabels { enabled = false } }; //Bind the control hcVendas.DataBind(); }