Resolve "Создать методы для статистики" #50

Merged
BarminaA merged 1 commits from 23-create-method into master 2021-04-20 11:30:14 +04:00

View File

@ -79,44 +79,6 @@
$('#container').highcharts(json); $('#container').highcharts(json);
}); });
</script> </script>
<!-- <script th:inline="javascript">-->
<!-- $(document).ready(function () {-->
<!-- var chart = {-->
<!-- plotBackgroundColor: null,-->
<!-- plotBorderWidth: null,-->
<!-- plotShadow: false-->
<!-- };-->
<!-- var title = {-->
<!-- text: '% коммитов авторов'-->
<!-- };-->
<!-- var tooltip = {-->
<!-- pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'-->
<!-- };-->
<!-- var plotOptions = {-->
<!-- pie: {-->
<!-- allowPointSelect: true,-->
<!-- cursor: 'pointer',-->
<!-- dataLabels: {-->
<!-- enabled: false-->
<!-- },-->
<!-- showInLegend: true-->
<!-- }-->
<!-- };-->
<!-- var series = [{-->
<!-- type: 'pie',-->
<!-- name: 'Browser share',-->
<!-- data: [[${commitAuthorData}]]-->
<!-- }];-->
<!-- var json = {};-->
<!-- json.chart = chart;-->
<!-- json.title = title;-->
<!-- json.tooltip = tooltip;-->
<!-- json.series = series;-->
<!-- json.plotOptions = plotOptions;-->
<!-- $('#containerPie').highcharts(json);-->
<!-- });-->
<!-- </script>-->
<script th:inline="javascript"> <script th:inline="javascript">
$(document).ready(function () { $(document).ready(function () {
var chart = { var chart = {
@ -175,47 +137,7 @@
}); });
</script> </script>
<script th:inline="javascript"> <script th:inline="javascript">
$(document).ready(function () { function createPie(data, title) {
var chart = {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
};
var title = {
text: '% коммитов содержащих сущности'
};
var tooltip = {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
};
var plotOptions = {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
};
var series = [{
type: 'pie',
name: 'Browser share',
data: [[${commitEntityData}]]
}];
var json = {};
json.chart = chart;
json.title = title;
json.tooltip = tooltip;
json.series = series;
json.plotOptions = plotOptions;
$('#containerEntityPie').highcharts(json);
});
</script>
<script th:inline="javascript">
document.getElementById('pie')
function createPie(idElement, data, title) {
var chart = { var chart = {
plotBackgroundColor: null, plotBackgroundColor: null,
plotBorderWidth: null, plotBorderWidth: null,
@ -249,18 +171,18 @@
json.tooltip = tooltip; json.tooltip = tooltip;
json.series = series; json.series = series;
json.plotOptions = plotOptions; json.plotOptions = plotOptions;
$('#containerPie').highcharts(json); return json;
}; };
// createPie([[${commitEntityData}]], '#containerEntityPie_'); $(document).ready(function () {
// createPie([[${commitAuthorData}]],'#containerPie_'); $('#containerPie').highcharts(createPie([[${commitAuthorData}]], '% коммитов авторов'));
$(document).ready(createPie('pieSuper', [[${commitAuthorData}]], 'title')); $('#containerEntityPie').highcharts(createPie([[${commitEntityData}]], '% коммитов содержащих сущности'));
});
</script> </script>
<div class="row"> <div class="row">
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div> <div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
<div id="containerPie" style="width: 550px; height: 400px; margin: 0 auto"></div> <div id="containerPie" style="width: 550px; height: 400px; margin: 0 auto"></div>
<div id="containerColumn" style="width: 550px; height: 400px; margin: 0 auto"></div> <div id="containerColumn" style="width: 550px; height: 400px; margin: 0 auto"></div>
<div id="containerEntityPie" style="width: 550px; height: 400px; margin: 0 auto"></div> <div id="containerEntityPie" style="width: 550px; height: 400px; margin: 0 auto"></div>
<div id="pieSuper" style="width: 550px; height: 400px; margin: 0 auto"></div>
</div> </div>
</div> </div>
</html> </html>