Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS Styling example #1038

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions examples/css_style.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<title>Pivot CSS Styling 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>

<!-- PivotTable.js libs from ../dist -->
<link rel="stylesheet" type="text/css" href="../dist/pivot.css">
<script type="text/javascript" src="../dist/pivot.js"></script>
<style>
body {font-family: Verdana;}
/* High-contrast, dark theme for UI*/
.pvtUiCell, .pvtRenderer, .pvtAggregator, .pvtAttr, .pvtTriangle, .pvtFilterBox, .pvtFilterBox .count, .pvtFilterBox button
{
background-color: #000 !important;
color: #FFF;
}

/* Hides the UI when printing*/
@media print
{
.pvtUiCell
{ display: none; }
}
</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">
// Basic usage of pivotUI()

$(function(){
$("#output").pivotUI(
[
{color: "blue", shape: "circle"},
{color: "red", shape: "triangle"}
],
{
rows: ["color"],
cols: ["shape"]
}
);
});
</script>

<p><a href="index.html">&laquo; back to PivotTable.js examples</a></p>

<pre style='font-family: Source Code Pro;'>
&lt;<span style='color:#3182bd;'>style</span>&gt;
<span style='color:gray;'>/* High-contrast, dark theme for UI*/</span>
<span style='color:#756bb1;'>.pvtUiCell</span>, <span style='color:#756bb1;'>.pvtRenderer</span>, <span style='color:#756bb1;'>.pvtAggregator</span>, <span style='color:#756bb1;'>.pvtAttr</span>, <span style='color:#756bb1;'>.pvtTriangle</span>, <span style='color:#756bb1;'>.pvtFilterBox</span>, <span style='color:#756bb1;'>.pvtFilterBox .count</span>, <span style='color:#756bb1;'>.pvtFilterBox button</span>
{
background-color: #000 !important;
color: #FFF;
}

<span style='color:gray;'>/* Hides the UI when printing*/</span>
<span style='color:#756bb1;'>@media print</span>
{
<span style='color:#756bb1;'>.pvtUiCell</span>
{ display: none; }
}
&lt;/<span style='color:#3182bd;'>style</span>&gt;
</pre>

<div id="output" style="margin: 30px;"></div>

</body>
</html>
1 change: 1 addition & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h3 align="center">Basic examples</h3>
<li><a href="scatter.html">pivot() with CSV input and chart output</a></li>
<li><a href="simple_ui.html">pivotUI() with "array of objects" input</a></li>
<li><a href="simple_ui_from_table.html">pivotUI() with table element input</a></li>
<li><a href="css_style.html">pivotUI() with CSS styling</a></li>
</ul>

<h3 align="center">Canadian Parliament 2012 Dataset <small>(<a href="mps.csv">CSV</a> or <a href="mps.json">JSON</a>)</small></h3>
Expand Down