private void SetUpChart_Stacked(DataSet _ds) { barChart.Type = GraphBarChart.StackedType.Normal; barChart.MeasureColumns.Add(v_HSCWWoDisSchoolDistStateEconELPXYearRate.Regular_Diplomas_Percent); barChart.MeasureColumns.Add(v_HSCWWoDisSchoolDistStateEconELPXYearRate.HSEDs_Percent); barChart.MeasureColumns.Add(v_HSCWWoDisSchoolDistStateEconELPXYearRate.Certificates_Percent); if (GlobalValues.CompareTo.Key != CompareToKeys.Current) { barChart.LabelColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); } else { if (GlobalValues.TmFrm.Key == TmFrmKeys.All && GlobalValues.Group.Key == GroupKeys.All) { barChart.LabelColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.TimeFrameLabel; } else if (GlobalValues.TmFrm.Key != TmFrmKeys.All) { barChart.OverrideAxisXLabels.Add("Both Groups Combined", "All Students"); } else { barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } } barChart.OverrideSeriesLabels.Add(v_HSCWWoDisSchoolDistStateEconELP.HSEDs, "HSED"); }
private void SetUpChart_Bar(DataSet _ds) { try { if (GlobalValues.HighSchoolCompletion.Key == HighSchoolCompletionKeys.Certificate) { barChart.DisplayColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.Certificates_Percent; } else if (GlobalValues.HighSchoolCompletion.Key == HighSchoolCompletionKeys.HSED) { barChart.DisplayColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.HSEDs_Percent; } else if (GlobalValues.HighSchoolCompletion.Key == HighSchoolCompletionKeys.Regular) { barChart.DisplayColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.Regular_Diplomas_Percent; } else if (GlobalValues.HighSchoolCompletion.Key == HighSchoolCompletionKeys.Summary) { barChart.DisplayColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.Combined_Percent; } if (GlobalValues.CompareTo.Key == CompareToKeys.Current) { if (GlobalValues.TmFrm.Key == TmFrmKeys.All) { barChart.SeriesColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.TimeFrameLabel; barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } } else { if (GlobalValues.TmFrm.Key == TmFrmKeys.All) { barChart.SeriesColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); barChart.LabelColumnName = v_HSCWWoDisSchoolDistStateEconELPXYearRate.TimeFrameLabel; } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } }
private void SetGraphSeriesAndAxisLabelColumns_StackedBar() { barChart.SeriesColumnName = v_WSAS.Level; if (disaggFlags[GlobalValues.Group.Name] || disaggFlags[GlobalValues.SubjectID.Name]) { // if (groupIsDisagg && subjectIsDisagg) never happens in stacked bar if (disaggFlags[GlobalValues.Group.Name]) { barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } else { barChart.LabelColumnName = v_WSAS.SubjectLabel; } } else if (disaggFlags[GlobalValues.CompareTo.Name]) { if (disaggFlags[GlobalValues.Level.Name]) { barChart.LabelColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); } else { barChart.LabelColumnName = v_WSAS.GradeShortLabel; } } else { if (disaggFlags[GlobalValues.Grade.Name]) { barChart.LabelColumnName = v_WSAS.GradeShortLabel; } else { barChart.FriendlyAxisXNames = new List <String>(new string[] { "All Students" }); } } }
private void SetUpHorizChart(DataSet ds) { try { if (GlobalValues.Group.Key == GroupKeys.Grade) { //override the default orderby since will use GradeLabel, instead of GradeCode List <String> order = new List <String>(QueryMarshaller.BuildOrderByList(DataSet.Tables[0].Columns).ToArray()); hrzBarChart.OrderBy = String.Join(",", order.ToArray()); } else if (GlobalValues.Group.Key == GroupKeys.Race) { List <String> grOrder = new List <string>(QueryMarshaller.BuildOrderByList(DataSet.Tables[0].Columns).ToArray()); grOrder.Insert(1, v_SuspExpIncidentsWWoDisSchoolDistState.Race); hrzBarChart.OrderBy = String.Join(",", grOrder.ToArray()); } hrzBarChart.YAxisSuffix = String.Empty; hrzBarChart.Title = DataSetTitle; if (GlobalValues.Group.Key == GroupKeys.Grade) { hrzBarChart.AutoHeightIncreaseFactor = 25; } if (GlobalValues.CompareTo.Key == CompareToKeys.Current) { hrzBarChart.LabelColumns.Add( (GlobalValues.OrgLevel.Key == OrgLevelKeys.School)? v_SuspExpIncidentsWWoDisSchoolDistState.School_Name : v_SuspExpIncidentsWWoDisSchoolDistState.District_Name ); } else { hrzBarChart.LabelColumns.Add(ColumnPicker.GetCompareToColumnName(GlobalValues)); } if (GlobalValues.Group.Key != GroupKeys.All) { hrzBarChart.LabelColumns.Add(ColumnPicker.GetViewByColumnName(GlobalValues)); } if (GlobalValues.CompareTo.Key != CompareToKeys.SelDistricts && GlobalValues.CompareTo.Key != CompareToKeys.SelSchools) { hrzBarChart.SelectedSortBySecondarySort = false; } hrzBarChart.OverrideSeriesLabels = new Hashtable(6); //MEASURE COLUMNS: if (GlobalValues.Weapon.Key == WeaponKeys.Yes) { hrzBarChart.MeasureColumns = new List <String>(new String[] { v_SuspExpIncidentsWWoDisSchoolDistState.PRCWeaponDrugAllSusp, v_SuspExpIncidentsWWoDisSchoolDistState.PRCWeaponDrugExp }); hrzBarChart.OverrideSeriesLabels.Add(v_SuspExpIncidentsWWoDisSchoolDistState.PRCWeaponDrugAllSusp, "% Suspended"); hrzBarChart.OverrideSeriesLabels.Add(v_SuspExpIncidentsWWoDisSchoolDistState.PRCWeaponDrugExp, "% Expelled"); } else { hrzBarChart.MeasureColumns = new List <String>(new String[] { v_SuspExpIncidentsWWoDisSchoolDistState.PRCNonWeaponDrugAllSusp, v_SuspExpIncidentsWWoDisSchoolDistState.PRCNonWeaponDrugExp }); hrzBarChart.OverrideSeriesLabels.Add(v_SuspExpIncidentsWWoDisSchoolDistState.PRCNonWeaponDrugAllSusp, "% Suspended"); hrzBarChart.OverrideSeriesLabels.Add(v_SuspExpIncidentsWWoDisSchoolDistState.PRCNonWeaponDrugExp, "% Expelled"); } hrzBarChart.AxisYDescription = "Percent of Incidents"; } catch (Exception ex) { if (GlobalValues.TraceLevels > 0) { throw ex; } System.Diagnostics.Debug.WriteLine(ex.Message); } }
public static String GetSeriesColumnDefault(GlobalValues globals) { return(ColumnPicker.GetCompareToColumnName(globals)); }
private void SetUpChart(DataSet ds) { barChart.Title = DataSetTitle; barChart.AxisYMin = 0; barChart.AxisYMax = 100; barChart.AxisYStep = 10; barChart.AxisYDescription = "Percent of FTE Teachers"; barChart.AxisY.LabelsFormat.CustomFormat = "0" + "\\%"; //Bind Data Source & Display if (base.GlobalValues.TQShow.CompareToKey(TQShowKeys.WisconsinLicenseStatus)) { //Stacked Bar Chart barChart.Type = SligoCS.Web.WI.WebUserControls.GraphBarChart.StackedType.Stacked100; barChart.LabelColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); if (GlobalValues.CompareTo.Key == CompareToKeys.SelSchools || GlobalValues.CompareTo.Key == CompareToKeys.SelDistricts) { barChart.Height = (int)(barChart.Height.Value * 1.25); Hashtable hashXLabels = new Hashtable(); String col = barChart.LabelColumnName; String oldLabel; String newLabel; String trace = String.Empty; int start, end, space; for (int n = 0; n < DataSet.Tables[0].Rows.Count; n++) { if (DataSet.Tables[0].Rows[n][col].ToString().Length > 30) { //Wrap Long Labels oldLabel = DataSet.Tables[0].Rows[n][col].ToString(); if (!hashXLabels.Contains(oldLabel) && oldLabel.Length > 25) { start = (int)(oldLabel.Length / 4); end = start * 3; space = oldLabel.LastIndexOf(" ", end, end - start); if (space < 0) { space = oldLabel.LastIndexOf("-", end, end - start) + 1; } newLabel = oldLabel.Replace(oldLabel.Remove(space), oldLabel.Remove(space) + Convert.ToChar(10).ToString()).ToString(); hashXLabels.Add(DataSet.Tables[0].Rows[n][col].ToString(), newLabel); trace += DataSet.Tables[0].Rows[n][col] + "::" + newLabel; } } } barChart.OverrideAxisXLabels = hashXLabels; //throw new Exception(trace); //WebUserControls.GraphBarChart.ReplaceColumnValues(DataSet.Tables[0], col, hashXLabels); } List <String> graphColumns = barChart.MeasureColumns; graphColumns.Add(v_TeacherQualifications.FTELicenseFull); graphColumns.Add(v_TeacherQualifications.LicenseEmerFTE); graphColumns.Add(v_TeacherQualifications.LicenseNoFTE); Hashtable seriesLabels = barChart.OverrideSeriesLabels; seriesLabels.Add(v_TeacherQualifications.FTELicenseFull, "Full License"); seriesLabels.Add(v_TeacherQualifications.LicenseEmerFTE, "Emergency License"); seriesLabels.Add(v_TeacherQualifications.LicenseNoFTE, "No License For Assignment"); } else { //Normal Bar Chart barChart.Type = SligoCS.Web.WI.WebUserControls.GraphBarChart.StackedType.No; Dictionary <String, String> mapping = new Dictionary <string, string>(); SligoCS.Web.WI.WebSupportingClasses.WI.TQShow TQ = GlobalValues.TQShow; mapping.Add( TQShowKeys.DistrictExperience, v_TeacherQualifications.LocalExperience5YearsOrMoreFTEPercentage ); mapping.Add( TQShowKeys.TotalExperience, v_TeacherQualifications.TotalExperience5YearsOrMoreFTEPercentage ); mapping.Add( TQShowKeys.HighestDegree, v_TeacherQualifications.DegreeMastersOrHigherFTEPercentage ); mapping.Add( TQShowKeys.ESEAQualified, (GlobalValues.TQSubjects.Key == TQSubjectsKeys.SoclStd) ? v_TeacherQualifications.ESEA_Core_HQYesFTEPercentage : v_TeacherQualifications.EHQYesFTEPercentage ); barChart.DisplayColumnName = mapping[TQ.Key].ToString(); barChart.FriendlyAxisXNames = new List <string>(new String[] { String.Empty }); } }
private void SetGraphSeriesAndAxisLabelColumns_SingleBar() { barChart.LegendBox.Visible = (CountDimensions(disaggFlags) > 1); if (disaggFlags[GlobalValues.CompareTo.Name] == false) { if (disaggFlags[GlobalValues.Grade.Name]) { if (!disaggFlags[GlobalValues.Group.Name] && !disaggFlags[GlobalValues.SubjectID.Name]) { barChart.LabelColumnName = v_WSAS.GradeShortLabel; } else if (disaggFlags[GlobalValues.Group.Name]) // and if both IsDisagg { barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } else // if only subject IsDisagg { barChart.LabelColumnName = v_WSAS.SubjectLabel; } } else //if (gradeIsDisagg == false) { if (disaggFlags[GlobalValues.Group.Name]) { barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } else if (disaggFlags[GlobalValues.SubjectID.Name]) { barChart.LabelColumnName = v_WSAS.SubjectLabel; } else { barChart.FriendlyAxisXNames = new List <String>(new string[] { "All Students" }); } } } else //if (compareToIsDisagg) { if (!disaggFlags[GlobalValues.Group.Name] && !disaggFlags[GlobalValues.SubjectID.Name]) { if (!disaggFlags[GlobalValues.Group.Name] && !disaggFlags[GlobalValues.Grade.Name]) { barChart.FriendlyAxisXNames = new List <String>(new string[] { "All Students" }); } else if (!disaggFlags[GlobalValues.Grade.Name]) { barChart.LabelColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); } else { barChart.LabelColumnName = v_WSAS.GradeShortLabel; } } else if (disaggFlags[GlobalValues.Group.Name]) { barChart.LabelColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } else // if (subjectIsDisagg) { barChart.LabelColumnName = v_WSAS.SubjectLabel; } } if (CountDimensions(disaggFlags) > 1) { if (disaggFlags[GlobalValues.CompareTo.Name]) { barChart.SeriesColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); } else { if (disaggFlags[GlobalValues.Grade.Name]) { barChart.SeriesColumnName = v_WSAS.GradeShortLabel; } else { barChart.SeriesColumnName = v_WSAS.SubjectLabel; } } } else if (!disaggFlags[GlobalValues.Group.Name]) // All Students { barChart.SeriesColumnName = ColumnPicker.GetCompareToColumnName(GlobalValues); barChart.LegendBox.Visible = true; // not sure why this is necessary!! but not visible without it } if (barChart.SeriesColumnName == barChart.LabelColumnName) //Assumption is that Series column is defaulting to CompareTo and should not be used { barChart.SeriesColumnName = ColumnPicker.GetViewByColumnName(GlobalValues); } }