Skip to content

Instantly share code, notes, and snippets.

@EE2dev
Last active November 6, 2015 22:56
Show Gist options
  • Save EE2dev/2a7a31815153d26b39f6 to your computer and use it in GitHub Desktop.
Save EE2dev/2a7a31815153d26b39f6 to your computer and use it in GitHub Desktop.
item explorer - data format - example 4

An example of the required format for item explorer. This example shows how to use dimensions. Introducing different dimensions for the items typically means that each dimension is refering to something different. In this example dimensions distinguish between items (bought) and payment method. Using dimensions has two effects:

  • for each dimension the corresponding items are shown in a separate chart with the dimension label for the x axis
  • when sorting is applied each dimension is sorted separately

More examples

The main example is here.

Complete list of examples:

  1. Data formatting
  1. Including data
  1. Visualization options
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<link rel="stylesheet" type="text/css" href="http://www.ankerst.de/lib/itemExplorer_10.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="http://www.ankerst.de/lib/itemExplorer_10.min.js"></script>
</head>
<body>
<script>
var myIEChart = itemExplorerChart("items_5d.csv");
showChart();
function showChart() {
d3.select("body")
.append("div")
.attr("class", "chart")
.call(myIEChart);
}
</script>
</body>
</html>
_customers B-jui:DI=items B-wat:DI=items B-bee:DI=items B-mil:DI=items B-win:DI=items F-egg:DI=items F-cer:DI=items F-can:DI=items F-mea:DI=items F-fis:DI=items F-fru:DI=items F-veg:DI=items F-che:DI=items O-flo:DI=items O-mag:DI=items O-hyg:DI=items O-cos:DI=items cash:DI=payment method credit:DI=payment method debit:DI=payment method
200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
100000 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0
100000 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1
100000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0
100000 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment