Add spreadsheet geenration based on jquery Grid
This commit is contained in:
7
benchmark/website/source/bootstrap.min.js
vendored
Normal file
7
benchmark/website/source/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1681
benchmark/website/source/jquery.dynatable.js
Normal file
1681
benchmark/website/source/jquery.dynatable.js
Normal file
File diff suppressed because it is too large
Load Diff
1650
benchmark/website/source/jquery.jqGrid.min.js
vendored
Normal file
1650
benchmark/website/source/jquery.jqGrid.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
benchmark/website/source/jquery.min.js
vendored
Normal file
4
benchmark/website/source/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -91,3 +91,30 @@ function buildChart(ctx, bare_data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buildSpreadsheet(ctx, data) {
|
||||
// Generate columns for header.
|
||||
var columns = [{label: "", name: "", width: 300}];
|
||||
for (label of data.labels) {
|
||||
columns.push({label: label, name: label});
|
||||
}
|
||||
// Generate actual data.
|
||||
var rows = [];
|
||||
for (dataset of data.datasets) {
|
||||
var row = [dataset.label];
|
||||
for (value of dataset.data) {
|
||||
row.push(secondsToHumanReadable(value));
|
||||
}
|
||||
rows.push(row);
|
||||
}
|
||||
// Create actual table.
|
||||
$(ctx).jqGrid({
|
||||
data: rows,
|
||||
localReader: {repeatitems: true},
|
||||
datatype: "local",
|
||||
styleUI : 'Bootstrap',
|
||||
colModel: columns,
|
||||
caption: "Spreadsheet",
|
||||
height: 300,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user