private void ReportServices_DailyGrab_GenVehicleData_SOC()
        {
            GetChartData gd = new GetChartData();

            DateTime dt1 = new DateTime(2015, 8, 22);

               // DataTable dataTable = gd.GetSoCDt(194, dt1);
            DataTable dataTable = gd.Dt_DailyGrab_GetSoC(194, dt1, 100);

            //string mainTitle = string.Format("Soc 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("SoC %") });

            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 pointCollectionSocMin = new PointCollection();
            var pointCollectionSocMax = new PointCollection();
            var pointCollectionSocDas = new PointCollection();

            foreach (DataRow row in dataTable.Rows)
            {
                //pointCollectionSocMin.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["SocMin"])));
                //pointCollectionSocMax.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["SocMax"])));
                //pointCollectionSocDas.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["SocDash"])));

                pointCollectionSocMin.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCes_usi_SoCmin_pct"])));
                pointCollectionSocMax.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCes_usi_SoCmax_pct"])));
                pointCollectionSocDas.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCbo_usi_DashSOC_pct"])));
                // pointCollection.Add(new Point(DateTime.Parse(row["Time_Occur"].ToString()), Convert.ToDouble(row["SocMin"])));
            }

            //Add data to serie
            var series = new Collection<Serie> { new Serie { name = "PCes_usi_SoCmin_pct", data = pointCollectionSocMin.ToArray() }, new Serie { name = "PCes_usi_SoCmax_pct", data = pointCollectionSocMax.ToArray() }, new Serie { name = "PCbo_usi_DashSOC_pct", data = pointCollectionSocDas.ToArray() } };
            hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = false }, dataLabels = new DataLabels { enabled = false } };

            //Bind the control
            hcVendas.DataSource = series;
            hcVendas.DataBind();
        }
        private void ReportServices_DailyGrab_GenVehicleData_VinSpeed(Vehicles v, DateTime dt)
        {
            GetChartData gd = new GetChartData();
            DataTable dataTable = gd.Dt_DailyGrab_GetSoC(v.VinID, dt, Rounding);

            string mainTitle = string.Format("Vin Speed 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("Speed in MPH") });

            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 pointCollectionVinSpeed = new PointCollection();
            var pointCollectionCharging = new PointCollection();
            var pointCollectionScoopHeater = new PointCollection();

            foreach (DataRow row in dataTable.Rows)
            {
                pointCollectionVinSpeed.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpt_int_Spd_mph"])));
                pointCollectionCharging.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCes_usi_ChargeEnable_xx"])));
                pointCollectionScoopHeater.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCbo_bo_ScoopHeaterOn"])));
                // pointCollection.Add(new Point(DateTime.Parse(row["Time_Occur"].ToString()), Convert.ToDouble(row["SocMin"])));
            }

            //Add data to serie

            var series = new SerieCollection();

            series.Add(new Serie { id = "VinSpeed", name = "VinSpeed", type = RenderType.spline, data = pointCollectionVinSpeed.ToArray() });
            series.Add(new Serie { id = "Charging", name = "Charging", color = "red", type = RenderType.spline, data = pointCollectionCharging.ToArray() });
            series.Add(new Serie { id = "ScoopHeater", name = "ScoopHeater", type = RenderType.spline, data = pointCollectionScoopHeater.ToArray() });

            hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = false }, dataLabels = new DataLabels { enabled = false } };

            // var series = new Collection<Serie> { new Serie { name = "VinSpeed", data = pointCollectionVinSpeed.ToArray(), type = RenderType.scatter }, new Serie { name = "Charging", type = RenderType.scatter, data = pointCollectionCharging.ToArray() }, new Serie { name = "ScoopHeater", type = RenderType.scatter, data = pointCollectionScoopHeater.ToArray() } };

            // hcVendas.PlotOptions = new PlotOptionsScatter { marker = new Marker { enabled = false }, dataLabels = new DataLabels { enabled = false } };

            //Bind the control
            hcVendas.DataSource = series;
            hcVendas.DataBind();
        }