public ActionResult GetHourHistogram(Area?area) { if (CurrentUser.UserRole == UserRole.Rackaz) { area = CurrentUser.Area; } var result = _reportService.GetHourHistogram(area); if (result.Success) { foreach (var serie in result.Data) { serie.data = RemoveLastsZeros(serie.data.ToList()).ToArray(); } var highChart = new HighChartJDModel { chart = new Chart1 { type = "column" }, title = new Title2 { text = (area.HasValue ? string.Format("התפלגות שעות לפי חונכויות באיזור {0}", area.Value.ToDescription()) : "התפלגות שעות לפני חונכויות"), //text = "דוח סטטיסטיקת התרעות", //useHTML = false }, xAxis = new Xaxis1 { // we will take the years from the dictionary categories = new string[] { "אוקטובר", "נובמבר", "דצמבר", "ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר" }, crosshair = true }, yAxis = new Yaxis1 { min = new int { }, title = new Title2() { text = "מספר חונכויות", //useHTML = false }, }, series = result.Data.ToArray(), tooltip = new Tooltip1() { headerFormat = "<span style='font-size:10px'>{point.key}</span><table>", pointFormat = "<tr><td style='color:{series.color};padding:0'>{series.name}: </td><td style='padding:0'><b>{point.y}</b></td></tr>", footerFormat = "</table>", shared = true, useHTML = true }, plotOptions = new Plotoptions1() { column = new Column2() { pointPadding = new float(), borderWidth = new int() } }, exporting = new Exporting1 { enabled = true } }; return(Json(highChart)); } return(Error(result)); }
public ActionResult GetJoinDropStatistics(Area?area) { if (CurrentUser.UserRole == UserRole.Rackaz) { area = CurrentUser.Area; } var result = _reportService.GetJoinDropStatistics(area); if (result.Success) { foreach (var serie in result.Data.Series) { serie.data = RemoveLastsZeros(serie.data.ToList()).ToArray(); } var chartModel1 = new HighChartJDModel { chart = new Chart1 { type = "column" }, title = new Title2 { text = (area.HasValue ? string.Format(" סטטיסטיקת הצטרפות ונשירת חניכים באיזור {0}", area.Value.ToDescription()) : " סטטיסטיקת הצטרפות ונשירת חניכים"), //text = "דוח סטטיסטיקה הצטרפות ונשירת חניכים", }, xAxis = new Xaxis1 { // we will take the years from the dictionary categories = result.Data.YearList.ToArray(), crosshair = true }, yAxis = new Yaxis1 { min = new int {}, title = new Title2() { text = "כמות מצטרפים ונושרים", //useHTML = false }, }, series = result.Data.Series.ToArray(), tooltip = new Tooltip1() { headerFormat = "<span style='font-size:10px'>{point.key}</span><table>", pointFormat = "<tr><td style='color:{series.color};padding:0'>{series.name}: </td><td style='padding:0'><b>{point.y}</b></td></tr>", footerFormat = "</table>", shared = true, useHTML = true }, plotOptions = new Plotoptions1() { column = new Column2() { pointPadding = new float(), borderWidth = new int() } }, exporting = new Exporting1 { enabled = true } }; return(Json(chartModel1)); } return(Error(result)); //return null; }