private void ReportServices_DailyGrab_GenVehicleData_VinMinAirPressureHist(Vehicles v, int WeekNumber, int YearNumber) { GetChartData gd = new GetChartData(); DataTable DtRange = gd.GetDateRangeFromWeekNumber(WeekNumber,YearNumber); DataTable dataTable = gd.Dt_DailyGrab_GetVenMinAirPressureHist(v.VinID, WeekNumber, YearNumber, Rounding); string mainTitle = string.Format("Min Air Pressure - {0} - {1} ", Convert.ToDateTime(DtRange.Rows[0]["StartDate"]).ToString("d"), Convert.ToDateTime(DtRange.Rows[0]["EndDate"]).ToString("d")); string subTitle = string.Format("{0} - {1}", v.CustomerName, v.Vin); hcFrutas.Title = new Title(mainTitle); hcFrutas.SubTitle = new SubTitle(subTitle); hcFrutas.Theme = "grid"; hcFrutas.Legend = new Legend { align = Align.right, layout = Layout.vertical, verticalAlign = VerticalAlign.top, x = -10, y = 70, borderWidth = 0 }; hcFrutas.Appearance = new Appearance { renderTo = "container", animation = false }; hcFrutas.YAxis.Add(new YAxisItem { title = new Title("Time Percentage") }); //Get point collection var pointCollectionBrakePedal = new PointCollection(); var pointCollectionCat = new PointCollection(); //var pointCollectionSocMax = new PointCollection(); //var pointCollectionSocDas = new PointCollection(); List<string> buckets = new List<string>(); // Add string using Add method foreach (DataRow row in dataTable.Rows) { pointCollectionBrakePedal.Add(new Point(Convert.ToDouble(row["TimeInMins"]))); buckets.Add(row["BucketEnd"].ToString()); //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 //hcVendas.XAxis.Add(new XAxisItem { title = new Title("Time Buckets"), categories = pointCollectionCat.ToArray() }); //hcFrutas.XAxis.Add(new XAxisItem { type = AxisDataType.linear, categories = buckets.ToArray(), tickColor = "#ccc", tickLength = 50, labels = (new Labels() { rotation = -90, step = 1, y = 30 }) }); hcFrutas.XAxis.Add(new XAxisItem { type = AxisDataType.linear, tickColor = "#ccc", categories = buckets.ToArray(), tickLength = 1, title = new Title("Min Air Pressure") }); var series = new Collection<Serie> { new Serie { name = "% Of Time", data = pointCollectionBrakePedal.ToArray(), type = RenderType.column, showInLegend = false } }; //hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = true }, dataLabels = new DataLabels { enabled = true } }; hcFrutas.PlotOptions = new PlotOptionsColumn { groupPadding = 0, pointPadding = 0, shadow = true, borderWidth = 2, borderColor = "#666", dataLabels = new DataLabels { enabled = true } }; //Bind the control hcFrutas.DataSource = series; hcFrutas.DataBind(); }