123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- {% extends 'admin/base.html.twig' %}
- {% block content %}
- <div class="content">
- <div class="container-fluid">
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество уникальных пользователей (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="usersDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество новых пользователей (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="newUsersDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество просмотренных страниц (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="hitsDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество сессий (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="sessionsDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Средняя длительность сессии в минутах (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="avgSessionDurationDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Показатель отказов в % (по дням)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="bounceRateDay" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество уникальных пользователей (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="usersWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество новых пользователей (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="newUsersWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество просмотренных страниц (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="hitsWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Количество сессий (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="sessionsWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Средняя длительность сессии в минутах (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="avgSessionDurationWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Показатель отказов в % (по неделям)</h4>
- </div>
- </div>
- <div class="card-body">
- <canvas id="bounceRateWeek" height="300"></canvas>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- {% endblock %}
- {% block admin_js_body %}
- {{ parent() }}
- <script src="{{ asset('static/admin/src/chart/Chart.min.js') }}"></script>
- <script>
- function getOptions(max) {
- return {
- responsive: true,
- maintainAspectRatio: false,
- legend: { display: false },
- scales: {
- yAxes: [{
- ticks: { beginAtZero: true, min: 0, suggestedMax: max }
- }]
- },
- tooltips: {
- displayColors: false,
- callbacks: {
- title: function(tooltipItem, data) {
- return '';
- },
- label: function(tooltipItem, data) {
- return tooltipItem.yLabel.toString();
- }
- }
- }
- };
- }
- {% if statistics['day']['users'] is defined %}
- const usersDayContext = document.getElementById('usersDay').getContext('2d');
- const usersDayChart = new Chart(usersDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['users']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['users']['values']|join(',') }}],
- backgroundColor: ['rgba(58, 235, 137, 0.2)'],
- borderColor: ['rgba(58, 235, 137, 1)'],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['users']['values']) }})
- });
- {% endif %}
- {% if statistics['day']['newUsers'] is defined %}
- const newUsersDayContext = document.getElementById('newUsersDay').getContext('2d');
- const newUsersDayChart = new Chart(newUsersDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['newUsers']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['newUsers']['values']|join(',') }}],
- backgroundColor: ['rgba(219, 220, 85, 0.2)'],
- borderColor: ['rgba(219, 220, 85, 1)'],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['newUsers']['values']) }})
- });
- {% endif %}
- {% if statistics['day']['hits'] is defined %}
- const hitsDayContext = document.getElementById('hitsDay').getContext('2d');
- const hitsDayChart = new Chart(hitsDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['hits']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['hits']['values']|join(',') }}],
- backgroundColor: [ 'rgba(54, 162, 235, 0.2)' ],
- borderColor: [ 'rgba(54, 162, 235, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['hits']['values']) }})
- });
- {% endif %}
- {% if statistics['day']['sessions'] is defined %}
- const sessionsDayContext = document.getElementById('sessionsDay').getContext('2d');
- const sessionsDayChart = new Chart(sessionsDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['sessions']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['sessions']['values']|join(',') }}],
- backgroundColor: [ 'rgba(188, 62, 236, 0.2)' ],
- borderColor: [ 'rgba(188, 62, 236, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['sessions']['values']) }})
- });
- {% endif %}
- {% if statistics['day']['avgSessionDuration'] is defined %}
- const avgSessionDurationDayContext = document.getElementById('avgSessionDurationDay').getContext('2d');
- const avgSessionDurationDayChart = new Chart(avgSessionDurationDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['avgSessionDuration']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['avgSessionDuration']['values']|join(',') }}],
- backgroundColor: [ 'rgba(131, 235, 58, 0.2)' ],
- borderColor: [ 'rgba(131, 235, 58, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['avgSessionDuration']['values']) }})
- });
- {% endif %}
- {% if statistics['day']['bounceRate'] is defined %}
- const bounceRateDayContext = document.getElementById('bounceRateDay').getContext('2d');
- const bounceRateDayChart = new Chart(bounceRateDayContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['day']['bounceRate']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['day']['bounceRate']['values']|join(',') }}],
- backgroundColor: [ 'rgba(237, 67, 64, 0.1)' ],
- borderColor: [ 'rgba(237, 67, 64, 0.8)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['day']['bounceRate']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['users'] is defined %}
- const usersWeekContext = document.getElementById('usersWeek').getContext('2d');
- const usersWeekChart = new Chart(usersWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['users']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['users']['values']|join(',') }}],
- backgroundColor: ['rgba(58, 235, 137, 0.2)'],
- borderColor: ['rgba(58, 235, 137, 1)'],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['users']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['newUsers'] is defined %}
- const newUsersWeekContext = document.getElementById('newUsersWeek').getContext('2d');
- const newUsersWeekChart = new Chart(newUsersWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['newUsers']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['newUsers']['values']|join(',') }}],
- backgroundColor: ['rgba(219, 220, 85, 0.2)'],
- borderColor: ['rgba(219, 220, 85, 1)'],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['newUsers']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['hits'] is defined %}
- const hitsWeekContext = document.getElementById('hitsWeek').getContext('2d');
- const hitsWeekChart = new Chart(hitsWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['hits']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['hits']['values']|join(',') }}],
- backgroundColor: [ 'rgba(54, 162, 235, 0.2)' ],
- borderColor: [ 'rgba(54, 162, 235, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['hits']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['sessions'] is defined %}
- const sessionsWeekContext = document.getElementById('sessionsWeek').getContext('2d');
- const sessionsWeekChart = new Chart(sessionsWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['sessions']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['sessions']['values']|join(',') }}],
- backgroundColor: [ 'rgba(188, 62, 236, 0.2)' ],
- borderColor: [ 'rgba(188, 62, 236, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['sessions']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['avgSessionDuration'] is defined %}
- const avgSessionDurationWeekContext = document.getElementById('avgSessionDurationWeek').getContext('2d');
- const avgSessionDurationWeekChart = new Chart(avgSessionDurationWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['avgSessionDuration']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['avgSessionDuration']['values']|join(',') }}],
- backgroundColor: [ 'rgba(131, 235, 58, 0.2)' ],
- borderColor: [ 'rgba(131, 235, 58, 1)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['avgSessionDuration']['values']) }})
- });
- {% endif %}
- {% if statistics['week']['bounceRate'] is defined %}
- const bounceRateWeekContext = document.getElementById('bounceRateWeek').getContext('2d');
- const bounceRateWeekChart = new Chart(bounceRateWeekContext, {
- type: 'line',
- data: {
- labels: [{{ statistics['week']['bounceRate']['labels']|map((elem) => "'#{elem}'")|join(',')|raw }}],
- datasets: [{
- label: '',
- data: [{{ statistics['week']['bounceRate']['values']|join(',') }}],
- backgroundColor: [ 'rgba(237, 67, 64, 0.1)' ],
- borderColor: [ 'rgba(237, 67, 64, 0.8)' ],
- borderWidth: 2
- }]
- },
- options: getOptions({{ max(statistics['week']['bounceRate']['values']) }})
- });
- {% endif %}
- </script>
- {% endblock %}
|