JavaScript
$("#myConta").height(window.innerHeight - (window.innerHeight / 40));
var width = window.innerWidth - (window.innerWidth / 10),
height = window.innerHeight - (window.innerHeight / 10),
boxW = width / 4,
boxH = height / 4,
boxSize = boxW + boxH,
xPos1 = 0,
xPos2 = boxW,
xPos3 = boxW * 2,
xPos4 = boxW * 3,
yPos1 = 0,
yPos2 = boxH,
yPos3 = boxH * 2,
yPos4 = boxH * 3;
var CreateRect = function (x, y, boxColor) {
svgContainer.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", boxW)
.attr("height", boxH)
.attr("fill", boxColor)
.attr("class", "hover_group");
};
var CreateRectWithLength = function (x, y, w, h, boxColor) {
svgContainer.append("rect")
.attr("x", x)
.attr("y", y)
.attr("width", w)
.attr("height", h)
.attr("fill", boxColor);
};
var CreateText = function(x, y, text, textColor) {
svgContainer.append("text")
.attr("x", x)
.attr("y", y)
.attr("stroke", textColor)
.text(text);
};
var CreateTextInMain = function(x, y, text, textColor) {
$("#myConta").append("div")
.attr("x", x)
.attr("y", y)
.attr("stroke", textColor)
.text(text);
};
var svgContainer = d3.select("#myConta")
.append("svg")
.attr("id", "myContasvg")
.attr("width", width)
.attr("height", height)
.attr("fill", "#2E2E2E")
.attr("float", "right")
.append("g");
CreateRect(xPos1, yPos1, "#C0FC3E");
CreateRect(xPos1, yPos2, "#60FC60");
CreateRect(xPos1, yPos3, "#64FE2E");
CreateRect(xPos1, yPos4, "#00FF00");
CreateRect(xPos2, yPos1, "#F6FF33");
CreateRect(xPos2, yPos2, "#AFFC3B");
CreateRect(xPos2, yPos3, "#00FF00");
CreateRect(xPos2, yPos4, "#64FE2E");
CreateRect(xPos3, yPos1, "#FDB500");
CreateRect(xPos3, yPos2, "#8DB723");
CreateRect(xPos3, yPos3, "#AFFC3B");
CreateRect(xPos3, yPos4, "#60FC60");
CreateRect(xPos4, yPos1,...