added baseline zero costs charge so that bar charts display all months regardless of whether there are costs or not.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-24 09:03:55 -07:00
parent 92564ae527
commit f7f47c54ff
4 changed files with 59 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
var barGraphColors = new string[] { "#00876c", "#43956e", "#67a371", "#89b177", "#a9be80", "#c8cb8b", "#e6d79b", "#e4c281", "#e3ab6b", "#e2925b", "#e07952", "#db5d4f" };
var sortedByMPG = Model.OrderBy(x => x.Cost).ToList();
}
@if (Model.Any())
@if (Model.Where(x=>x.Cost > 0).Any())
{
<canvas id="bar-chart"></canvas>
<script>

View File

@@ -3,7 +3,7 @@
var barGraphColors = new string[] { "#00876c", "#43956e", "#67a371", "#89b177", "#a9be80", "#c8cb8b", "#e6d79b", "#e4c281", "#e3ab6b", "#e2925b", "#e07952", "#db5d4f" };
var sortedByMPG = Model.OrderByDescending(x => x.Cost).ToList();
}
@if (Model.Any())
@if (Model.Where(x=>x.Cost > 0).Any())
{
<canvas id="bar-chart-mpg"></canvas>