public List <VideoMetric> GetMetricList(string startDate, string endDate, string filters = "[]", ArchiveMode archive = ArchiveMode.UnArchived) { var filterList = JsonConvert.DeserializeObject <Tag[]>(filters); var start = DateUtilities.ReadDate(startDate); var end = DateUtilities.ReadDate(endDate); return(Backend.MetricList(start, end, filterList, GetMetricInfoList(), archive)); }
public IEnumerable <TimeSeriesChartData> GetChartData(string metrics, string type, string startDate, string endDate, string filters = "[]", ArchiveMode archive = ArchiveMode.UnArchived) { var filterList = JsonConvert.DeserializeObject <Tag[]>(filters); var metricList = JsonConvert.DeserializeObject <string[]>(metrics); var start = DateUtilities.ReadDate(startDate); var end = DateUtilities.ReadDate(endDate); var timeSeries = ChartData(metricList, type, start, end, filterList, archive); return(timeSeries.Select(x => CreateTimeSeriesChartData(x.Value, start, end, x.Key))); }
public JsonResult GetDemographicsChartData(string metric, string type, string startDate, string endDate, string filters, ArchiveMode archive = ArchiveMode.UnArchived) { var filterList = JsonConvert.DeserializeObject <Tag[]>(filters); var metricList = JsonConvert.DeserializeObject <string[]>(metric); var start = DateUtilities.ReadDate(startDate); var end = DateUtilities.ReadDate(endDate); return(Json(metricList.Select(m => new { StartDate = startDate, EndDate = endDate, Metrics = m, Data = GetDemographics(m, type, start, end, filterList, archive) }) )); }