DataLabels rotation for treemap
When sliceanddice in treemap, boxes may be taller than wide and datalabel may be larger than boxe.
Here is a small modification that rotates datalabels in this case
drawDataLabels: function () {
var series = this,
points = series.points,
options,
level,
dataLabelsGroup = this.dataLabelsGroup,
dataLabels;
each(points, function (point) {
if (point.node.isVisible) {
level = series.levelMap[point.level];
if (!point.isLeaf || level) {
options = undefined;
// If not a leaf, then label should be disabled as default
if (!point.isLeaf) {
options = {enabled: false};
}
if (level) {
dataLabels = level.dataLabels;
if (dataLabels) {
options = merge(options, dataLabels);
series._hasPointLabels = true;
options
}
}
options = merge(options, point.options.dataLabels);
point.dlOptions = options;
} else {
if((point.shapeArgs.height/point.shapeArgs.width) > 1) { //MMK Modif pour gestion orientation text quand hauteur > largeur
point.dlOptions = {rotation:-90,align:"center"}; //MMK Modif rotation text et centrage
} else { //MMK Modif
delete point.dlOptions; //Ligne strandard
} //MMK Modif
}
}
});
this.dataLabelsGroup = this.group;
Series.prototype.drawDataLabels.call(this);
this.dataLabelsGroup = dataLabelsGroup;
},