Merge composite-axes

master
johnkiernander 2014-04-02 18:55:43 +01:00
parent 834220da66
commit f12e27ab55
78 changed files with 4790 additions and 169 deletions

4462
dist/dimple.v1.1.6.js vendored Normal file

File diff suppressed because it is too large Load Diff

3
dist/dimple.v1.1.6.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
// This is the simple vertical grouped stacked 100% bar example
var svg = dimple.newSvg("#chartContainer", 590, 400);

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
// Create the svg and set the dimensions

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
// Create the svg and set the dimensions

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
var data = [

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer" style="height: 100%">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
// In version 1.1.0 it's possible to initialise any size parameter with a
// % value as well as pixels

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
// This code should support any data in this structure changing the data here

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -1,14 +1,10 @@
<!----------------------------------------------------------------->
<!-- AUTOMATICALLY GENERATED CODE - PLEASE EDIT TEMPLATE INSTEAD -->
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {
var myChart = new dimple.chart(svg, data);

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -3,7 +3,7 @@
<!----------------------------------------------------------------->
<div id="chartContainer">
<script src="/lib/d3.v3.min.js"></script>
<script src="/dist/dimple.v1.1.5.js"></script>
<script src="/dist/dimple.v1.1.6.js"></script>
<script type="text/javascript">
var svg = dimple.newSvg("#chartContainer", 590, 400);
d3.tsv("/data/example_data.tsv", function (data) {

View File

@ -10,7 +10,7 @@
// Add a bullet chart to the svg
function addBullet(x, y, height, width, measure, lowMark,
highMark, axisMax, compareField, keyVal,
highMark, compareField, keyVal,
compareVal, color) {
// This is a custom algorithm to lighten the passed color, I find I can't
@ -59,22 +59,12 @@
var bX = bullet.addMeasureAxis("x", "Value");
// Add a separate x axis for each measure, this is required
// where we want to do a series for each measure
var lX = bullet.addMeasureAxis("x", "Low Value");
var hX = bullet.addMeasureAxis("x", "High Value");
var cX = bullet.addMeasureAxis("x", "Compare Value");
// Fix all max values so that a single x axis will read correctly
// for all 4. Without this all axes would scale differently
bX.overrideMax = axisMax;
lX.overrideMax = axisMax;
hX.overrideMax = axisMax;
cX.overrideMax = axisMax;
// Hide the additional axes
lX.hidden = true;
hX.hidden = true;
cX.hidden = true;
// where we want to do a series for each measure. By passing
// another axis in place of the position we combine them to create
// a 4 measure composite.
var lX = bullet.addMeasureAxis(bX, "Low Value");
var hX = bullet.addMeasureAxis(bX, "High Value");
var cX = bullet.addMeasureAxis(bX, "Compare Value");
// Add a series for the marks first (the order defines)
// document z position - first at back, last on top
@ -116,17 +106,17 @@
// means to determine axis bounds would be better but I don't want to
// bloat this example.
addBullet(100, 30, 430, 30, "Unit Sales", 2300000, 2800000,
3000000, "Owner", "Aperture", "Black Mesa", "#80B1D3");
"Owner", "Aperture", "Black Mesa", "#80B1D3");
addBullet(100, 90, 430, 30, "Sales Value", 135000000, 145000000,
180000000, "Owner", "Aperture", "Black Mesa", "#80B1D3");
"Owner", "Aperture", "Black Mesa", "#80B1D3");
addBullet(100, 150, 430, 30, "Cost of Sales", 200000, 300000,
500000, "Owner", "Aperture", "Black Mesa", "#FB8072");
"Owner", "Aperture", "Black Mesa", "#FB8072");
addBullet(100, 210, 430, 30, "Gross Profit", 140000000, 170000000,
180000000, "Owner", "Aperture", "Black Mesa", "#80B1D3");
"Owner", "Aperture", "Black Mesa", "#80B1D3");
addBullet(100, 270, 430, 30, "Indirect Costs", 100000000, 150000000,
160000000, "Owner", "Aperture", "Black Mesa", "#FB8072");
"Owner", "Aperture", "Black Mesa", "#FB8072");
addBullet(100, 330, 430, 30, "Operating Profit", 12000000, 16000000,
18000000, "Owner", "Aperture", "Black Mesa", "#80B1D3");
"Owner", "Aperture", "Black Mesa", "#80B1D3");
});
</script>

