-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CSS to set background color and bold font for subtotal rows and…
… columns
- Loading branch information
1 parent
15bda1b
commit 874b8d5
Showing
5 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Pivot Demo</title> | ||
<!-- external libs from cdnjs --> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.1.0/pivot.min.js"></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.1.0/pivot.min.css"> | ||
|
||
<!-- PivotTable.js libs from ../dist --> | ||
<script type="text/javascript" src="../dist/subtotal.js"></script> | ||
|
||
<style> | ||
body {font-family: Verdana;} | ||
.pvtRowSubtotal { | ||
background-color: #EFEFEF !important; | ||
font-weight:bold; | ||
} | ||
.pvtColSubtotal { | ||
background-color: #EFEFEF !important; | ||
font-weight:bold; | ||
} | ||
</style> | ||
|
||
<!-- optional: mobile support with jqueryui-touch-punch --> | ||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script> | ||
|
||
<!-- for examples only! script to show code to user --> | ||
<script type="text/javascript" src="show_code.js"></script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
// This example loads the "Canadian Parliament 2012" dataset | ||
// and adds derived attributes: "Age Bin" and "Gender Imbalance". | ||
|
||
$(function(){ | ||
var dataClass = $.pivotUtilities.SubtotalPivotData; | ||
var derivers = $.pivotUtilities.derivers; | ||
var renderer = $.pivotUtilities.subtotal_renderers["Table With Subtotal"]; | ||
|
||
$.getJSON("mps.json", function(mps) { | ||
$("#output").pivot(mps, { | ||
dataClass: dataClass, | ||
rows: ["Gender", "Province"], | ||
cols: ["Party", "Age Bin", "Age"], | ||
renderer: renderer, | ||
derivedAttributes: { | ||
"Age Bin": derivers.bin("Age", 10), | ||
"Gender Imbalance": function(mp) { | ||
return mp["Gender"] == "Male" ? 1 : -1; | ||
} | ||
}, | ||
rendererOptions: { | ||
collapseRowsAt: "Gender", | ||
collapseColsAt: "Party" | ||
} | ||
}); | ||
}); | ||
}); | ||
</script> | ||
<p><a href="index.html">« back to examples</a></p> | ||
<p></p> | ||
<p>To expand and collapse rows, click on ▶ and ◢ arrows in the table. Scroll down to view the code.</p> | ||
<p></p> | ||
<div id="output" style="margin: 30px;"></div> | ||
<p></p> | ||
<p><a href="index.html">« back to examples</a></p> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.