block by EE2dev 3bb8a779948659a5b101

item explorer - data source - example 1

Full Screen

An example how to use item explorer by including data with a reference to a csv file. The data is assumed to be in the required format.

This is the standard way of reading data.

More examples

The main example is here.

Complete list of examples:

  1. Data formatting

  2. Including data

  3. Visualization options

index.html

<!DOCTYPE html>	
<meta charset="utf-8">
<head>
  <link rel="stylesheet" type="text/css" href="//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="//www.ankerst.de/lib/itemExplorer_10.min.js"></script>
</head>

<body>
  <script>  
    var myIEChart = itemExplorerChart("items_small.csv");
    showChart(); 
    
    function showChart() {
      d3.select("body")
        .append("div")
        .attr("class", "chart")
        .call(myIEChart);
    }   
  </script>
</body>
</html> 

items_small.csv

_customers,item1,item2,item3,item4
100000,0,0,0,1
100000,0,0,1,1
100000,0,1,0,1
100000,0,1,1,1
100000,1,0,0,1
100000,1,0,1,1
100000,1,1,0,1
100000,1,1,1,1
100000,0,0,0,0
100000,0,0,1,0
100000,0,1,0,0
100000,0,1,1,0
100000,1,0,0,0
100000,1,0,1,0
100000,1,1,0,0
100000,1,1,1,0