本文整理汇总了C#中PointCollection.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# PointCollection.ToArray方法的具体用法?C# PointCollection.ToArray怎么用?C# PointCollection.ToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointCollection
的用法示例。
在下文中一共展示了PointCollection.ToArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AjaxReport01
private void AjaxReport01()
{
// hcVendas.Appearance = new Appearance { renderTo = "container", zoomType = "x" };
// hcVendas.YAxis.Add(new YAxisItem { title = new Title("SoC"), type = AxisDataType.linear });
//hcVendas.XAxis.Add(new XAxisItem { maxZoom = 5, labels = (new Labels { rotation = 45, step = 2 }) });
hcVendas.Title = new Title("SoC Daily");
hcVendas.SubTitle = new SubTitle("Min - Max - Dash");
hcVendas.Theme = "gray";
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 { title = new Title("Time in Hours") });
hcVendas.XAxis.Add(new XAxisItem { type = AxisDataType.datetime, dateTimeLabelFormats = new DateTimeLabelFormats { hour = "%H" }, title = new Title("Time in Hours") });
// hcVendas.XAxis.Add(new XAxisItem { categories = new object[] { "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00", "24:00"} });
// 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();
GetChartData gd = new GetChartData();
DateTime dt1 = new DateTime(2015,8,22);
DataTable dataTable = gd.GetSoCDt(194, dt1);
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"])));
// 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 = "SocMin", data = pointCollectionSocMin.ToArray() }, new Serie { name = "SocMax", data = pointCollectionSocMax.ToArray() }, new Serie { name = "SocDash", 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();
}
示例2: ReportServices_DailyGrab_GenVehicleData_SOC
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();
}
示例3: ReportServices_DailyGrab_GenVehicleData_VinChargingHist
private void ReportServices_DailyGrab_GenVehicleData_VinChargingHist(Vehicles v, int WeekNumber, int YearNumber)
{
GetChartData gd = new GetChartData();
DataTable DtRange = gd.GetDateRangeFromWeekNumber(WeekNumber,YearNumber);
DataTable dataTable = gd.Dt_DailyGrab_GetVenChargingHist(v.VinID, WeekNumber, YearNumber, Rounding);
string mainTitle = string.Format("Vehicle Charging - {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("Occurence") });
//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("Charinging Time in Min") });
var series = new Collection<Serie> { new Serie { name = "Counts", 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();
}
示例4: ReportServices_DailyGrab_GenVehicleData_VinChgEnergyHist
private void ReportServices_DailyGrab_GenVehicleData_VinChgEnergyHist(Vehicles v, int WeekNumber, int YearNumber)
{
GetChartData gd = new GetChartData();
DataTable DtRange = gd.GetDateRangeFromWeekNumber(WeekNumber, YearNumber);
DataTable dataTable = gd.Dt_DailyGrab_GetVenChgEnergyHist(v.VinID, WeekNumber, YearNumber, Rounding);
string mainTitle = string.Format("Chrg Energy kWh - {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("Chrg Energy kWh") });
//Get point collection
var pointCollectionChgEnergy = 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)
{
pointCollectionChgEnergy.Add(new Point(Convert.ToDouble(row["Chg_Energy_kwh"])));
buckets.Add(row["ProcessDate"].ToString());
}
//Add data to serie
hcFrutas.XAxis.Add(new XAxisItem { type = AxisDataType.linear, tickColor = "#ccc", categories = buckets.ToArray(), tickLength = 1, title = new Title("Date") });
var series = new Collection<Serie> { new Serie { name = "Chrg Energy kWh", data = pointCollectionChgEnergy.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();
}
示例5: ReportServices_DailyGrab_GenChargerData_ChargerHist
private void ReportServices_DailyGrab_GenChargerData_ChargerHist(Chargers v, int WeekNumber, int YearNumber)
{
GetChartData gd = new GetChartData();
DataTable DtRange = gd.GetDateRangeFromWeekNumber(WeekNumber, YearNumber);
DataTable dataTable = gd.Dt_DailyGrab_GetChargerStatusHist(v.ChargingStationID, WeekNumber, YearNumber, Rounding);
string mainTitle = string.Format("Chrg Status - {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.ChargingStationID);
hcFrutas.Title = new Title(mainTitle);
hcFrutas.SubTitle = new SubTitle(subTitle);
hcFrutas.Width = 800;
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("Chrg Status") });
//Get point collection
var pointCollectionChgStatusCnt = new PointCollection();
var pointCollectionChg_TotalDocking = new PointCollection();
var pointCollectionChg_Complete = new PointCollection();
var pointCollectionChg_Fail = new PointCollection();
var pointCollectionChg_OpErrors = new PointCollection();
var pointCollectionChg_OpAborts = new PointCollection();
var pointCollectionCat = new PointCollection();
//var pointCollectionSocMax = new PointCollection();
//var pointCollectionSocDas = new PointCollection();
List<string> buckets = new List<string>();
List<string> status = new List<string>();
// Add string using Add method
foreach (DataRow row in dataTable.Rows)
{
pointCollectionChg_TotalDocking.Add(new Point(Convert.ToDouble(row["TotalDocking"])));
pointCollectionChg_Complete.Add(new Point(row["Complete"]));
pointCollectionChg_Fail.Add(new Point(row["Fail"]));
pointCollectionChg_OpErrors.Add(new Point(row["OpErrors"]));
pointCollectionChg_OpAborts.Add(new Point(row["OpAborts"]));
buckets.Add(row["DateLabel"].ToString());
//status.Add(row["col"].ToString());
}
//Add data to serie
hcFrutas.XAxis.Add(new XAxisItem { type = AxisDataType.linear, tickColor = "#ccc", categories = buckets.ToArray(), tickLength = 1, title = new Title("Date") });
var series = new Collection<Serie> { new Serie { name = "TotalDocking", data = pointCollectionChg_TotalDocking.ToArray(), type = RenderType.column, showInLegend = true } ,
new Serie { name = "Complete", data = pointCollectionChg_Complete.ToArray(), type = RenderType.column, showInLegend = true } ,
new Serie { name = "Fail", data = pointCollectionChg_Fail.ToArray(), type = RenderType.column, showInLegend = true } ,
new Serie { name = "OpErrors", data = pointCollectionChg_OpErrors.ToArray(), type = RenderType.column, showInLegend = true } ,
new Serie { name = "OpAborts", data = pointCollectionChg_OpAborts.ToArray(), type = RenderType.column, showInLegend = true }
};
// var series = new Collection<Serie> { new Serie { name = "Charge Status", data = pointCollectionChgStatusCnt.ToArray(), type = RenderType.column, showInLegend = false }, new Serie { name = "Charge", data = pointCollectionCat.ToArray(), type = RenderType.column, showInLegend = false } };
// var series = new Collection<Serie> { new Serie { name = "SocMin", data = pointCollectionSocMin.ToArray() }, new Serie { name = "SocMax", data = pointCollectionSocMax.ToArray() }, new Serie { name = "SocDash", data = pointCollectionSocDas.ToArray() } };
//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 ,formatter="function() { if(this.y != 0) { return this.y;}}"}
dataLabels = new DataLabels { enabled = true }
};
//Bind the control
hcFrutas.DataSource = series;
hcFrutas.DataBind();
}
示例6: ReportServices_DailyGrab_GenVehicleData_CurrentByPacks
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();
}
示例7: ReportServices_DailyGrab_GenVehicleData_VinSpeedHist
private void ReportServices_DailyGrab_GenVehicleData_VinSpeedHist(Vehicles v, DateTime dt)
{
GetChartData gd = new GetChartData();
DataTable dataTable = gd.Dt_DailyGrab_GetVenSpeedHist(v.VinID, dt, Rounding);
string mainTitle = string.Format("Vehicle Speed Band - {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("Time in Mins") });
// hcVendas.XAxis.Add(new XAxisItem { title = new Title("Time Buckets"), categories = new[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });
// hcVendas.Tooltip = new ToolTip("Highcharts.dateFormat('%H:%M', this.x) +': '+ this.y");
//Get point collection
var pointCollectionVinSpeed = new PointCollection();
var pointCollectionCat = new PointCollection();
//var pointCollectionSocMax = new PointCollection();
//var pointCollectionSocDas = new PointCollection();
List<string> revenues = new List<string>();
// Add string using Add method
foreach (DataRow row in dataTable.Rows)
{
pointCollectionVinSpeed.Add(new Point(Convert.ToDouble(row["TimeInMins"])));
revenues.Add(row["BucketName"].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() });
hcVendas.XAxis.Add(new XAxisItem { title = new Title("Time Buckets"), categories = revenues.ToArray(), labels = (new Labels() { rotation = -90, step = 1, y = 20 }) });
var series = new Collection<Serie> { new Serie { name = "VinSpeed", data = pointCollectionVinSpeed.ToArray(), type = RenderType.column } };
series.Add(new Serie { name = "VinSpeed2", data = pointCollectionVinSpeed.ToArray(), type = RenderType.spline });
//hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = true }, dataLabels = new DataLabels { enabled = true } };
//Bind the control
hcVendas.DataSource = series;
hcVendas.DataBind();
}
示例8: ReportServices_DailyGrab_GenVehicleData_VinSpeed
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();
}
示例9: ReportServices_DailyGrab_GenVehicleData_SOCByPacks
//.........这里部分代码省略.........
var pointCollectionSocMinPack7 = new PointCollection();
var pointCollectionSocMax = new PointCollection();
var pointCollectionSocMaxPack0 = new PointCollection();
var pointCollectionSocMaxPack1 = new PointCollection();
var pointCollectionSocMaxPack2 = new PointCollection();
var pointCollectionSocMaxPack3 = new PointCollection();
var pointCollectionSocMaxPack4 = new PointCollection();
var pointCollectionSocMaxPack5 = new PointCollection();
var pointCollectionSocMaxPack6 = new PointCollection();
var pointCollectionSocMaxPack7 = new PointCollection();
foreach (DataRow row in dataTable.Rows)
{
if (dtype == "MinSoC")
{
// 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"])));
//.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"])));
pointCollectionSocMinPack0.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm0_usi_SoCMin_pct"])));
pointCollectionSocMinPack1.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm1_usi_SoCMin_pct"])));
pointCollectionSocMinPack2.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm2_usi_SoCMin_pct"])));
pointCollectionSocMinPack3.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm3_usi_SoCMin_pct"])));
pointCollectionSocMinPack4.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm4_usi_SoCMin_pct"])));
pointCollectionSocMinPack5.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm5_usi_SoCMin_pct"])));
pointCollectionSocMinPack6.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm6_usi_SoCMin_pct"])));
pointCollectionSocMinPack7.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm7_usi_SoCMin_pct"]),System.Drawing.Color.Black));
//pointCollectionSocMinPack0.Add(new Point(Convert.ToInt64(1), Convert.ToDouble(row["PCpm0_usi_SoCMin_pct"])));
//pointCollectionSocMinPack1.Add(new Point(Convert.ToInt64(2), Convert.ToDouble(row["PCpm1_usi_SoCMin_pct"])));
//pointCollectionSocMinPack2.Add(new Point(Convert.ToInt64(3), Convert.ToDouble(row["PCpm2_usi_SoCMin_pct"])));
//pointCollectionSocMinPack3.Add(new Point(Convert.ToInt64(4), Convert.ToDouble(row["PCpm3_usi_SoCMin_pct"])));
//pointCollectionSocMinPack4.Add(new Point(Convert.ToInt64(5), Convert.ToDouble(row["PCpm4_usi_SoCMin_pct"])));
//pointCollectionSocMinPack5.Add(new Point(Convert.ToInt64(6), Convert.ToDouble(row["PCpm5_usi_SoCMin_pct"])));
//pointCollectionSocMinPack6.Add(new Point(Convert.ToInt64(7), Convert.ToDouble(row["PCpm6_usi_SoCMin_pct"])));
//pointCollectionSocMinPack7.Add(new Point(Convert.ToInt64(8), Convert.ToDouble(row["PCpm7_usi_SoCMin_pct"])));
}
else if (dtype == "MaxSoC")
{
// 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"])));
pointCollectionSocMaxPack0.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm0_usi_SoCMax_pct"])));
pointCollectionSocMaxPack1.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm1_usi_SoCMax_pct"])));
pointCollectionSocMaxPack2.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm2_usi_SoCMax_pct"])));
pointCollectionSocMaxPack3.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm3_usi_SoCMax_pct"])));
pointCollectionSocMaxPack4.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm4_usi_SoCMax_pct"])));
pointCollectionSocMaxPack5.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm5_usi_SoCMax_pct"])));
pointCollectionSocMaxPack6.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm6_usi_SoCMax_pct"])));
pointCollectionSocMaxPack7.Add(new Point(Convert.ToInt64((DateTime.Parse(row["Time_Occur"].ToString()).Subtract(new DateTime(2015, 1, 1))).TotalMilliseconds), Convert.ToDouble(row["PCpm7_usi_SoCMax_pct"])));
}
}
//Add data to serie
if (dtype == "MinSoC")
{
var seriesMin = new Collection<Serie> {
// new Serie { name = "SocMin", data = pointCollectionSocMin.ToArray() },
new Serie { name = "P0", data = pointCollectionSocMinPack0.ToArray() },
new Serie { name = "P1", data = pointCollectionSocMinPack1.ToArray() },
new Serie { name = "P2", data = pointCollectionSocMinPack2.ToArray() },
new Serie { name = "P3", data = pointCollectionSocMinPack3.ToArray() },
new Serie { name = "P4", data = pointCollectionSocMinPack4.ToArray() },
new Serie { name = "P5", data = pointCollectionSocMinPack5.ToArray() },
new Serie { name = "P6", data = pointCollectionSocMinPack6.ToArray() },
new Serie { name = "P7", data = pointCollectionSocMinPack7.ToArray(),color="Grey" }
};
hcVendas.DataSource = seriesMin;
}
else if (dtype == "MaxSoC")
{
var seriesMax = new Collection<Serie> {
//new Serie { name = "SocMax", data = pointCollectionSocMax.ToArray() },
new Serie { name = "P0", data = pointCollectionSocMaxPack0.ToArray() },
new Serie { name = "P1", data = pointCollectionSocMaxPack1.ToArray() },
new Serie { name = "P2", data = pointCollectionSocMaxPack2.ToArray() },
new Serie { name = "P3", data = pointCollectionSocMaxPack3.ToArray() },
new Serie { name = "P4", data = pointCollectionSocMaxPack4.ToArray() },
new Serie { name = "P5", data = pointCollectionSocMaxPack5.ToArray() },
new Serie { name = "P6", data = pointCollectionSocMaxPack6.ToArray() },
new Serie { name = "P7", data = pointCollectionSocMaxPack7.ToArray() ,color="Grey" }
};
hcVendas.DataSource = seriesMax;
}
hcVendas.PlotOptions = new PlotOptionsLine { marker = new Marker { enabled = false }, dataLabels = new DataLabels { enabled = false }};
//Bind the control
hcVendas.DataBind();
}