Skip to content

Commit d4ffdad

Browse files
fixed numbers/strings align, bold font in summary
1 parent 5068ef5 commit d4ffdad

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
MDX2JSONSource: "http://localhost:57772/SAMPLES", // MDX2JSON server address
9191
basicMDX: typeof req === "object" ? req.basicMDX : req
9292
}
93-
//, showSummary: true // show summary by column
93+
, showSummary: true // show summary by column
9494
//, formatNumbers: "#,###.##"
9595
//, drillDownTarget: "<dashboard name>" - undocumented, deepSee only
9696
};

source/css/LightPivot.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
overflow: hidden;
99
}
1010

11+
.lpt .formatLeft {
12+
text-align: left;
13+
}
14+
1115
.lpt .central {
1216
position: absolute;
1317
left: 0;

source/js/DataController.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ DataController.prototype.resetRawData = function () {
212212
sum += parseFloat(array[i][column]["value"]) || 0;
213213
}
214214
return sum || "";
215-
})(rawData, xh, rawData.length - xh, i)
215+
})(rawData, xh, rawData.length - xh, i),
216+
style: {
217+
"font-weight": 900
218+
}
216219
}
217220
}
218221
}

source/js/PivotView.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,15 @@ PivotView.prototype.renderRawData = function (data) {
454454

455455
if (td) {
456456
var span = document.createElement("span");
457+
if (!isFinite(data[y][x].value)) {
458+
if (!data[y][x].value.toString().match(/[0-9],?[0-9]?%/i))
459+
td.className = "formatLeft";
460+
}
461+
if (data[y][x].style) {
462+
for (i in data[y][x].style) {
463+
td.style[i] = data[y][x].style[i];
464+
}
465+
}
457466
td.appendChild(span);
458467
tr.appendChild(td);
459468
if (x >= headLeftColsNum && y >= headRowsNum) {

0 commit comments

Comments
 (0)