View File

@ -1,6 +1,6 @@
{
"name": "dimple",
"version": "1.1.5",
"version": "1.1.6",
"private": true,
"licenses": [
{

View File

@ -4,7 +4,7 @@
// Create the stub object
var dimple = {
version: "1.1.5",
version: "1.1.6",
plot: {},
aggregateMethod: {}
};

View File

@ -46,7 +46,13 @@
this.useLog = false;
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-logBase
this.logBase = 10;
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-title
this.title = undefined;
// If this is a slave axis to a master composite axis, this stores a reference to the master
this._master = null;
// If this is a composite axis, store links to all slaves
this._slaves = [];
// The scale determined by the update method
this._scale = null;
// The minimum and maximum axis values

View File

@ -0,0 +1,11 @@
// Copyright: 2013 PMSI-AlignAlytics
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
// Source: /src/objects/axis/methods/_getTopMaster.js
this._getTopMaster = function () {
// The highest level master
var topMaster = this;
if (this.master !== null && this.master !== undefined) {
topMaster = this.master._getTopMaster();
}
return topMaster;
};

View File

@ -48,7 +48,7 @@
this._max = (this.overrideMax !== null ? this.overrideMax : this._max);
// If this is an x axis
if (this.position === "x") {
if (this.position === "x" && this._scale === null) {
if (this._hasTimeField()) {
this._scale = d3.time.scale()
.rangeRound([this.chart._xPixels(), this.chart._xPixels() + this.chart._widthPixels()])
@ -65,6 +65,12 @@
.nice();
} else if (this.measure === null || this.measure === undefined) {
distinctCats = getOrderedCategories(this, "x", "y");
// If there are any slaves process accordingly
if (this._slaves !== null && this._slaves !== undefined) {
this._slaves.forEach(function (slave) {
distinctCats = distinctCats.concat(getOrderedCategories(slave, "x", "y"));
}, this);
}
this._scale = d3.scale.ordinal()
.rangePoints([this.chart._xPixels(), this.chart._xPixels() + this.chart._widthPixels()])
.domain(distinctCats.concat([""]));
@ -90,7 +96,7 @@
break;
}
}
} else if (this.position === "y") {
} else if (this.position === "y" && this._scale === null) {
if (this._hasTimeField()) {
this._scale = d3.time.scale()
.rangeRound([this.chart._yPixels() + this.chart._heightPixels(), this.chart._yPixels()])
@ -107,6 +113,12 @@
.nice();
} else if (this.measure === null || this.measure === undefined) {
distinctCats = getOrderedCategories(this, "y", "x");
// If there are any slaves process accordingly
if (this._slaves !== null && this._slaves !== undefined) {
this._slaves.forEach(function (slave) {
distinctCats = distinctCats.concat(getOrderedCategories(slave, "y", "x"));
}, this);
}
this._scale = d3.scale.ordinal()
.rangePoints([this.chart._yPixels() + this.chart._heightPixels(), this.chart._yPixels()])
.domain(distinctCats.concat([""]));
@ -133,7 +145,7 @@
break;
}
}
} else if (this.position.length > 0 && this.position[0] === "z") {
} else if (this.position.length > 0 && this.position[0] === "z" && this._scale === null) {
if (this.useLog) {
this._scale = d3.scale.log()
.range([this.chart._heightPixels() / 300, this.chart._heightPixels() / 10])
@ -148,11 +160,17 @@
.range([this.chart._heightPixels() / 300, this.chart._heightPixels() / 10])
.domain([this._min, this._max]);
}
} else if (this.position.length > 0 && this.position[0] === "c") {
} else if (this.position.length > 0 && this.position[0] === "c" && this._scale === null) {
this._scale = d3.scale.linear()
.range([0, (this.colors === null || this.colors.length === 1 ? 1 : this.colors.length - 1)])
.domain([this._min, this._max]);
}
// Apply this scale to all slaves as well
if (this._slaves !== null && this._slaves !== undefined && this._slaves.length > 0) {
this._slaves.forEach(function (slave) {
slave._scale = this._scale;
}, this);
}
// Check that the axis ends on a labelled tick
if ((refactor === null || refactor === undefined || refactor === false) && !this._hasTimeField() && this._scale !== null && this._scale.ticks !== null && this._scale.ticks !== undefined && this._scale.ticks(10).length > 0 && (this.position === "x" || this.position === "y")) {

View File

@ -110,17 +110,26 @@
aggField = [],
key,
k,
i,
newRow,
updateData;
if (series.categoryFields === null || series.categoryFields === undefined || series.categoryFields.length === 0) {
aggField = ["All"];
} else if (series.categoryFields.length === 1 && d[series.categoryFields[0]] === undefined) {
aggField = [series.categoryFields[0]];
} else {
series.categoryFields.forEach(function (cat) {
aggField.push(d[cat]);
}, this);
// Iterate the category fields
for (i = 0; i < series.categoryFields.length; i += 1) {
// Either add the value of the field or the name itself. This allows users to add custom values, for example
// Setting a particular color for a set of values can be done by using a non-existent final value and then coloring
// by it
if (d[series.categoryFields[i]] === undefined) {
aggField.push(series.categoryFields[i]);
} else {
aggField.push(d[series.categoryFields[i]]);
}
}
}
// Add a key
key = aggField.join("/") + "_" + xField.join("/") + "_" + yField.join("/") + "_" + zField.join("/");
// See if this field has already been added.

View File

@ -2,21 +2,53 @@
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
// Source: /src/objects/chart/methods/addAxis.js
// Help: http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.chart#wiki-addAxis
this.addAxis = function (position, categoryFields, measure, timeField) {
this.addAxis = function (position, categoryFields, measure, timeField) {
// The axis to return
var axis = null,
master = null;
// Convert the passed category fields to an array in case a single string is sent
if (categoryFields !== null && categoryFields !== undefined) {
categoryFields = [].concat(categoryFields);
}
// Create the axis object based on the passed parameters
var axis = new dimple.axis(
this,
position,
categoryFields,
measure,
timeField
);
// Add the axis to the array for the chart
this.axes.push(axis);
// If this is a standard axis a position will have been passed as a string
if ((typeof position) === "string" || (position instanceof String)) {
// Create the axis object based on the passed parameters
axis = new dimple.axis(
this,
position,
categoryFields,
measure,
timeField
);
// Add the axis to the array for the chart
this.axes.push(axis);
} else {
// In the case of a composite axis the position will contain another axis
// To make this code more readable reassign the position to a different variable
master = position;
// Construct the axis object
axis = new dimple.axis(
this,
master.position,
categoryFields,
measure,
timeField
);
// Validate that the master and child axes are compatible
if (axis._hasMeasure() !== master._hasMeasure()) {
throw "You have specified a composite axis where some but not all axes have a measure - this is not supported, all axes must be of the same type.";
} else if (axis._hasTimeField() !== master._hasTimeField()) {
throw "You have specified a composite axis where some but not all axes have a time field - this is not supported, all axes must be of the same type.";
} else if ((axis.categoryFields === null || axis.categoryFields === undefined ? 0 : axis.categoryFields.length) !== (master.categoryFields === null || master.categoryFields === undefined ? 0 : master.categoryFields.length)) {
throw "You have specified a composite axis where axes have differing numbers of category fields - this is not supported, all axes must be of the same type.";
}
// Set the master, meaning that rather than rendering itself, this axis will contribute to the
// scaling of the master
axis._master = master;
// Do not add the axis to the chart's axes array, instead add it the master
master._slaves.push(axis);
}
// return the axis
return axis;
};

View File

@ -14,7 +14,8 @@
chartX = this._xPixels(),
chartY = this._yPixels(),
chartWidth = this._widthPixels(),
chartHeight = this._heightPixels();
chartHeight = this._heightPixels(),
linkedDimensions = [];
// Many of the draw methods use positioning data in each series. Therefore we should
// decorate the series with it now
@ -34,7 +35,7 @@
// Find any linked series
this.series.forEach(function (series) {
// if this axis is linked
if (series[axis.position] === axis) {
if (series._deepMatch(axis)) {
// Get the bounds
var bounds = series._axisBounds(axis.position);
if (axis._min > bounds.min) { axis._min = bounds.min; }
@ -75,8 +76,13 @@
}, this);
axis._max = distinctCats.length;
}
// Set the bounds on all slaves
if (axis._slaves !== null && axis._slaves !== undefined && axis._slaves.length > 0) {
axis._slaves.forEach(function (slave) {
slave._min = axis._min;
slave._max = axis._max;
}, this);
}
// Update the axis now we have all information set
axis._update();
@ -298,15 +304,16 @@
rotate = "rotate(270, " + titleX + ", " + titleY + ")";
}
// Add a title for the axis
if (!axis.hidden && (axis.position === "x" || axis.position === "y")) {
// Add a title for the axis - NB check for null here, by default the title is undefined, in which case
// use the dimension name
if (!axis.hidden && (axis.position === "x" || axis.position === "y") && axis.title !== null) {
axis.titleShape = this._group.append("text").attr("class", "axis title");
axis.titleShape
.attr("x", titleX)
.attr("y", titleY)
.attr("text-anchor", "middle")
.attr("transform", rotate)
.text((axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
.text(axis.title !== undefined ? axis.title : (axis.categoryFields === null || axis.categoryFields === undefined || axis.categoryFields.length === 0 ? axis.measure : axis.categoryFields.join("/")))
.each(function () {
if (!chart.noFormats) {
d3.select(this)

View File

@ -358,44 +358,62 @@
// Add the series categories
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
series.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
}
}, this);
}
if (series.x._hasTimeField()) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
if (e.xField[0] !== null && e.xField[0] !== undefined) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
}
} else if (series.x._hasCategories()) {
// Add the x axis categories
series.x.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
}
}
if (series.y._hasTimeField()) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
if (e.yField[0] !== null && e.yField[0] !== undefined) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
}
} else if (series.y._hasCategories()) {
// Add the y axis categories
series.y.categoryFields.forEach(function (c, i) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
}
}
if (series.z !== null && series.z !== undefined) {
// Add the axis measure value
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
}
}
if (series.c !== null && series.c !== undefined) {
// Add the axis measure value
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
}
}
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality

