2023-05-19 18:30:49 +04:00
|
|
|
@using SchoolAgainStudyContracts.ViewModel;
|
|
|
|
@model List<TopersViewModel>
|
|
|
|
<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].Name, y: result[i].Count });
|
|
|
|
}
|
|
|
|
window.onload = function () {
|
|
|
|
var chart = new CanvasJS.Chart("chartContainer", {
|
|
|
|
theme: "theme1",
|
|
|
|
animationEnabled: true,
|
|
|
|
title: {
|
2023-05-19 19:36:24 +04:00
|
|
|
text: "Топ учеников"
|
2023-05-19 18:30:49 +04:00
|
|
|
},
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
// change type to bar, line, area, pie, etc.
|
|
|
|
type: "column",
|
|
|
|
|
|
|
|
dataPoints: dataPoints
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
chart.render();
|
|
|
|
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<body>
|
|
|
|
<div id="chartContainer">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|