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
50ea8e2f
Commit
50ea8e2f
authored
Apr 12, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Добавил точность 2 знака для денежных полей в легенде графика
parent
155d0f44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
script-feeds-stat-charts.js
src/public/js/script-feeds-stat-charts.js
+9
-3
No files found.
src/public/js/script-feeds-stat-charts.js
View file @
50ea8e2f
...
@@ -14,7 +14,8 @@ $(document).ready(function(){
...
@@ -14,7 +14,8 @@ $(document).ready(function(){
chart
,
chart
,
categoriesNames
,
categoriesNames
,
selectedCategoriesId
,
selectedCategoriesId
,
colorsActiveLines
=
$
(
selectorGraphChartStat
).
data
(
'colors'
);
colorsActiveLines
=
$
(
selectorGraphChartStat
).
data
(
'colors'
),
currencyFields
=
[
'admoney'
,
'salemoney'
,
'usdollarmoney'
,
'localmoney'
,
'AdMoney'
,
'OrderSum'
,
'Price'
];
// Добавление впереди 0 у однозначных значений
// Добавление впереди 0 у однозначных значений
function
pad
(
number
)
{
function
pad
(
number
)
{
...
@@ -34,7 +35,8 @@ $(document).ready(function(){
...
@@ -34,7 +35,8 @@ $(document).ready(function(){
function
valueFormat
(
value
,
ratio
,
id
)
function
valueFormat
(
value
,
ratio
,
id
)
{
{
var
var
currencyFields
=
[
'admoney'
,
'salemoney'
,
'usdollarmoney'
,
'localmoney'
],
indCat
=
parseInt
(
id
.
replace
(
'data'
,
''
)),
activeLine
=
activeLines
[
indCat
-
1
],
isCurrencyValue
=
currencyFields
.
indexOf
(
activeLine
)
>
-
1
,
isCurrencyValue
=
currencyFields
.
indexOf
(
activeLine
)
>
-
1
,
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
format
=
(
isCurrencyValue
)
?
d3
.
format
(
',.2f'
)
:
d3
.
format
(
',.0f'
);
...
@@ -43,7 +45,11 @@ $(document).ready(function(){
...
@@ -43,7 +45,11 @@ $(document).ready(function(){
return
value
.
toFixed
(
accuracy
);
return
value
.
toFixed
(
accuracy
);
}
}
return
format
(
value
);
if
(
isCurrencyValue
)
{
return
format
(
value
)
+
' грн.'
;
}
else
{
return
format
(
value
);
}
}
}
function
valueFormatTick
(
value
)
function
valueFormatTick
(
value
)
...
...
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