Skip to content

Commit ba3775c

Browse files
committed
pivotchart add date type
1 parent 11ee8e5 commit ba3775c

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

dist/widgets.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "widgets",
3-
"version": "1.2.8",
3+
"version": "1.2.9",
44
"description": "",
55
"main": "dist/widgets.js",
66
"directories": {

src/components/chart_pivot.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,16 @@
7777
let gdata = it.generatedData;
7878
let tmpCols = [];
7979
_.each(gdata.cols, function(col){
80-
tmpCols.push(_.uniq(col).join(', '));
80+
tmpCols.push(typeof _.uniq(col)[0] == "object" ? _.uniq(col)[0] : _.uniq(col).join(', '));
8181
});
8282
8383
let tmpRows = [];
8484
_.each(gdata.rows, function (row) {
85-
tmpRows.push([row.slice(0, gdata.titlesSize).join(', ')].concat(row.slice(gdata.titlesSize, row.length)));
85+
tmpRows.push([typeof tmpCols[0] == "object" && (tmpCols[0].type == 'date' || tmpCols[0].type == 'datetime') ? new Date(row[0]) : row.slice(0, gdata.titlesSize).join(', ')].concat(row.slice(gdata.titlesSize, row.length)));
8686
});
8787
88-
data.push([tmpCols.slice(0, gdata.titlesSize).join(', ')].concat(tmpCols.slice(gdata.titlesSize, tmpCols.length)));
88+
data.push([typeof tmpCols[0] == "object" ? tmpCols[0] : tmpCols.slice(0, gdata.titlesSize).join(', ')].concat(tmpCols.slice(gdata.titlesSize, tmpCols.length)));
8989
data = data.concat(tmpRows);
90-
9190
return data;
9291
}
9392
}

0 commit comments

Comments
 (0)