View File

@ -189,39 +189,62 @@
// Add the series categories
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
series.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
}
}, this);
}
if (series.x._hasTimeField()) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
if (e.xField[0] !== null && e.xField[0] !== undefined) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
}
} else if (series.x._hasCategories()) {
// Add the x axis categories
series.x.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
}
}
if (series.y._hasTimeField()) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
if (e.yField[0] !== null && e.yField[0] !== undefined) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
}
} else if (series.y._hasCategories()) {
// Add the y axis categories
series.y.categoryFields.forEach(function (c, i) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
}
}
if (series.z !== null && series.z !== undefined) {
// Add the axis measure value
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
}
}
if (series.c !== null && series.c !== undefined) {
// Add the axis measure value
rows.push(series.c.measure + ": " + series.c._getFormat()(series.c.showPercent ? e.cPct : e.cValue));
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
}
}
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality

View File

@ -208,44 +208,62 @@
// Add the series categories
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
series.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
}
}, this);
}
if (series.x._hasTimeField()) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
if (e.xField[0] !== null && e.xField[0] !== undefined) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
}
} else if (series.x._hasCategories()) {
// Add the x axis categories
series.x.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
}
}
if (series.y._hasTimeField()) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
if (e.yField[0] !== null && e.yField[0] !== undefined) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
}
} else if (series.y._hasCategories()) {
// Add the y axis categories
series.y.categoryFields.forEach(function (c, i) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
}
}, this);
} else {
// Add the axis measure value
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
}
}
if (series.z !== null && series.z !== undefined) {
// Add the axis measure value
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
}
}
if (series.c !== null && series.c !== undefined) {
// Add the axis measure value
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
}
}
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality

