Вернул округление до целых для суммы заказа, подсветка вскр. на шкале

parent 50ea8e2f
...@@ -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);
...@@ -106,13 +109,6 @@ $(document).ready(function(){ ...@@ -106,13 +109,6 @@ $(document).ready(function(){
ChartStat: { ChartStat: {
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)],
......
...@@ -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){
......
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