Skip to content

Commit

Permalink
Better naming for PriceData API return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeio committed Nov 12, 2017
1 parent 78870f9 commit 5e567f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Website/SwlMarket/Controllers/PriceDataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public async Task<IActionResult> 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);
Expand Down
4 changes: 2 additions & 2 deletions Website/SwlMarket/Views/Home/Item.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 5e567f3

Please sign in to comment.