View File

@ -339,50 +339,62 @@
// Add the series categories
if (series.categoryFields !== null && series.categoryFields !== undefined && series.categoryFields.length > 0) {
series.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
if (c !== null && c !== undefined && e.aggField[i] !== null && e.aggField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.aggField[i] !== c ? ": " + e.aggField[i] : ""));
}
}, this);
}
if (series.x._hasTimeField()) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
if (e.xField[0] !== null && e.xField[0] !== undefined) {
rows.push(series.x.timeField + ": " + series.x._getFormat()(e.xField[0]));
}
} else if (series.x._hasCategories()) {
// Add the x axis categories
series.x.categoryFields.forEach(function (c, i) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
if (c !== null && c !== undefined && e.xField[i] !== null && e.xField[i] !== undefined) {
// If the category name and value match don't display the category name
rows.push(c + (e.xField[i] !== c ? ": " + e.xField[i] : ""));
}
}, this);
} else if (series.x.useLog) {
// Add the y axis log
rows.push(series.x.measure + ": " + e.cx);
} else {
// Add the axis measure value
rows.push(series.x.measure + ": " + series.x._getFormat()(e.cx));
if (series.x.measure !== null && series.x.measure !== undefined && e.width !== null && e.width !== undefined) {
rows.push(series.x.measure + ": " + series.x._getFormat()(e.width));
}
}
if (series.y._hasTimeField()) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
if (e.yField[0] !== null && e.yField[0] !== undefined) {
rows.push(series.y.timeField + ": " + series.y._getFormat()(e.yField[0]));
}
} else if (series.y._hasCategories()) {
// Add the y axis categories
series.y.categoryFields.forEach(function (c, i) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
if (c !== null && c !== undefined && e.yField[i] !== null && e.yField[i] !== undefined) {
rows.push(c + (e.yField[i] !== c ? ": " + e.yField[i] : ""));
}
}, this);
} else if (series.y.useLog) {
// Add the y axis log
rows.push(series.y.measure + ": " + e.cy);
} else {
// Add the axis measure value
rows.push(series.y.measure + ": " + series.y._getFormat()(e.cy));
if (series.y.measure !== null && series.y.measure !== undefined && e.height !== null && e.height !== undefined) {
rows.push(series.y.measure + ": " + series.y._getFormat()(e.height));
}
}
if (series.z !== null && series.z !== undefined) {
// Add the axis measure value
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
if (series.z.measure !== null && series.z.measure !== undefined && e.zValue !== null && e.zValue !== undefined) {
rows.push(series.z.measure + ": " + series.z._getFormat()(e.zValue));
}
}
if (series.c !== null && series.c !== undefined) {
// Add the axis measure value
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
if (series.c.measure !== null && series.c.measure !== undefined && e.cValue !== null && e.cValue !== undefined) {
rows.push(series.c.measure + ": " + series.c._getFormat()(e.cValue));
}
}
// Get distinct text rows to deal with cases where 2 axes have the same dimensionality

