public JsonResult GetChartData(string fromCurrency, string toCurrency) { List <ChartRequest> chartData = new List <ChartRequest>(); List <Currency> rate = new List <Currency>(); ChartService serviceChart = new ChartService(); rate = service.GetRates(fromCurrency, toCurrency, false); foreach (Currency item in rate) { item.Time = item.Time.ToUniversalTime(); chartData.Add(serviceChart.ConvertTimeToUNIX(item)); } return(Json(chartData, JsonRequestBehavior.AllowGet)); }