34 lines
912 B
Plaintext
34 lines
912 B
Plaintext
|
@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: {
|
||
|
text: "Топ материалов за последний месяц"
|
||
|
},
|
||
|
data: [
|
||
|
{
|
||
|
// change type to bar, line, area, pie, etc.
|
||
|
type: "column",
|
||
|
|
||
|
dataPoints: dataPoints
|
||
|
}
|
||
|
]
|
||
|
});
|
||
|
chart.render();
|
||
|
|
||
|
};
|
||
|
</script>
|
||
|
<body>
|
||
|
<div id="chartContainer">
|
||
|
</div>
|
||
|
|
||
|
</body>
|