private void Redraw(object sender, RoutedEventArgs e) { LineChart.ClearAndPlot(); BarChart.ClearAndPlot(); PieChart.ClearAndPlot(); PieChart1.ClearAndPlot(); StackedBarChart.ClearAndPlot(); ScatterChart.ClearAndPlot(); RadarChart.ClearAndPlot(); }
private void mnuFilePrint_Click(object sender, EventArgs e) { PrintDialog dlg = new PrintDialog(); dlg.Document = new PrintDocument(); PieChart1.AttachPrintDocument(dlg.Document); if (dlg.ShowDialog() == DialogResult.OK) { dlg.Document.Print(); } }
private void mnuFileSaveAs_Click(object sender, EventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "PNG Image|*.png|JPEG Image|*.jpg;*.jpeg|Bitmap Image|*.bmp|GIF Image|*.gif"; Size imageSize; if (PieChart1.AutoSizePie) { imageSize = new Size(PieChart1.Bounds.Width, PieChart1.Bounds.Height); } else { imageSize = PieChart1.GetChartSize(PieChart1.Padding); } if (dlg.ShowDialog() == DialogResult.OK) { switch (dlg.FilterIndex) { case 1: PieChart1.SaveAs(dlg.FileName, ImageFormat.Png, imageSize, PieChart1.Padding); break; case 2: PieChart1.SaveAs(dlg.FileName, ImageFormat.Jpeg, imageSize, PieChart1.Padding); break; case 3: PieChart1.SaveAs(dlg.FileName, ImageFormat.Bmp, imageSize, PieChart1.Padding); break; case 4: PieChart1.SaveAs(dlg.FileName, ImageFormat.Gif, imageSize, PieChart1.Padding); break; default: throw new Exception("Unknown file filter."); } } }
private void IsAlive(object sender, RoutedEventArgs e) { if (_isAlive) { _timer.Stop(); _isAlive = false; LineChart.Hoverable = true; LineChart.ClearAndPlot(false); BarChart.Hoverable = true; BarChart.ClearAndPlot(false); StackedBarChart.Hoverable = true; StackedBarChart.ClearAndPlot(false); PieChart.Hoverable = true; PieChart.ClearAndPlot(); PieChart1.Hoverable = true; PieChart1.ClearAndPlot(); ScatterChart.Hoverable = true; ScatterChart.ClearAndPlot(); RadarChart.Hoverable = true; RadarChart.ClearAndPlot(); } else { _timer.Start(); _isAlive = true; LineChart.Hoverable = false; BarChart.Hoverable = false; StackedBarChart.Hoverable = false; PieChart.Hoverable = false; PieChart1.Hoverable = false; ScatterChart.Hoverable = false; ScatterChart.PrimaryAxis.MinValue = null; RadarChart.Hoverable = false; } }
private void getPieChartData() { ClsPieChart pc = new ClsPieChart(); string userRole = Session["userRole"].ToString().ToLower(); string userLogin = Session["userName"].ToString(); List <ClsPieChart> pieChartdata = new List <ClsPieChart>(); if (userRole == "sales") { pieChartdata = pc.getOnboardingPhaseCountSales(userLogin); PieChart1.DataSource = pieChartdata; } if (userRole == "salesdm") { clsDistrictRestriction RestrictedDistricts = new clsDistrictRestriction(); string district = RestrictedDistricts.GetDistrictRestriction(Session["userName"].ToString(), Session["appName"].ToString()); pieChartdata = pc.getOnboardingPhaseCountDistrict(district); PieChart1.DataSource = pieChartdata; } if (userRole == "salesmanager") { pieChartdata = pc.getOnboardingPhaseCountAll(); PieChart1.DataSource = pieChartdata; } if (userRole == "itba" || userRole == "itadmin" || userRole == "admin") { pieChartdata = pc.getOnboardingPhaseCountITBA(userLogin); PieChart1.DataSource = pieChartdata; } if (userRole == "itmanager") { pieChartdata = pc.getOnboardingPhaseCountAll(); PieChart1.DataSource = pieChartdata; } PieChart1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Master.HeadingMessage = "Home"; if (!IsPostBack) { if (WebTools.UserInRole("FATA")) { FataRow.Visible = true; } else { FataRow.Visible = false; } //RadHtmlChart1_EPIC.DataSource = dsISOPlanningReport_EPIC; //RadHtmlChart1_EPIC.DataBind(); PieChart1.DataSource = sqlIsomeSheetStatus; PieChart1.DataBind(); PieChart2.DataSource = sqlInchDiaStatus; PieChart2.DataBind(); PieChart3.DataSource = FabMatAvlStatus; PieChart3.DataBind(); //PieChart4.DataSource = SpoolFabStatus; //PieChart4.DataBind(); //DivWiseScope1.DataSource = DivWiseMatAvlStatus; //DivWiseScope1.DataBind(); //DivWiseScope2.DataSource = DivWiseSplStatus; //DivWiseScope2.DataBind(); //PieChart5.DataSource = dsISOPlanningReport; //PieChart5.DataBind(); //PieChart6.DataSource = dsISOPlanningReport; //PieChart6.DataBind(); //PieChart5.PlotArea.XAxis.AxisCrossingPoints[0].Value = 100; //PieChart5.PlotArea.XAxis.AxisCrossingPoints[1].Value = decimal.Parse("100"); ddlPriority.DataSource = PriorityDataSource; ddlPriority.DataBind(); ddlArea.DataSource = AreaDataSource; ddlArea.DataBind(); //ddlPriority.DataSource = PriorityDataSource; //ddlPriority.DataTextField = "AREA_PRIORITY"; //ddlPriority.DataValueField = "AREA_PRIORITY"; //ddlArea.DataSource = AreaDataSource; //ddlArea.DataTextField = "AREA"; //ddlArea.DataValueField = "AREA"; Decimal total_scope = WebTools.DSum("CNT", "VIEW_SPOOLS_DASHBOARD", "1=1"); //lblSplFabStatus.Text = lblSplFabStatus.Text + String.Format(CultureInfo.InvariantCulture, // "{0:0,0}", total_scope); //lblDivWiseStatus2.Text = lblDivWiseStatus2.Text + String.Format(CultureInfo.InvariantCulture, // "{0:0,0}", total_scope); //PieChart4.DataBind(); total_scope = WebTools.DSum("CNT", "VIEW_FAB_INCH_DIA_DASHBOARD", "1=1"); lblFabMatStatus.Text = lblFabMatStatus.Text + String.Format(CultureInfo.InvariantCulture, "{0:0,0}", total_scope); //lblDivWiseStatus.Text = lblFabMatStatus.Text; total_scope = WebTools.DSum("CNT", "VIEW_INCH_DIA_DASHBOARD", "1=1"); lblInchDiaStatus.Text = lblInchDiaStatus.Text + String.Format(CultureInfo.InvariantCulture, "{0:0,0}", total_scope); total_scope = WebTools.DSum("CNT", "VIEW_ISO_SHT_STATUS_DASHBOARD", "1=1"); lblIsomeShtStatus.Text = lblIsomeShtStatus.Text + String.Format(CultureInfo.InvariantCulture, "{0:0,0}", total_scope); } }
protected void setWhereClause() { string chart1_2 = ""; string chart2_2 = ""; string chart3_2 = ""; string chart4_2 = ""; //milestone foreach (RadComboBoxItem item in ddlMilestone.CheckedItems) { milestoneselected += item.Value + "','"; } if (milestoneselected.Length > 1) { milestoneselected = milestoneselected.Substring(0, milestoneselected.Length - 2); } //Area Priority foreach (RadComboBoxItem item in ddlPriority.CheckedItems) { priorityselected += item.Value + "','"; } if (priorityselected.Length > 1) { priorityselected = priorityselected.Substring(0, priorityselected.Length - 2); } //Area foreach (RadComboBoxItem item in ddlArea.CheckedItems) { areaselected += item.Value + "','"; } if (areaselected.Length > 1) { areaselected = areaselected.Substring(0, areaselected.Length - 2); } if (milestoneselected.Length > 1) { chart1_2 = " WHERE MILESTONE IN (" + milestoneselected + ")"; chart2_2 = " WHERE MILESTONE IN (" + milestoneselected + ")"; chart3_2 = " WHERE MILESTONE IN (" + milestoneselected + ")"; chart4_2 = " WHERE MILESTONE IN (" + milestoneselected + ")"; } if (priorityselected.Length > 1) { if (milestoneselected.Length > 1) { chart1_2 = chart1_2 + " AND AREA_PRIORITY IN (" + priorityselected + ")"; chart2_2 = chart2_2 + " AND AREA_PRIORITY IN (" + priorityselected + ")"; chart3_2 = chart3_2 + " AND AREA_PRIORITY IN (" + priorityselected + ")"; chart4_2 = chart4_2 + " AND AREA_PRIORITY IN (" + priorityselected + ")"; } else { chart1_2 = " WHERE AREA_PRIORITY IN (" + priorityselected + ")"; chart2_2 = " WHERE AREA_PRIORITY IN (" + priorityselected + ")"; chart3_2 = " WHERE AREA_PRIORITY IN (" + priorityselected + ")"; chart4_2 = " WHERE AREA_PRIORITY IN (" + priorityselected + ")"; } } if (areaselected.Length > 1) { if (priorityselected.Length > 1 || milestoneselected.Length > 1) { chart1_2 = chart1_2 + " AND AREA IN (" + areaselected + ")"; chart2_2 = chart2_2 + " AND AREA IN (" + areaselected + ")"; chart3_2 = chart3_2 + " AND AREA IN (" + areaselected + ")"; chart4_2 = chart4_2 + " AND AREA IN (" + areaselected + ")"; } else { chart1_2 = chart1_2 + " WHERE AREA IN (" + areaselected + ")"; chart2_2 = chart2_2 + " WHERE AREA IN (" + areaselected + ")"; chart3_2 = chart3_2 + " WHERE AREA IN (" + areaselected + ")"; chart4_2 = chart4_2 + " WHERE AREA IN (" + areaselected + ")"; } } sqlIsomeSheetStatus.SelectCommand = chart1_1 + chart1_2 + chartgroup; sqlInchDiaStatus.SelectCommand = chart2_1 + chart2_2 + chartgroup; FabMatAvlStatus.SelectCommand = chart3_1 + chart3_2 + chartgroup; SpoolFabStatus.SelectCommand = chart4_1 + chart4_2 + chartgroup; PieChart1.DataSource = sqlIsomeSheetStatus; PieChart1.DataBind(); PieChart2.DataSource = sqlInchDiaStatus; PieChart2.DataBind(); PieChart3.DataSource = FabMatAvlStatus; PieChart3.DataBind(); //PieChart4.DataSource = SpoolFabStatus; //PieChart4.DataBind(); }