Xin trợ giúp main.js

Mình có một tệp main.js, trong đó có một đoạn để build text với thuộc tính như sau:
if (addColorLabels) {
const txt = document.createElementNS(xmlns, "text");
txt.setAttribute("font-family", "Tahoma");
const nrOfDigits = (f.color + "").length;
txt.setAttribute("font-size", (fontSize / nrOfDigits) + "");
txt.setAttribute("dominant-baseline", "middle");
txt.setAttribute("text-anchor", "middle");
txt.setAttribute("fill", fontColor);
txt.textContent = f.color + "";
const subsvg = document.createElementNS(xmlns, "svg");
subsvg.setAttribute("width", f.labelBounds.width * sizeMultiplier + "");
subsvg.setAttribute("height", f.labelBounds.height * sizeMultiplier + "");
subsvg.setAttribute("overflow", "visible");
subsvg.setAttribute("viewBox", "-50 -50 100 100");
subsvg.setAttribute("preserveAspectRatio", "xMidYMid meet");
subsvg.appendChild(txt);
const g = document.createElementNS(xmlns, "g");
g.setAttribute("class", "label");
g.setAttribute("transform", "translate(" + f.labelBounds.minX * sizeMultiplier + "," + f.labelBounds.minY * sizeMultiplier + ")");
g.appendChild(subsvg);
svg.appendChild(g);
}
if (count % 100 === 0) {
yield common_7.delay(0);
if (onUpdate != null) {
onUpdate(f.id / facetResult.facets.length);
}
}

Mình muốn thêm thuộc tính để giới hạn font size lớn nhất cho label, xin các chuyên gia chỉ giúp, Trân trọng cảm ơn!
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Hỗ trợ trực tuyến

Support Quảng cáo
Mr. San (PVS)

Skype chat, instant message

Mr. Tuấn (Blue)

Skype chat, instant message

Mr. Tuấn
0988 488 096
Mr. Trọng
0906 081 284
kinhdoanh@vnxf.vn

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Điện Lạnh Thịnh Phát
Top