From 5e567f3fd99f197456c5452975bc5ce9364a369a Mon Sep 17 00:00:00 2001 From: Joshua Shaffer Date: Sun, 12 Nov 2017 01:44:15 -0500 Subject: [PATCH] Better naming for PriceData API return value --- Website/SwlMarket/Controllers/PriceDataController.cs | 4 ++-- Website/SwlMarket/Views/Home/Item.cshtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Website/SwlMarket/Controllers/PriceDataController.cs b/Website/SwlMarket/Controllers/PriceDataController.cs index 17373c4..fc6cd7b 100644 --- a/Website/SwlMarket/Controllers/PriceDataController.cs +++ b/Website/SwlMarket/Controllers/PriceDataController.cs @@ -28,8 +28,8 @@ public async Task Item(int id) var result = new { - x = prices.Select(p => p.Time.TimeOfDay.TotalSeconds == 0 ? p.Time.ToString("yyyy-MM-dd") : p.Time.ToString("yyyy-MM-dd HH:mm")).ToList(), - y = prices.Select(p => p.Marks).ToList() + dates = prices.Select(p => p.Time.TimeOfDay.TotalSeconds == 0 ? p.Time.ToString("yyyy-MM-dd") : p.Time.ToString("yyyy-MM-dd HH:mm")).ToList(), + prices = prices.Select(p => p.Marks).ToList() }; return Json(result); diff --git a/Website/SwlMarket/Views/Home/Item.cshtml b/Website/SwlMarket/Views/Home/Item.cshtml index b06ba56..d960114 100644 --- a/Website/SwlMarket/Views/Home/Item.cshtml +++ b/Website/SwlMarket/Views/Home/Item.cshtml @@ -19,8 +19,8 @@ dataType: 'json', contentType: 'application/json; charset=utf-8', success: function (result) { - priceData.x = result.x; - priceData.y = result.y; + priceData.x = result.dates; + priceData.y = result.prices; Plotly.plot('priceChart', [priceData]); }, error: function () {