Pentaho

 View Only

 CTools - hiding data values on specific Series only (in a 100% Stacked Bar Chart)

Josh White's profile image
Josh White posted 05-20-2022 01:40
Hi guys I have a 100% Stacked Bar Chart in CTools (Pentaho 9.2), which I am using a bit like a "progress bar" - see attachment - there are only 2 Series - "Complete" and "Open".

I want to only show the data value % in the bar segments for the "Complete" Series - effectively so we only see the % Complete in the green section.

Can anyone give me pointers on how to achieve this? I have played about endlessley with callback functions in the barLabel_visible extension points, and tried Post Execution functiopns to look through this.chart.data._datums and clear out the label where the series = "Open" but I can;t get anything to work - I'm definitely lacking knowledge on the structure of the bar charts and how to get to the parts I need.

Any tips appreciated!
Attachment  View in library
Capture.PNG 15 KB
Josh White's profile image
Josh White
I figured it out!
In Extension Points I added the following function for "barLabel_visible"

function() { return (this.scene.getSeries()=="Complete" && this.scene.getValue()!=0) }