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
0ccd5763
Commit
0ccd5763
authored
Apr 13, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Вернул округление до целых для суммы заказа, подсветка вскр. на шкале
parent
50ea8e2f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
script-feeds-stat-charts.js
src/public/js/script-feeds-stat-charts.js
+7
-10
script-feeds-stat-table.js
src/public/js/script-feeds-stat-table.js
+3
-5
No files found.
src/public/js/script-feeds-stat-charts.js
View file @
0ccd5763
...
@@ -35,11 +35,14 @@ $(document).ready(function(){
...
@@ -35,11 +35,14 @@ $(document).ready(function(){
function
valueFormat
(
value
,
ratio
,
id
)
function
valueFormat
(
value
,
ratio
,
id
)
{
{
var
var
indCat
=
parseInt
(
id
.
replace
(
'data'
,
''
)),
dataLine
=
activeLines
[
parseInt
(
id
.
replace
(
'data'
,
''
))
-
1
],
activeLine
=
activeLines
[
indCat
-
1
],
isCurrencyValue
=
currencyFields
.
indexOf
(
dataLine
)
>
-
1
,
isCurrencyValue
=
currencyFields
.
indexOf
(
activeLine
)
>
-
1
,
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
if
(
dataLine
==
'OrderSum'
)
{
format
=
d3
.
format
(
',.0f'
);
}
if
(
parseFloat
(
format
(
value
))
==
0
&&
value
!=
0
)
{
if
(
parseFloat
(
format
(
value
))
==
0
&&
value
!=
0
)
{
var
accuracy
=
Math
.
abs
(
Math
.
floor
(
Math
.
log10
(
value
)));
var
accuracy
=
Math
.
abs
(
Math
.
floor
(
Math
.
log10
(
value
)));
return
value
.
toFixed
(
accuracy
);
return
value
.
toFixed
(
accuracy
);
...
@@ -107,13 +110,6 @@ $(document).ready(function(){
...
@@ -107,13 +110,6 @@ $(document).ready(function(){
DateStat
:
function
(
dataLineChartStat
)
{
DateStat
:
function
(
dataLineChartStat
)
{
//console.log('AAA DateStat: ', dataLineChartStat);
//console.log('AAA DateStat: ', dataLineChartStat);
/*
if (dataLineChartStat.report == 'common') {
activeLines = ['Views', 'Clicks', 'Orders', 'OrderSum', 'AdMoney'];
activeLine = 'Views';
}
*/
// Диапазон дат:
// Диапазон дат:
if
(
dataLineChartStat
.
type
==
'interval'
)
{
if
(
dataLineChartStat
.
type
==
'interval'
)
{
...
@@ -125,6 +121,7 @@ $(document).ready(function(){
...
@@ -125,6 +121,7 @@ $(document).ready(function(){
formatTimeX
=
'%m-%d'
;
formatTimeX
=
'%m-%d'
;
dataPeriod
=
dataLineChartStat
[
'period'
];
dataPeriod
=
dataLineChartStat
[
'period'
];
activeDays
=
'day'
;
var
var
dataColumnsTemp
=
[[
'x'
].
concat
(
dataPeriod
)],
dataColumnsTemp
=
[[
'x'
].
concat
(
dataPeriod
)],
...
...
src/public/js/script-feeds-stat-table.js
View file @
0ccd5763
...
@@ -47,10 +47,9 @@ $(document).ready(function(){
...
@@ -47,10 +47,9 @@ $(document).ready(function(){
isNonFormatValue
=
notFormatFields
.
indexOf
(
currentActiveLine
)
>
-
1
,
isNonFormatValue
=
notFormatFields
.
indexOf
(
currentActiveLine
)
>
-
1
,
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
/*
if
(
currentActiveLine
==
'OrderSum'
)
{
if (currentActiveLine == 'AdMoney') {
format
=
d3
.
format
(
',.0f'
);
format = d3.format(',.2f');
}
}*/
if
(
isNonFormatValue
)
{
if
(
isNonFormatValue
)
{
return
value
;
return
value
;
...
@@ -137,7 +136,6 @@ $(document).ready(function(){
...
@@ -137,7 +136,6 @@ $(document).ready(function(){
return
(
isDesc
)
?
b
[
sortField
]
-
a
[
sortField
]
:
a
[
sortField
]
-
b
[
sortField
];
return
(
isDesc
)
?
b
[
sortField
]
-
a
[
sortField
]
:
a
[
sortField
]
-
b
[
sortField
];
}
}
});
});
console
.
log
(
'AAA dataTableForSort = '
,
dataTableForSort
);
// Отрисовка таблицы:
// Отрисовка таблицы:
dataTableForSort
.
forEach
(
function
(
item
){
dataTableForSort
.
forEach
(
function
(
item
){
...
...
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