As it displays as 100% but the bars is not fully colored.
The bar should be fully colored when its 100% the x1 is not equal to x2
Can anyone give me a solution for if the bar is 100% the bar should be fully colored. Thanks in advance
Image
Code
.on('draw', function (data) {
if (data.type === 'bar') {
var elem = data.element._node;
var $line = $(elem).clone();
$(elem).after($line.attr("class", "ct-bar ct-bar-bg").attr("x1", $(elem).attr("x2")).attr("x2", $(chart).width()));
}
if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {
if (!chart.supportsForeignObject) {
if (data.type === 'bar') {
barStart = data.x1;
}
if (data.type === 'label' && data.axis.units.pos === 'y') {
label = $(data.element._node);
labelText = label.text();
labelWidth = label.text().length * 6;
labelHeight = label.attr("height");
labelX = 0;
labelY = data.y - (data.height / 2) + 5
if (labelWidth > barStart - 20) {
var line = BraxtonPeformax.Application.WordWrap(labelText, 19);
label.text(line[0]);
if (line[1]) {
data.group.elem('text', {
x: labelX,
y: labelY + 12,
}, 'ct-label').text(line[1]);
}
data.element.attr({
x: 0,
y: data.y - (data.height / 2) + 5,
height: labelHeight * 2
});
} else {
data.element.attr({
x: 0,
y: data.y - (data.height / 2) + 5
});
}
}
}
}
});