protected void Page_Load(object sender, EventArgs e) { RadHtmlChartGroupDataSource.GroupDataSource(RadHtmlChart1, GetRawDataSource1(), "Year", "AreaSeries", "Sales", "Quarter"); RadHtmlChartGroupDataSource.GroupDataSource(RadHtmlChart4, GetRawDataSourcePurchase(), "Year", "LineSeries", "Sales", "Quarter"); RadHtmlChartGroupDataSource.GroupDataSource(RadHtmlChart2, GetRawDataSourceRevenue(), "Category", "ColumnSeries", "Sales", "Quarter"); ServiceReference2.Service1Client sc = new ServiceReference2.Service1Client(); var a = sc.GetSaleData(); RadHtmlChart3.DataSource = a; RadHtmlChart3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { negocio = new Implementacion(); RadHtmlChart1.DataSource = negocio.GetDataTable("select top 10 totalRegistros, regErroneos, regCorrectos, convert(varchar,CreadoFecha,103) fecha from LogsJobs where tipoJob = 1 order by fecha desc"); RadHtmlChart1.DataBind(); AreaChart.DataSource = negocio.GetDataTable("select top 10 totalRegistros, regErroneos, regCorrectos, convert(varchar,CreadoFecha,103) fecha from LogsJobs where tipoJob = 2 order by fecha desc"); AreaChart.DataBind(); RadHtmlChart2.DataSource = negocio.GetDataTable("select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regErroneos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Acividades' as label from LogsJobs where tipoJob = 1 " + "union all " + "select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regCorrectos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Horas' as label from LogsJobs where tipoJob = 1"); RadHtmlChart2.DataBind(); RadHtmlChart3.DataSource = negocio.GetDataTable("select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regErroneos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Actividades' as label from LogsJobs where tipoJob = 2 " + "union all " + "select top 1 (convert(decimal(18,2),totalRegistros)-convert(decimal(18,2),regCorrectos))/convert(decimal(18,2),totalRegistros)*100 as porcentaje, 'Horas' as label from LogsJobs where tipoJob = 2"); RadHtmlChart3.DataBind(); }
protected void gridFabStatus_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; for (int i = 0; i < item.Cells.Count; i++) { item.Cells[i].Text = item.Cells[i].Text.ToString(CultureInfo.InvariantCulture.NumberFormat); } double total_scope = Convert.ToDouble(item.Cells[2].Text); double sg_done = Convert.ToDouble(item.Cells[3].Text); double mat_avl = Convert.ToDouble(item.Cells[4].Text); double jc_issued = Convert.ToDouble(item.Cells[5].Text); double weld_done = Convert.ToDouble(item.Cells[6].Text); double nde_done = Convert.ToDouble(item.Cells[7].Text); double spl_paint = Convert.ToDouble(item.Cells[8].Text); double sent_to_site = Convert.ToDouble(item.Cells[9].Text); var sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(sg_done * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(sg_done * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart2.DataSource = sg_dt; RadHtmlChart2.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(mat_avl * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(mat_avl * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart3.DataSource = sg_dt; RadHtmlChart3.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(jc_issued * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(jc_issued * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart4.DataSource = sg_dt; RadHtmlChart4.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(weld_done * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(weld_done * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart5.DataSource = sg_dt; RadHtmlChart5.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(nde_done * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(nde_done * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart6.DataSource = sg_dt; RadHtmlChart6.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(spl_paint * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(spl_paint * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart7.DataSource = sg_dt; RadHtmlChart7.DataBind(); sg_dt = new DataTable(); sg_dt.Columns.Add("SCOPE_TEXT"); sg_dt.Columns.Add("SCOPE_VALUE"); sg_dt.Columns.Add("COLOR_CODE"); sg_dt.Rows.Add("SPOOLGEN PROGRESS", Math.Round(sent_to_site * 100 / total_scope, 1), "#4DCA5E"); sg_dt.Rows.Add("BALANCE", Math.Round(100 - Math.Round(sent_to_site * 100 / total_scope, 1), 1), "#D6D6D6"); RadHtmlChart8.DataSource = sg_dt; RadHtmlChart8.DataBind(); } }