Carrier Dashboard
Setting CGG Chart values with postFetch ..
Dashboard vs. Export Visualization:
You can create different versions of chart visualizations for dashboard display versus export by using conditional code blocks in the postFetch function. The code checks for the presence of the CGG object to determine the context - if CGG is undefined, the code runs in the dashboard, otherwise it runs during export.
Handling Parameters in Exports:
Since CGG export scripts can't directly access CDE parameters or CDF functions like Dashboards.getParameterValue, you can pass these values through query parameters. This allows you to maintain rendering options based on parameter values during export. To implement this, add the parameter to the component parameters by either setting the 'arg' and 'value' properties directly, or by configuring them in the preExecution function.
For example, to append a date parameter value to a chart title, you would set:
arg: '_date' value: 'dateParam'
in the component Parameters property, or by doing the same but in preExecution function, using the following code:
Edit: /Public/CTools Dashboard/Carrier-Dashboard-Expand/Layout ( providing you've completed all the workshops..!)
In the Components pane, click to expand the Charts group, and then click to select the lineChart.
Click Advanced Properties.
Specify the postFetch function
• Click the ellipsis icon to the right of the postFetch property.
Copy & paste the following:
Save the dashboard.
Check the visualization differences between the lineChart component displayed in the dashboard and the exported chart image:
• Click on the Number of Calls vs Number of Users Export link.
• Click on the Export PNG popup option.
• Check the preview of the lineChart export
Last updated
Was this helpful?