Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
addcpm-json
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Чаплыгин
addcpm-json
Commits
b491f1d2
Commit
b491f1d2
authored
Feb 19, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Вынес логику определения данных для категорий графика из плагина таблицы
parent
d1d77527
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
17 deletions
+15
-17
styles-feeds-stat.css
src/public/css/styles-feeds-stat.css
+2
-1
script-feeds-stat-charts.js
src/public/js/script-feeds-stat-charts.js
+11
-7
script-feeds-stat-table.js
src/public/js/script-feeds-stat-table.js
+0
-9
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+2
-0
No files found.
src/public/css/styles-feeds-stat.css
View file @
b491f1d2
...
...
@@ -24,7 +24,8 @@
}
#period-stats
,
#campaign-stats
#campaign-stats
,
#report-cats
{
display
:
none
;
}
...
...
src/public/js/script-feeds-stat-charts.js
View file @
b491f1d2
...
...
@@ -11,8 +11,10 @@ $(document).ready(function(){
//activeTime,
activeDays
,
toggelDates
=
[],
//selectedCategoriesId = [],
weekDatesDataStart
,
chart
,
categoriesNames
,
selectedCategoriesId
,
colorsActiveLines
=
$
(
selectorGraphChartStat
).
data
(
'colors'
);
...
...
@@ -88,7 +90,11 @@ $(document).ready(function(){
}
var
chart
;
// Получение данных для категорий:
if
(
$
(
'#report-cats'
).
val
())
{
categoriesNames
=
JSON
.
parse
(
$
(
'#report-cats'
).
val
());
}
$
.
extend
({
ChartStat
:
{
...
...
@@ -119,10 +125,8 @@ $(document).ready(function(){
axes
=
{},
colors
=
{};
// Определяем названия в легенде:
var
selectedCategoriesId
=
$
.
TableStat
.
CheckedCategories
(),
categoriesNames
=
$
.
TableStat
.
GetCategoriesNames
();
// Определяем выбранные категории для графика:
selectedCategoriesId
=
$
.
TableStat
.
CheckedCategories
();
// Скрываем график, если в таблице не выбраны категории:
if
(
selectedCategoriesId
.
length
==
0
)
{
...
...
@@ -136,7 +140,7 @@ $(document).ready(function(){
var
currentActiveLine
=
activeLines
[
i
-
1
];
if
(
selectedCategoriesId
.
indexOf
(
currentActiveLine
)
>
-
1
)
{
dataColumnsTemp
.
push
([
'data'
+
i
].
concat
(
dataLineChartStat
[
currentActiveLine
]));
names
[
'data'
+
i
]
=
categoriesNames
[
currentActiveLine
]
,
names
[
'data'
+
i
]
=
(
categoriesNames
)
?
categoriesNames
[
currentActiveLine
]
:
currentActiveLine
,
types
[
'data'
+
i
]
=
'area-spline'
;
axes
[
'data'
+
i
]
=
'y'
;
colors
[
'data'
+
i
]
=
colorsActiveLines
[
currentActiveLine
];
...
...
src/public/js/script-feeds-stat-table.js
View file @
b491f1d2
...
...
@@ -235,15 +235,6 @@ $(document).ready(function(){
});
return
listCats
;
},
// Определяем названия категорий в таблице:
GetCategoriesNames
:
function
()
{
var
namesCats
=
{};
$
(
'thead.metric.sortable th'
,
$table
).
each
(
function
(){
var
$this
=
$
(
this
);
namesCats
[
$this
.
data
(
'id'
)]
=
$
(
'b'
,
$this
).
text
();
});
return
namesCats
;
},
}
});
...
...
src/templates/app/user/cabinet-feed.phtml
View file @
b491f1d2
...
...
@@ -105,6 +105,8 @@ if (!$error) {
<?php
else
:
?>
<textarea
id=
"period-stats"
>
<?=
(
$periodStats
?
json_encode
(
$periodStats
,
JSON_UNESCAPED_UNICODE
)
:
''
)
?>
</textarea>
<textarea
id=
"report-cats"
>
<?=
(
$report_cats
?
json_encode
(
$report_cats
,
JSON_UNESCAPED_UNICODE
)
:
''
)
?>
</textarea>
<?php
/* ?>
<textarea id="campaign-stats"><?= ($campaignStats ? json_encode($campaignStats) : '')?></textarea>
<?php */
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment