D3 chart bar color

Answered

Hello,
Could you add the feature for D3 Bar color and label text to get them with function?
In 2.4 version I did it by myself. In 2.5. I cannot fount the line to do this.
 
C8.selectAll(“rect”).data(function(f) {
return f.Wf;
}).enter().append(“rect”).attr(“class”, “fm-bar”).attr(“x”, function(f) {
return z8(f.id);
}).attr(“width”, n8).attr(“y”, function(f) {
return 0 < f.value ? Math.floor(100 * c(f.value)) / 100 : Math.floor(100 * c(s8)) / 100;
}).attr(“height”, function(f) {
return Math.floor(100 * Math.abs(c(s8) – c(f.value))) / 100;
}).style(“fill”, function(f, p2, itemId) {
return getBarChartFillColor(f, dataMap[itemId], itemId);//MB IDEALITAS
//return u.X(f.hj) ? E(f.id) : E(f.hj);
}).append(“title”)
.text(function(f) {
return f.ve;
});
 
C8.selectAll(“.text”)
.data(function (f) {
return f.Wf;
})
.enter()
.append(“text”)
.attr(“class”, “label”)
.attr(“x”, (function (f, p2, itemId) {
var ChVal = (f.value * ChBars) / maxYval;
return ChVal;// ( ChVal*(1.0 – (itemId * 0.009)));
}))
.attr(“dy”, “.75em”)
.attr(“style”, function (f, p2, itemId) {
return “font-size: 10; font-family: Helvetica, sans-serif;”;
})
.attr(“fill”, function (f, p2, itemId) {
return “black”;
})
.text(function (f, p2, itemId) {
return getBarChartLabelText(f, dataMap[itemId], itemId);//MB IDEALITAS
});
 
Thank you

2 answers

Public
Dmytro Zvazhii Flexmonster May 29, 2018

Hello Ralys,
Thank you for your feedback and detailed explanation. Our dev team will add such feature in the nearest versions ETA Jul02.
Regards,
Dmytro

Public
Ralys May 30, 2018

Thank you

Please login or Register to Submit Answer