Reformating charting, add DataError message

This commit is contained in:
2016-05-09 11:46:32 -04:00
parent 1ba8f24b10
commit aca7157663
11 changed files with 616 additions and 24 deletions
+9
View File
@@ -0,0 +1,9 @@
@model string
@{
ViewBag.Title = "Chart - Data Error";
}
<h1>@ViewBag.Title</h1>
<p>There was an issue generating a chart for the selected data.</p>
<p>@Model</p>
+32
View File
@@ -0,0 +1,32 @@
@model LeafWeb.Web.ViewModels.Chart.ChartViewModel
@{
ViewBag.Title = "Chart";
}
<h1>@ViewBag.Title</h1>
<h3>Identifier: <strong>@Model.LeafInputIdentifier</strong></h3>
@Html.DropDownList("CurveId", new SelectList(Model.AvailableCurveId, Model.CurveId), "Select CurveId")
<img id="chart"/>
@section Scripts
{
<script type="text/javascript">
$(function () {
$('#CurveId')
.change(function () {
var $chart = $("#chart");
var $spinner = $(this).after('<i class="fa fa-spinner fa-spin"></i>').next('i');
$chart.attr('src', "");
var curveId = $("option:selected", this).text();
var url =
"@Html.Raw(Url.Action("ChartCurve", new {leafInputId = Model.LeafInputId, curveId="curveId"}))";
url = url.replace("=curveId", "=" + curveId);
$chart.attr('src', url)
.load(function() {
$spinner.remove();
});
});
});
</script>
}