private void AddNewSeries(UniversalEntity ue) { ChartSeries cs = new ChartSeries(radWP.SelectedText, ChartSeriesType.Spline); RadChart1.Series.Add(cs); int i = 0; List <ChartSeriesItem> csc = new List <ChartSeriesItem>(); foreach (ArrayList al in ue) { ChartSeriesItem csi = new ChartSeriesItem(); csi.YValue = (Convert.ToDouble(al[0])); csi.XValue = (i); //csi.XValue=(Convert.ToDateTime(al[1]).Ticks); //cs.AddItem((Convert.ToDouble(al[0])); i++; csc.Add(csi); } cs.AddItem(csc); RadChart1.DataBind(); RadChart1.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.ChartAxisLayoutMode.Normal; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.UsageChartDataBinding(); LoadCompany(); } List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Master.HeadingMessage = "Home"; if (!IsPostBack) { RadChart1.DataSource = MMSqlDataSource; RadChart1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { var dt = from k in _entities.GetBienDongNhanSu() orderby k.namsinh select k; List <GetBienDongNhanSu_Result> newLstBienDong = new List <GetBienDongNhanSu_Result>(); List <GetBienDongNhanSu_Result> lstBienDong = dt.ToList(); int?SumNV = lstBienDong[0].soNV; for (int i = 1; i < lstBienDong.Count; i++) { SumNV += lstBienDong[i].soNV; lstBienDong[i].soNV = SumNV; newLstBienDong.Add(lstBienDong[i]); } RadChart1.Series[0].DataYColumn = "soNV"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "namsinh"; RadChart1.DataSource = newLstBienDong; RadChart1.DataBind(); RadChart2.IntelligentLabelsEnabled = false; List <GetTyLeNamNu_Result> lstTyLe = _entities.GetTyLeNamNu().ToList(); ChartSeries serie = new ChartSeries(); serie.Name = "Giới tính"; serie.Type = ChartSeriesType.Pie; serie.Clear(); serie.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels; ChartSeriesItem item1 = new ChartSeriesItem(); item1.YValue = (double)lstTyLe[0].Nam; //item1.Name = "Nam"; item1.Appearance.Exploded = true; item1.Label.TextBlock.Text = "Nam" + " - #%"; serie.Items.Add(item1); ChartSeriesItem item2 = new ChartSeriesItem(); item2.YValue = (double)lstTyLe[0].Nu; //item2.Name = "Nữ"; item2.Appearance.Exploded = true; item2.Label.TextBlock.Text = "Nữ" + " - #%"; serie.Items.Add(item2); RadChart2.Series.Add(serie); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // Populate the chart DataTable tbl = new DataTable(); DataColumn col = new DataColumn("Temp"); col.DataType = typeof(int); tbl.Columns.Add(col); col = new DataColumn("Measurement"); col.DataType = typeof(string); tbl.Columns.Add(col); int size = 20; int maxLen = size.ToString().Length; Random r = new Random(); for (int i = 1; i <= size; i++) { tbl.Rows.Add(new object[] { r.Next(40), "Measurement " + i.ToString("D" + maxLen) }); } RadChart1.DataSource = tbl; RadChart1.DataBind(); } }
protected void btnApply_Click(object sender, EventArgs e) { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty && !string.IsNullOrEmpty(txtAcctNum.Text) && !string.IsNullOrWhiteSpace(txtAcctNum.Text)) { //use viewUsageSummarybyAccount view List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource3.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty && cboCycle.SelectedItem.Value != string.Empty) { //use viewUsageSummaryByCycle view List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource2.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { if (cboCompany.SelectedItem.Value != string.Empty) { List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource1.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } else { //use all data List <UsageItem> us = new List <UsageItem>(); DataView dv = (DataView)SqlDataSource4.Select(System.Web.UI.DataSourceSelectArguments.Empty); if (dv != null) { foreach (DataRowView dr in dv) { UsageItem v = new UsageItem(); v.BillDt = dr["BillDt"].ToString(); v.UsageSummary = (double)dr["UsageSummary"]; us.Add(v); } RadChart1.DataSource = us; RadChart1.Series[0].DataYColumn = "UsageSummary"; RadChart1.PlotArea.XAxis.DataLabelsColumn = "BillDt"; RadChart1.DataBind(); } } } } }
protected void RadButtonEstimate_Click(object sender, EventArgs e) { String errorMessage = null; T = f = ff = 0; if (IsModelEstimated) { IsModelEstimated = false; } else { IsModelEstimated = false; Boolean ok = CheckInputs(out errorMessage); Double eta = 0, beta = 0; ok = TWeibullMarkovLibrary.Weibull.EstimateParameters(RadNumericTextBox1.Text, RadNumericTextBox2.Text, RadComboBox1.SelectedValue, out eta, out beta, out errorMessage); if (ok && beta <= 0.0) // DIG 2/2/2012 This should never happen { ok = false; errorMessage = String.Format(@"Weibull model cannot be created for the given input: the 50% survival period is too short in comparison to the {0} period. Your options are: increase the first period, decrease the second period, or go with the default slope parameter (choose ""Don't know"" for the second threshold).", RadComboBox1.Text.Trim()); } if (ok) { Eta = eta; Beta = beta; ok = Tabulate(out errorMessage); } if (ok) { lblError.Text = String.Empty; lblError.Visible = false; ModelTable.Rows[0].Cells[2].Text = String.Format(" = {0:g6}", Beta); ModelTable.Rows[1].Cells[2].Text = String.Format(" = {0:g6}", Eta); if (Beta < 1.0) { ModelTable.Rows[0].Cells[2].Text += "*"; ModelTable.Rows[0].Cells[2].ForeColor = System.Drawing.Color.Red; ModelTable.Rows[0].Cells[2].ToolTip = @"The model has been estimated, but the slope parameter is less than one, which is typical for deterioration patterns known as ""infant mortality"", when deterioration tends to decrease over time rather than increase. This is not an error, but please be aware that for the advanced age the policy may prescribe less aggressive treatment than for early years, which may look counter-intuitive."; ModelTable.Rows[3].Cells[0].Text = "* Please fly the cursor over the red number for details."; } else if (Beta == 1.0) { ModelTable.Rows[0].Cells[2].Text += "*"; ModelTable.Rows[0].Cells[2].ForeColor = System.Drawing.Color.Red; ModelTable.Rows[0].Cells[2].ToolTip = @"When slope parameter (beta) equals 1 deterioration rate is constant over time. The policy recommendations for the condition state in such case do not change from year to year."; ModelTable.Rows[3].Cells[0].Text = "* Please fly the cursor over the red number for details."; } else { ModelTable.Rows[0].Cells[2].ForeColor = System.Drawing.Color.Black; ModelTable.Rows[0].Cells[2].ToolTip = String.Empty; ModelTable.Rows[3].Cells[0].Text = String.Empty; } RadChart1.DataSource = null; RadChart1.DataSource = _dt; RadChart1.DataBind(); RadChart1.PlotArea.SeriesCollection().GetSeries(0).Appearance.LabelAppearance.Visible = false; RadChart1.PlotArea.SeriesCollection().GetSeries(1).Appearance.LabelAppearance.Visible = false; if (IsLastState) { RadChart1.ChartTitle.TextBlock.Text = "Probability of failure (percent)"; } } else { lblError.Text = errorMessage; lblError.Visible = true; } IsModelEstimated = ok; } SetControlsAvailability(); }
void InitRadChart() { #region pregunta 1 RadChart1.Clear(); SetXAxis("1.- ¿Te Gustan Los VideoJuegos??", 3500, RadChart1); RadChart1.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Between; RadChart1.PlotArea.YAxis.AutoScale = false; SetYAxis(500); ChartSeries series1 = new ChartSeries("Si", ChartSeriesType.Bar); series1.ActiveRegionUrl = "#P2"; SetSeriesAppearance(series1); RadChart1.Series.Add(series1); ChartSeries series2 = new ChartSeries("No", ChartSeriesType.Bar); series2.ActiveRegionUrl = "#P3"; SetSeriesAppearance(series2); RadChart1.Series.Add(series2); ChartSeries series3 = new ChartSeries("Un poco", ChartSeriesType.Bar); series3.ActiveRegionUrl = "#P4"; SetSeriesAppearance(series3); RadChart1.Series.Add(series3); series1.AddItem(1300); series2.AddItem(1200); series3.AddItem(1000); #endregion #region pregunta 2 RadChart2.Clear(); SetXAxis(" 2.- ¿Que tiempo te la pasas jugando al día?", 3500, RadChart2); RadChart2.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Between; RadChart2.PlotArea.YAxis.AutoScale = false; SetYAxis(500); ChartSeries series1G2 = new ChartSeries("2 hrs al día", ChartSeriesType.Bar); SetSeriesAppearance(series1G2); RadChart2.Series.Add(series1G2); ChartSeries series2G2 = new ChartSeries("Entre 4 y 6 horas", ChartSeriesType.Bar); SetSeriesAppearance(series2G2); RadChart2.Series.Add(series2G2); ChartSeries series3G2 = new ChartSeries("Todo el día", ChartSeriesType.Bar); SetSeriesAppearance(series3G2); RadChart2.Series.Add(series3G2); series1G2.AddItem(1100); series2G2.AddItem(1300); series3G2.AddItem(1100); #endregion #region pregunta 2 RadChart3.Clear(); SetXAxis("3.- ¿Por que no te gustan?", 3500, RadChart3); RadChart3.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Between; RadChart3.PlotArea.YAxis.AutoScale = false; SetYAxis(500); ChartSeries series1G3 = new ChartSeries("Es una perdida de tiempo", ChartSeriesType.Bar); SetSeriesAppearance(series1G3); RadChart3.Series.Add(series1G3); ChartSeries series2G3 = new ChartSeries("No tengo una consola", ChartSeriesType.Bar); SetSeriesAppearance(series2G3); RadChart3.Series.Add(series2G3); ChartSeries series3G3 = new ChartSeries("No me gustan", ChartSeriesType.Bar); SetSeriesAppearance(series3G3); RadChart3.Series.Add(series3G3); series1G3.AddItem(700); series2G3.AddItem(800); series3G3.AddItem(2000); #endregion #region pregunta 2 RadChart4.Clear(); SetXAxis(" 4.- ¿Que Juego te gusta mas?", 3500, RadChart4); RadChart4.PlotArea.XAxis.LayoutMode = ChartAxisLayoutMode.Between; RadChart4.PlotArea.YAxis.AutoScale = false; SetYAxis(500); series1G4 = new ChartSeries("Mario", ChartSeriesType.Bar); SetSeriesAppearance(series1G4); RadChart4.Series.Add(series1G4); ChartSeries series2G4 = new ChartSeries("Fifa 11", ChartSeriesType.Bar); SetSeriesAppearance(series2G4); RadChart4.Series.Add(series2G4); ChartSeries series3G4 = new ChartSeries("Stars wars", ChartSeriesType.Bar); SetSeriesAppearance(series3G4); RadChart4.Series.Add(series3G4); series1G4.AddItem(600); series2G4.AddItem(800); series3G4.AddItem(2100); #endregion }
protected void btCleare_Click(object sender, EventArgs e) { RadChart1.Clear(); }