on 2019 Dec 17 7:11 AM
Hello everyone,
I'm looking for a way to hide 1 legend item of the legend group
i know how to hide/display the legend group but i just need to hide 1 of the legend item from this legend group.
eg my chart would display legend group listing legend_item_1, legend_item_2 and legend_item_3.
in my scenario i want to display only the 1st 2 legend items: legend_item_1 and legend_item_2
I'm wondering if there would be a way to build something using rules eg (pseudo code) if legend_item.value = "i want to hide this one" then legend_item.visible = false;
Thanks
Maybe a better solution exists.
For now I'm simply moving the last legend item away from the legend area so it is now hidden behind a table
this.getChart().attachRenderComplete(function(oEvent){
var oVizFrameID = oEvent.getSource().getId();
var oLegendItems = $('#'+oVizFrameID).find('.v-legend-item');
for(var i=0;i<oLegendItems.length;i++){
if (i === (oLegendItems.length - 1)) {
var oAttribute = "translate (" + 500 + "," + 22 + ")";
oLegendItems[i].setAttribute("transform", oAttribute);
}
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.