+proper layout for Cluster Table
This commit is contained in:
parent
c087ed7706
commit
2f36e1a4d3
|
@ -1,12 +1,14 @@
|
||||||
<!--Anfang Skriptbereich-->
|
<!--Anfang Skriptbereich-->
|
||||||
|
|
||||||
<!--Script für Diagramme-->
|
<!--Script für Diagramme-->
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js" integrity="sha256-xKeoJ50pzbUGkpQxDYHD7o7hxe0LaOGeguUidbq6vis=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.min.js"
|
||||||
|
integrity="sha256-xKeoJ50pzbUGkpQxDYHD7o7hxe0LaOGeguUidbq6vis=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
|
||||||
<!--Script für Materlialize-->
|
<!--Script für Materlialize-->
|
||||||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
<script type="text/javascript"
|
||||||
|
src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/google-palette@1.1.0/palette.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/google-palette@1.1.0/palette.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
M.AutoInit();
|
M.AutoInit();
|
||||||
|
|
|
@ -63,6 +63,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--Gruppenübersicht-->
|
||||||
|
<div class="col s12 m12">
|
||||||
|
<div id="group_overview" class="card white">
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="center">
|
||||||
|
<span class="card-title center">Gruppenübersicht</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<table id="cluster_table">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--Warenkorbanlyse-->
|
<!--Warenkorbanlyse-->
|
||||||
<div id="shopping_card_analysis" class="col s12 m6">
|
<div id="shopping_card_analysis" class="col s12 m6">
|
||||||
<div class="card white">
|
<div class="card white">
|
||||||
|
@ -77,20 +92,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Gruppenübersicht-->
|
|
||||||
<div class="col s12 m6">
|
|
||||||
<div id="group_overview" class="card white">
|
|
||||||
<div class="card-content">
|
|
||||||
<div class="center">
|
|
||||||
<span class="card-title center">Gruppenübersicht</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<tabel id="cluster_table" width="1000" height="400">
|
|
||||||
</tabel>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Marketing-Cards-->
|
<!--Marketing-Cards-->
|
||||||
|
|
|
@ -15,25 +15,36 @@ function updateClusters(id) {
|
||||||
function drawClusterTable(){
|
function drawClusterTable(){
|
||||||
let row = $("<thead>");
|
let row = $("<thead>");
|
||||||
row.append("<tr>");
|
row.append("<tr>");
|
||||||
row.append("<td>Alter</td>");
|
row.append("<td></td>");
|
||||||
row.append("<td>Wohnort</td>");
|
for (x in cluster_result){
|
||||||
row.append("<td>Einkaufstag</td>");
|
if(x == 0){
|
||||||
row.append("<td>Geschlecht</td>");
|
row.append("<td>" + "ø" + "</td>");
|
||||||
row.append("<td>Familienstand</td>");
|
}else{
|
||||||
row.append("<td>Einkaufsuhrzeit</td>");
|
row.append("<td>" + x + "</td>");
|
||||||
|
}
|
||||||
|
}
|
||||||
row.append("</tr>");
|
row.append("</tr>");
|
||||||
row.append("</thead>");
|
row.append("</thead>");
|
||||||
row.append("</tbody>");
|
|
||||||
for(x in cluster_result){
|
|
||||||
row.append($("<tr>"));
|
appendClusterTable(row, "Alter");
|
||||||
row.append($("<td>" + cluster_result[x].Alter +"</td>"));
|
appendClusterTable(row, "Wohnort");
|
||||||
row.append($("<td>" + cluster_result[x].Wohnort +"</td>"));
|
appendClusterTable(row, "Einkaufstag");
|
||||||
row.append($("<td>" + cluster_result[x].Einkaufstag +"</td>"));
|
appendClusterTable(row, "Geschlecht");
|
||||||
row.append($("<td>" + cluster_result[x].Geschlecht +"</td>"));
|
appendClusterTable(row, "Familienstand");
|
||||||
row.append($("<td>" + cluster_result[x].Familienstand +"</td>"));
|
appendClusterTable(row, "Einkaufsuhrzeit");
|
||||||
row.append($("<td>" + cluster_result[x].Einkaufsuhrzeit +"</td>"));
|
|
||||||
row.append($("</tr>"));
|
|
||||||
}
|
|
||||||
row.append("</tbody>");
|
row.append("</tbody>");
|
||||||
$("#cluster_table").append(row);
|
$("#cluster_table").append(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function appendClusterTable(row, attrib){
|
||||||
|
row.append("</tbody>");
|
||||||
|
row.append("<tr>");
|
||||||
|
row.append("<td>" + attrib + "</td>");
|
||||||
|
for (x in cluster_result){
|
||||||
|
row.append($("<td>" + cluster_result[x][attrib] +"</td>"));
|
||||||
|
}
|
||||||
|
row.append("</tr>");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue