Серия графиков, правки в табл.

parent 82178927
...@@ -136,3 +136,9 @@ ...@@ -136,3 +136,9 @@
text-align: center; text-align: center;
} }
.b-table_wrapp
{
display: none;
margin-top: 30px;
}
...@@ -90,6 +90,7 @@ $(document).ready(function(){ ...@@ -90,6 +90,7 @@ $(document).ready(function(){
ChartStat: { ChartStat: {
DateStat: function(dataLineChartStat) { DateStat: function(dataLineChartStat) {
var activeLines = ['shows', 'clicks', 'transactions', 'salemoney', 'admoney'];
activeLine = 'shows'; activeLine = 'shows';
activeDays = 'day'; activeDays = 'day';
console.log('AAA DateStat: ', dataLineChartStat); console.log('AAA DateStat: ', dataLineChartStat);
...@@ -116,10 +117,19 @@ $(document).ready(function(){ ...@@ -116,10 +117,19 @@ $(document).ready(function(){
axes = {}; axes = {};
// Определяем названия в легенде: // Определяем названия в легенде:
/*
dataColumnsTemp.push(['data'].concat(dataValue)); dataColumnsTemp.push(['data'].concat(dataValue));
names['data'] = activeLine; names['data'] = activeLine;
types['data'] = 'area-spline'; types['data'] = 'area-spline';
axes['data'] = 'y'; axes['data'] = 'y';
*/
for (var i = 1; i <= activeLines.length; i++) {
dataColumnsTemp.push(['data'+i].concat(dataLineChartStat[activeLines[i-1]]));
names['data'+i] = activeLines[i-1],
types['data'+i] = 'area-spline';
axes['data'+i] = 'y';
}
console.log('AAA dataColumnsTemp ', dataColumnsTemp); console.log('AAA dataColumnsTemp ', dataColumnsTemp);
...@@ -165,7 +175,7 @@ $(document).ready(function(){ ...@@ -165,7 +175,7 @@ $(document).ready(function(){
value: valueFormat value: valueFormat
} }
}, },
legend: {show: false}, legend: {show: true},
}); });
// Подсвечиваем Определяем индексы воскресенья: // Подсвечиваем Определяем индексы воскресенья:
......
...@@ -2,19 +2,11 @@ $(document).ready(function(){ ...@@ -2,19 +2,11 @@ $(document).ready(function(){
var var
$table = $('#table-line'), $table = $('#table-line'),
$tableHeader = $('<thead>'),
$tableContent = $('<tbody>'), $tableContent = $('<tbody>'),
$tableBody = $table.find('tbody').first(), $tableBody = $table.find('tbody').first(),
activeLinesSwitchSelector = '.b-filter__switch.current-metric:not(.metric-data) .b-filter__switch-item',
$activeLinesSwitch = $(activeLinesSwitchSelector),
selectorTableTimeSwitch = '.b-filter__switch.time-table .m-filter__switch-item_active',
selectorActiveData = '.b-filter__switch.metric-data .m-filter__switch-item_active',
timeTableType,
activeLines = [], activeLines = [],
currentActiveLine, currentActiveLine,
metric, dataTable;
dataTable,
bySiteState = false;
function valueFormat(value) function valueFormat(value)
{ {
...@@ -83,10 +75,6 @@ $(document).ready(function(){ ...@@ -83,10 +75,6 @@ $(document).ready(function(){
dataTable[item] = []; dataTable[item] = [];
}); });
$table.removeClass('compare');
$('thead', $table).removeClass('sortable');
if (dataLineChartStat.type == 'interval') { if (dataLineChartStat.type == 'interval') {
RenderInterval(dataLineChartStat); RenderInterval(dataLineChartStat);
} }
...@@ -108,14 +96,7 @@ $(document).ready(function(){ ...@@ -108,14 +96,7 @@ $(document).ready(function(){
}) })
return (listSites.length == 0) ? false : listSites; return (listSites.length == 0) ? false : listSites;
}, },
// Устанавливаем состояние "по сайту" (при клике на сайт в таблице)
SetSiteState: function(state) {
bySiteState = state;
},
// Получаем состояние "по сайту"
GetSiteState: function() {
return bySiteState;
},
} }
}); });
......
...@@ -28,7 +28,7 @@ $(document).ready(function(){ ...@@ -28,7 +28,7 @@ $(document).ready(function(){
var var
$chartStat = $('#chart-graph-stat'), $chartStat = $('#chart-graph-stat'),
$chartTable = $('#b-content__traffic-table'), $chartTable = $('#table-stat'),
$chartStatInfo = $('.chart-graph-stat-info'), $chartStatInfo = $('.chart-graph-stat-info'),
$chartStatError = $('.chart-graph-stat-error'), $chartStatError = $('.chart-graph-stat-error'),
$chartStatLoading = $('.chart-graph-stat-loading'), $chartStatLoading = $('.chart-graph-stat-loading'),
......
...@@ -133,16 +133,15 @@ $dates = $this->dates; ...@@ -133,16 +133,15 @@ $dates = $this->dates;
<div class="message"></div> <div class="message"></div>
</div> </div>
<?php /* График */ ?>
<div id="chart-graph-stat" style="height: 370px;"></div> <div id="chart-graph-stat" style="height: 370px;"></div>
<div class="chart-graph-stat-loading"></div> <div class="chart-graph-stat-loading"></div>
<?php /* Таблица */ ?> <?php /* Таблица */ ?>
<section id="b-content__traffic-table" class="b-content__traffic metrics" style="display: none;"> <div id="table-stat" class="b-table_wrapp">
<div class="b-content__loading"></div> <div class="b-content__loading"></div>
<div class="wrapp">
<table id="table-line" class="table table-striped admin"> <table id="table-line" class="table table-striped admin">
<thead class="metric"> <thead class="metric sortable">
<tr data-metric="<?= $metric ?>" <?= $current_style ?>> <tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<th><?= _t('Дата/Компания')?></th> <th><?= _t('Дата/Компания')?></th>
<?php foreach(['shows', 'clicks', 'transactions', 'salemoney', 'admoney'] as $name): ?> <?php foreach(['shows', 'clicks', 'transactions', 'salemoney', 'admoney'] as $name): ?>
...@@ -160,7 +159,6 @@ $dates = $this->dates; ...@@ -160,7 +159,6 @@ $dates = $this->dates;
</tbody> </tbody>
</table> </table>
</div> </div>
</section>
</div> </div>
</section> </section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment