<!DOCTYPE html>
<meta charset="utf-8">
<!-- For Dimensions & drag n drop functionality-->
<script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script src="https://canvasjs.com/assets/script/jquery.canvasjs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/jszip.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js"></script>
<!-- SYNCFUSION LIBRARIES -->
<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js" type="text/javascript"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
<!-- BOOTSTRAP LIBRARIES -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- D3 CHART LIBRARIES -->
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
}
.modal-content {
background-color: #fefefe;
margin-left: 743px;
padding: 9px;
border: 1px solid #888;
width: 22%;
margin-top: 192px;
}
</style>
<script>
var RowID = "";
function PopUp(rowId) {
debugger
$("#myModal").show();
var innerDiv = document.createElement('div');
innerDiv.id = rowId;
RowID = rowId;
innerDiv.className = 'modal-content';
$("#myModal").appendChild(innerDiv);
innerDiv.innerHTML = "Remove";
}
function Remove()
{
debugger;
$('#div2').text(RowID).empty();
$("#myModal").hide();
$("#dvTable").show();
$("#dvColumn").hide();
}
$(document).ready(function () {
debugger
var modal = document.getElementById('myModal');
window.onclick = function (event) {
if (event.target == modal) {
debugger
$("#myModal").hide();
}
}
});
</script>
<!-- CSS for D3 chart -->
<style>
.pieTooltip {
background: #eee;
box-shadow: 0 0 5px #999999;
color: #333;
font-size: 12px;
left: 130px;
padding: 10px;
position: absolute;
text-align: center;
top: 95px;
width: 80px;
z-index: 10;
display: block;
opacity: 0;
}
.legend {
font-size: 12px;
}
rect {
cursor: pointer; /* NEW */
stroke-width: 2;
}
rect.disabled { /* NEW */
fill: transparent !important; /* NEW */
}
body {
background-color: #F1F3F3;
}
.axis {
font: 15px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: #D4D8DA;
stroke-width: 1px;
shape-rendering: crispEdges;
}
.barToolTip {
position: absolute;
display: none;
min-width: 80px;
height: auto;
background: none repeat scroll 0 0 #ffffff;
border: 1px solid #6F257F;
padding: 14px;
text-align: center;
}
</style>
<!-- CSS for drag n drop functionality -->
<style type="text/css">
.txt {
width: 50%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
}
.auto-style1 {
width: 100%;
border: solid;
border-color: black;
}
.auto-style2 {
width: 366px;
}
.auto-style3 {
width: 78px;
}
#div1 {
float: left;
width: 200px;
height: 300px;
margin: 10px;
padding: 10px;
border: 1px solid black;
}
#div2 {
float: left;
width: 500px;
height: 30px;
margin: 10px;
padding: 10px;
border: 1px solid black;
}
#div3 {
float: left;
width: 200px;
height: 300px;
margin: 10px;
padding: 10px;
border: 1px solid black;
}
#div4 {
float: left;
width: 500px;
height: 30px;
margin: 10px;
padding: 10px;
border: 1px solid black;
}
.auto-style4 {
width: 366px;
font-size: xx-large;
}
.mt10 {
margin-top: 10px;
}
.mb10 {
margin-bottom: 10px;
}
</style>
<!-- Script for Excel file browse functionality -->
<script>
function isJSON(something) {
if (typeof something != 'string')
something = JSON.stringify(something);
try {
JSON.parse(something);
return true;
} catch (e) {
return false;
}
}
var ExcelToJSON = function () {
this.parseExcel = function (file) {
var reader = new FileReader();
reader.onload = function (e) {
var data = e.target.result;
var workbook = XLSX.read(data, {
type: 'binary'
});
handleFileSelect1();
workbook.SheetNames.forEach(function (sheetName) {
var XL_row_object = XLSX.utils.sheet_to_row_object_array(workbook.Sheets[sheetName]);
var x = XL_row_object[0];
var json_object1 = JSON.stringify(XL_row_object);
var i = 1;
$.each(x, function (key, val) {
if (isNaN(val)) {
debugger
var rowId="empid"+i;
var row = '<tr draggable="true" ondragstart="drag(event)" id="empid' + i + '" ><td> ' + key + ' </td></tr>' + '<br>'
$("tr").click(function () {
var table = this.id;
});
$("#tblDimensions").append(row);
i = i + 1;
} else {
var row = '<tr draggable="true" onClick="OpenMeasurePopUp();" ondragstart="drag(event)" id="empid' + i + '" ><td> ' + key + ' </td></tr>' + '<br>'
$("#tblMeasures").append(row);
i = i + 1;
}
});
$('input[id=hdJson]').val(json_object1);
BindTable(XL_row_object);
})
};
reader.onerror = function (ex) {
console.log(ex);
};
reader.readAsBinaryString(file);
};
};
function handleFileSelect(evt) {
var files = evt.target.files;
$('input[id=GetColPushValue]').val(files);
var xl2json = new ExcelToJSON();
xl2json.parseExcel(files[0]);
}
function handleFileSelect1() {
var CalFieldName;
var name = $("#Text1").val();
var prevValue = $('input[id=hdJson]').val();
if (prevValue == "" || prevValue == null) {
}
else {
var originalValue = $("#hdJson").val();
var p = [];
var json1 = JSON.parse(originalValue);
let newinfo = json1.map(function (person) {
var arr = [];
$.each(json1, function (key1, value) {
$.each(value, function (k, v) {
CalFieldName = $("#txtCalculatedHeader").val();
CalMeasure = $("#txtMeasure").val();
var col = $("#txtCalculationOn").val();// Passing here calculated name like (Name,Address etc.) field
var row = $("#txtMeasureValue").val();// Passing here calculated name like (Amount etc.) field
if (col == k) {
arr.push({ [CalFieldName]: v });
}
if (row == k) {
arr.push({ [CalMeasure]: v });
}
});
});
p = Array.from(arr);
});
var x = p[0];
var i;
var rowCount = $('#tblDimensions tr').length;
if (rowCount == "" || rowCount == null) {
i = 1;
}
else {
i = rowCount + 1;
}
$.each(p[0], function (key, val) {
if (isNaN(val)) {
var keyType = "";
var selected = "";
if (key = CalFieldName) {
key = $("#txtCalculatedHeader").val();
selected = $('select#dllDimensionsType option:selected').val();
}
if (selected == "Upper") {
var row = '<tr draggable="true" ondragstart="drag(event)" id="' + selected + i + '"><td> ' + key + ' </td></tr>' + '<br>';
}
else if (selected == "Lower") {
var row = '<tr draggable="true" ondragstart="drag(event)" id="' + selected + i + '"><td> ' + key + ' </td></tr>' + '<br>';
}
$("tr").click(function () {
var table = this.id;
});
$("#tblDimensions").append(row);
i = i + 1;
}
else {
var keyType = "";
var selected1 = "";
if (key == CalMeasure) {
key = $("#txtMeasure").val();
selected1 = $('select#ddlMeasuresType option:selected').val();
}
if (selected1 == "Count") {
var row = '<tr draggable="true" ondragstart="drag(event)" id="' + selected1 + i + '"><td> ' + key + ' </td></tr>' + '<br>';
}
$("tr").click(function () {
var table = this.id;
});
$("#tblMeasures").append(row);
i = i + 1;
}
});
var obj = JSON.parse(originalValue);
let newinfo1 = obj.map(function (person) {
$.each(person, function (key, val) {
CalFieldName = $("#txtCalculatedHeader").val();
CalMeasure = $("#txtMeasure").val();
var col = $("#txtCalculationOn").val();// Passing here calculated name like (Name,Address etc.) field
var row = $("#txtMeasureValue").val();// Passing here calculated name like (Amount etc.) field
if (col == key) {
return addKeyValue(person, CalFieldName, val);
}
if (row == key) {
return addKeyValue(person, CalMeasure, val);
}
});
});
var json_object1 = JSON.stringify(obj);
$('input[id=hdJson]').val(json_object1);
$('#myModalDimension').modal('hide');
$('#myModalMeasure').modal('hide');
$("#txtCalculatedHeader").val('').innerText;
$("#txtCalculationOn").val('').innerText;
$('#ddlFunctionType').change(function () {
$('#ddlFunctionType').prop('selectedIndex', 0).innerText;
});
}
}
function addKeyValue(obj, key, data) {
obj[key] = data;
}
</script>
<!-- Script for drag n drop functionality -->
<script>
var arrPush = [];
//This code for upper two div (dimnesions & column)
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
for (var i = arrPush.length; i > 0; i--) {
arrPush.pop();
}
var div2Value = $("#div2").text().trim();
var div4Value = $("#div4").text().trim();
var t;
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
debugger;
if (div2Value == null || div2Value == "" && ev.path[0].id != "div1") {
debugger;
var something = ev.target.appendChild(document.getElementById(data).cloneNode(true));
var txt = something.innerText.trim();
$("#div2").append(something);
$("#div2 tr").on('click', function () {
debugger
PopUp(txt);
});
}
else if (div2Value == null || div2Value == "" && ev.path[0].id == "div1") {
ev.target.appendChild(document.getElementById(data));
}
else {
ev.target.appendChild(document.getElementById(data).cloneNode(false));
$("#div2").empty();
}
var hdColumnVal = ev.target.innerText.trim();
$('input[id=hdColumnValue]').val(hdColumnVal);
var type = data.substring(0, 5);
if (div2Value == "" && div4Value == "" && ev.path[0].id != "div1") {
getValueByColumn(hdColumnVal);
$("#dvTable").hide();
$("#dvColumn").show();
$("#barchart").hide();
$("#piechart").hide();
$("#typeSelect").show();
}
else if (div2Value == "" && div4Value == "" && ev.path[0].id == "div1") {
GetValueByDimensions(hdColumnVal, div4Value);
$("#dvTable").show();
$("#dvColumn").hide();
$("#barchart").hide();
$("#piechart").hide();
$("#typeSelect").show();
}
else if (div2Value == "" && div4Value != "") {
GetValueByDimensions(hdColumnVal, div4Value);
$("#dvTable").hide();
$("#dvColumn").hide();
$("#barchart").show();
$("#piechart").hide();
$("#typeSelect").show();
}
else if (div2Value != "" && div4Value == "") {
GetValueByDimensions(hdColumnVal, div4Value);
$("#dvTable").show();
$("#dvColumn").hide();
$("#barchart").hide();
$("#piechart").hide();
$("#typeSelect").show();
}
else if (div2Value != "" && div4Value != "") {
getValueByColumn(div4Value);
$("#dvTable").hide();
$("#dvColumn").show();
$("#barchart").hide();
$("#piechart").hide();
$("#typeSelect").show();
}
}
//Display column records(by drag n drop dimensions)
function getValueByColumn(text) {
var p = [];
var v = $("#hdJson").val();
var json = JSON.parse(v);
var dim = [];
$.each(json, function (key1, value) {
$.each(value, function (k, v) {
var col = text;
if (col == k) {
dim.push({ [text]: v });
}
});
p = Array.from(dim);
});
if (p.length > 0) {
BindColumn(p);
$("#dvTable").hide();
$("#dvColumn").show();
}
else {
$("#dvTable").show();
$("#dvColumn").hide();
}
}
//This code for lower two div (measures & row)
function allowDrop1(ev1) {
ev1.preventDefault();
}
function drag1(ev1) {
ev1.dataTransfer.setData("text", ev1.target.id);
}
function drop1(ev1) {
debugger
for (var i = arrPush.length; i > 0; i--) {
arrPush.pop();
}
var div2Value = $("#div2").text().trim();
var div4Value = $("#div4").text().trim();
ev1.preventDefault();
var data = ev1.dataTransfer.getData("text");
debugger
if (div4Value == null || div4Value == "" && ev1.path[0].id != "div3") {
ev1.target.appendChild(document.getElementById(data).cloneNode(true));
}
else if (div4Value == null || div4Value == "" && ev1.path[0].id == "div3") {
ev1.target.appendChild(document.getElementById(data));
}
else {
ev1.target.appendChild(document.getElementById(data).cloneNode(false));
$("#div4").empty();
}
var rowVal = ev1.target.innerText.trim();
var hdColumnVal = $("#hdColumnValue").val().trim();
var hdRow = $("#hdRow").val(rowVal);
var type = data.substring(0, 5);
if (div2Value == "" && rowVal != null) {
getValueByRow(rowVal);
}
else {
var currentID = ev1.currentTarget.id;
if (currentID == "div4") {
GetValueByDimensions(hdColumnVal, rowVal);
$("#dvTable").hide();
$("#dvColumn").hide();
$("#typeSelect").show();
}
if (currentID == "div3") {
getValueByColumn(hdColumnVal);
$("#dvTable").hide();
$("#dvColumn").show();
$("#barchart").hide();
$("#piechart").hide();
$("#typeSelect").show();
}
if (div2Value == "" || div2Value == null) {
GetValueByDimensions(hdColumnVal, rowVal);
$("#dvTable").hide();
$("#dvColumn").show();
$("#typeSelect").show();
}
}
}
//Display row records(by drag n drop measures)
function getValueByRow(text) {
var p = [];
var v = $("#hdJson").val();
var json = JSON.parse(v);
var dim = [];
$.each(json, function (key1, value) {
$.each(value, function (k, v) {
var col = text;
if (col == k) {
dim.push({ [col]: v });
}
});
p = Array.from(dim);
});
var kk = p;
var qty = $('#div4 tr td').text(text);
if (qty.length > 0) {
BindColumn(p);
$("#dvTable").hide();
$("#dvColumn").show();
}
else {
$("#dvTable").show();
$("#dvColumn").hide();
}
}
//Get column & row values in array
function GetValueByDimensions(hdColumnVal, rowVal) {
{
var v = $("#hdJson").val();
var json = JSON.parse(v);
var dim = [];
var measure = [];
$.each(json, function (key1, value) {
$.each(value, function (k, v) {
var col = hdColumnVal;
if (col == k) {
dim.push(v);
}
else if (rowVal == k) {
measure.push(v);
}
});
});
//For Dimensions
var AX = $.map(dim, function (value, index) {
var divColumnValue = hdColumnVal;
//var type = t;
if (type == "Upper") {
return [{ id: index, divColumnValue: value.toUpperCase() }];
}
else if (type == "Lower") {
return [{ id: index, divColumnValue: value.toLowerCase() }];
}
else {
return [{ id: index, divColumnValue: value }];
}
var type = null;
});
//For Measures
var AY = $.map(measure, function (value, index) {
var divRowValue = rowVal;
return [{ id: index, divRowValue: value }];
});
var res = AX.map(x => Object.assign(x, AY.find(y => y.id == x.id)))
$.each(res, function (index, obj) {
var bind = { x: res[index].divColumnValue, value: res[index].divRowValue };
arrPush.push(bind);
});
if ($("#div4").find('td').text().trim() == "" || $("#div4").find('td').text().trim() == null) {
$("#dvExportMenu").hide();
$("#typeSelect").hide();
$('#dvTable').hide();
$('#dvColumn').show();
}
else {
barChart(arrPush);
$("#barchart").show();
$("#piechart").hide();
$('#dvTable').hide();
$('#dvColumn').hide();
$("#typeSelect").show();
}
}
}
//bar chart
function barChart(arrPush) {
debugger
d3.selectAll("g > *").remove();
var svg = d3.select("#barchart svg"),
margin = { top: 20, right: 20, bottom: 30, left: 50 },
width = +svg.attr("width") - margin.left - margin.right,
height = +svg.attr("height") - margin.top - margin.bottom;
var barToolTip = d3.select("body").append("div").attr("class", "barToolTip");
var x = d3.scaleBand().rangeRound([0, width]).padding(0.1),
y = d3.scaleLinear().rangeRound([height, 0]);
var colours = d3.scaleOrdinal().range(["steelblue"]);
var g = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var data = arrPush;//Array data
x.domain(data.map(function (d) { return d.x; }));
y.domain([0, d3.max(data, function (d) { return d.value; })]);
g.append("g").attr("class", "axis axis--x").attr("transform", "translate(0," + height + ")").call(d3.axisBottom(x));
g.append("g").attr("class", "axis axis--y").call(d3.axisLeft(y).ticks(5).tickFormat(function (d) { return parseInt(d); }).tickSizeInner([-width])).append("text").attr("transform", "rotate(-90)").attr("y", 6).attr("dy", "0.71em").attr("text-anchor", "end").attr("fill", "#5D6971").text("Average " + "(£) " + $("#hdRow").val());
g.selectAll(".bar").data(data).enter().append("rect").attr("x", function (d) { return x(d.x); }).attr("y", function (d) { return y(d.value); })
.attr("width", x.bandwidth())
.attr("height", function (d) { return height - y(d.value); })
.attr("fill", function (d) { return colours(d.x); })
.on("mousemove", function (d) {
barToolTip
.style("left", d3.event.pageX - 50 + "px")
.style("top", d3.event.pageY - 70 + "px")
.style("display", "inline-block")
.html((d.x) + "<br>" + "£" + (d.value));
}).on("mouseout", function (d) { barToolTip.style("display", "none"); });
}
//pie chart
function pieChart(arrPush) {
d3.selectAll("g > *").remove();
var dataset = arrPush;//Array data
var colorScheme = ["#E57373", "#BA68C8", "#7986CB", "#A1887F", "#90A4AE", "#AED581", "#9575CD", "#FF8A65", "#4DB6AC", "#FFF176", "#64B5F6", "#00E676"];
var margin = { top: 50, bottom: 50, left: 50, right: 50 };
var width = 500 - margin.left - margin.right,
height = width,
radius = Math.min(width, height) / 2;
var donutWidth = 75;
var legendRectSize = 18;
var legendSpacing = 4;
dataset.forEach(function (item) {
item.enabled = true;
});
var color = d3.scaleOrdinal().range(["#E57373", "#BA68C8", "#7986CB", "#A1887F", "#90A4AE", "#AED581", "#9575CD", "#FF8A65", "#4DB6AC", "#FFF176", "#64B5F6", "#00E676"]);
var svg = d3.select("#piechart")
.append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
var arc = d3.arc().outerRadius(radius - 10).innerRadius(radius - donutWidth);
var pie = d3.pie().sort(null).value(function (d) { return d.value; });
var pieTooltip = d3.select("#piechart").append('div').attr('class', 'pieTooltip');
pieTooltip.append('div').attr('class', 'x');
pieTooltip.append('div').attr('class', 'count');
pieTooltip.append('div').attr('class', 'percent');
var path = svg.selectAll('path').data(pie(dataset)).enter().append('path').attr('d', arc).attr('fill', function (d, i) {
return color(d.data.x);
}).each(function (d) { this._current = d; });
path.on('mouseover', function (d) {
var total = d3.sum(dataset.map(function (d) {
return (d.enabled) ? d.value : 0;
}));
var percent = Math.round(1000 * d.data.value / total) / 10;
pieTooltip.select('.x').html(d.data.x.toUpperCase()).style('color', 'black');
pieTooltip.select('.count').html(d.data.value);
pieTooltip.select('.percent').html(percent + '%');
pieTooltip.style('display', 'block');
pieTooltip.style('opacity', 2);
});
path.on('mousemove', function (d) {
pieTooltip.style('top', (d3.event.layerY + 10) + 'px').style('left', (d3.event.layerX - 25) + 'px');
});
path.on('mouseout', function () {
pieTooltip.style('display', 'none');
pieTooltip.style('opacity', 0);
});
var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) {
var height = legendRectSize + legendSpacing;
var offset = height * color.domain().length / 2;
var horz = -2 * legendRectSize;
var vert = i * height - offset;
return 'translate(' + horz + ',' + vert + ')';
});
legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color).on('click', function (x) {
var rect = d3.select(this);
var enabled = true;
var totalEnabled = d3.sum(dataset.map(function (d) {
return (d.enabled) ? 1 : 0;
}));
if (rect.attr('class') === 'disabled') {
rect.attr('class', '');
} else {
if (totalEnabled < 2) return;
rect.attr('class', 'disabled');
enabled = false;
}
pie.value(function (d) {
if (d.label === label) d.enabled = enabled;
return (d.enabled) ? d.value : 0;
});
path = path.data(pie(dataset));
path.transition().duration(750).attrTween('d', function (d) {
var interpolate = d3.interpolate(this._current, d);
this._current = interpolate(0);
return function (t) {
return arc(interpolate(t));
};
});
});
legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) { return d; })
};
//Chart selection by dropdown.
function switchType() {
var select = document.getElementById("typeSelect").value;
if (select == "pie") {
$("#piechart").empty();
$("#barchart").hide();
$('#dvTable').hide();
$('#dvColumn').hide();
pieChart(arrPush);
$("#piechart").show();
$("#typeSelect").show();
}
else if (select == "bar") {
barChart(arrPush);
$("#barchart").show();
$("#piechart").hide();
$('#dvTable').hide();
$('#dvColumn').hide();
$("#typeSelect").show();
}
}
//Bind table when browse excel.
function BindTable(XL_row_object) {
var col = [];
for (var key in XL_row_object[0]) {
col.push(key);
}
$('#dvTable').empty();
var grid = new ej.grids.Grid({
dataSource: XL_row_object,
allowSorting: true,
allowPaging: true,
allowFiltering: true,
filterSettings: { type: 'Excel' },
allowResizing: true,
allowScrolling: true,
commonWidth: 100,
height: 200,
pageSettings: { pageSize: 8, pageCount: 3, pageSizes: [10, 20, 50, 100] },
columns: col,
});
grid.appendTo('#dvTable');
}
//Bind table accroding to column & row (dimesnions & measures).
function BindColumn(XL_row_object) {
var col = [];
for (var key in XL_row_object[0]) {
col.push(key);
}
$('#dvColumn').empty();
var grid = new ej.grids.Grid({
dataSource: XL_row_object,
allowSorting: true,
allowPaging: true,
allowFiltering: true,
filterSettings: { type: 'Excel' },
allowResizing: true,
allowScrolling: true,
commonWidth: 100,
height: 200,
pageSettings: { pageSize: 8, pageCount: 3, pageSizes: [10, 20, 50, 100] },
columns: col,
});
grid.appendTo('#dvColumn');
}
</script>
<form enctype="multipart/form-data">
<input type="hidden" id="hdGetArrayValue" value="" />
<input type="hidden" id="hdRow" value="" />
<input type="hidden" id="GetColPushValue" value="" />
<input type="hidden" id="GetArray" value="" />
<input type="hidden" id="hdColumnValue" value="" />
<input type="hidden" id="hd" value="" />
<input id="upload" type="file" name="files[]">
<div id="storeInformation">
<input type="hidden" id="hdJson" value="" />
</div>
<div id="myModal" class="modal">
<div class="modal-content" onclick="Remove();">
Remove
</div>
</div>
<table class="auto-style1">
<tr>
<td class="auto-style4">
<strong>Tableau System</strong>
</td>
<td class="auto-style3">
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
</td>
<td class="auto-style3">
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
<span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 700; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Dimensions</span>
</td>
<td class="auto-style3">
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)" style="overflow-y: scroll" class="component">
<table id="tblDimensions">
<tbody></tbody>
</table>
</div>
</td>
<td class="auto-style3">
Columns
</td>
<td>
<div id="div2" ondrop="drop(event)" ondragover="allowDrop(event)" height="53px" width="640px" class="ui-layout-center">
</div>
</td>
</tr>
<tr>
<td class="auto-style2">
<span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 700; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Measures</span>
</td>
<td class="auto-style3">
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
<div id="div3" ondrop="drop1(event)" ondragover="allowDrop1(event)" style="overflow-y: scroll">
<table id="tblMeasures">
<tbody></tbody>
</table>
</div>
</td>
<td class="auto-style3">
Rows
</td>
<td>
<div id="div4" ondrop="drop1(event)" ondragover="allowDrop1(event)" height="53px"
width="640px">
</div>
</td>
</tr>
<tr>
<td class="auto-style2">
<div id="dvTable">
</div>
<div id="dvColumn">
</div>
</td>
<td class="auto-style2">
<select id="typeSelect" onchange="switchType()">
<option value="bar">Bar</option>
<option value="line">Line</option>
<option value="pie">Pie</option>
</select>
<div id="barchart">
<svg width="960" height="500"></svg>
</div>
<div id="piechart">
<svg width="960" height="500"></svg>
</div>
<!--<div id="chartContainer" style="height: 370px; width: 250%;">
</div>-->
<div id="dvExportMenu" class="pull-right" style="display: none">
<input id="btnPDF" type="button" value="Download as PDF" onclick="MyChartpdf()" />
<input id="btnXLSX" type="button" value="Download as XLS" onclick="MyChartXlsx()" />
</div>
</td>
</tr>
</table>
</form>
<!-- Modal Dimension -->
<div class="modal fade" id="myModalDimension" tabindex="-1" role="dialog" aria-labelledby="myModalDimensionCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<!--<div class="modal-header">
<h5 class="modal-title" id="myModalDimensionLongTitle">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>-->
<div class="modal-body">
Calculated Field : <input type="text" id="txtCalculatedHeader" class="form-control">
Calculation On : <input type="text" id="txtCalculationOn" class="form-control mt10"><br />
Functions :
<select id="dllDimensionsType" class="form-control mt10">
<option selected="selected">Select</option>
<option value="Upper">Upper</option>
<option value="Lower">Lower</option>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="Button1" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<!-- Modal Measure -->
<div class="modal fade" id="myModalMeasure" tabindex="-1" role="dialog" aria-labelledby="myModalMeasureCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<!--<div class="modal-header">
<h5 class="modal-title" id="myModalMeasureLongTitle">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>-->
<div class="modal-body">
Calculated Field : <input type="text" id="txtMeasure" class="form-control">
Calculation On : <input type="text" id="txtMeasureValue" class="form-control mt10"><br />
Functions :
<select id="ddlMeasuresType" class="form-control mt10">
<option selected="selected">Select</option>
<option value="Count">Count</option>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="Button2" class="btn btn-primary">Save</button>
</div>
</div>
</div>
</div>
<script>
document.getElementById('upload').addEventListener('change', handleFileSelect, false);
document.getElementById('Button1').addEventListener('click', handleFileSelect1, false);
document.getElementById('Button2').addEventListener('click', handleFileSelect1, false);
</script>