CourseWork_SchoolStudyAgain/SchoolAgainStudy/StudentWebClient/Views/Home/ActivityCharts.cshtml

33 lines
961 B
Plaintext
Raw Normal View History

@using SchoolAgainStudyContracts.ViewModel;
@model List<ActivityChartViewModel>
<script type="text/javascript">
var result = @Html.Raw(ViewBag.DataPoints);
var dataPoints = [];
for (var i = 0; i < result.length; i++) {
dataPoints.push({ label: result[i].dateOf, y: result[i].count });
}
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
theme: "theme2",
animationEnabled: true,
title: {
text: "Отслеживание работы за послдений месяц"
},
data: [
{
// change type to bar, line, area, pie, etc.
type: "column",
dataPoints: dataPoints
}
]
});
chart.render();
};
</script>
<body>
<div id="chartContainer">
</div>
</body>