Creating Sunburst Graph using a Linear data structure in VBCS (Part 2)
In previous blog we converted linear data into a tree and stored the same in an ATP variable, in this blog we will create the necessary ui component for the same .
- Drag and Drop a Sunburst component to UI and assign the created ATP as DataSource to it
- You may now see an all-black Sunburst Chart, this is because we haven’t yet added color to each node, to correct this we will create a function which will generate random colors by using ojs/ojattributegrouphandler libraries
- Write below JS function to generate random colors
- Add nodeTemplate to Sunburst chart to invoke random color generator function
- Now we can see random colors being displayed for Sunburst nodes
- Now we need to create another function which will be triggered on hover and show tooltip for the hovered content.
- Create below function which will generate a description based on the label and value of the node
- Call the same inside nodeTemplate of Sunburst chart
- Now run the application and on hover we can see the Short Description
Comments
Post a Comment