View File

@ -0,0 +1,16 @@
// Copyright: 2013 PMSI-AlignAlytics
// License: "https://github.com/PMSI-AlignAlytics/dimple/blob/master/MIT-LICENSE.txt"
// Source: /src/objects/series/methods/_deepMatch.js
this._deepMatch = function (axis) {
// Return true if this series is dependant on the axis or any of its dependants
var match = false;
if (this[axis.position] === axis) {
match = true;
} else if (axis._slaves !== undefined && axis._slaves !== null && axis._slaves.length > 0) {
axis._slaves.forEach(function (slave) {
match = (match || this._deepMatch(slave));
}, this);
}
return match;
};

View File

@ -37,8 +37,8 @@
// Get the axis position based on the axis index
this.chart.axes.forEach(function (axis) {
if (axis.position === "x" && !this.x.hidden) {
if (axis === this.x) {
// Set the y co-ordinate for the x axis
if (this._deepMatch(axis)) {
// Set the y co-ordinate for the x axis
if (xIndex === 0) {
coord.y = firstOrig.y;
} else if (xIndex === 1) {
@ -47,7 +47,7 @@
}
xIndex += 1;
} else if (axis.position === "y" && !this.y.hidden) {
if (axis === this.y) {
if (this._deepMatch(axis)) {
// Set the x co-ordinate for the y axis
if (yIndex === 0) {
coord.x = firstOrig.x;