Carrier Dashboard

Setting CGG Chart values with postFetch ..

if ( typeof cgg == 'undefined' ){
  
// ... This block only runs in the dashboard ... 

 } else {
  
// ... This block only runs in CGG (export) ... 

}

// ... This block runs everywhere ... 
var objParams = Dashboards.propertiesArrayToObject( this.parameters );

objParams['_date'] = 'dateParam';

this.parameters = Dashboards.objectToPropertiesArray( objParams ); 
var titleDate = ( typeof cgg == 'undefined' ) ?
Dashboards.getParameterValue('dateParam') : params.get('_date');

this.chartDefinition.title = "Chart rendered on " + titleDate; 

  1. Edit: /Public/CTools Dashboard/Carrier-Dashboard-Expand/Layout ( providing you've completed all the workshops..!)

  2. In the Components pane, click to expand the Charts group, and then click to select the lineChart.

  3. Click Advanced Properties.

  4. Specify the postFetch function

• Click the ellipsis icon to the right of the postFetch property.

  1. Copy & paste the following:

function f(data){

    // This block only runs in CGG (export)
    if ( typeof cgg != 'undefined' ){
        
        // Change or set some chart properties to look differently from what we see on the dashboard       
        this.chartDefinition.width = 700;
        this.chartDefinition.title = "Number of Calls vs Number of Users";
        this.chartDefinition.titlePaddings = "10";
        
        this.chartDefinition.legendAlign = "center";
        this.chartDefinition.legendPosition = "bottom";
        this.chartDefinition.legendPaddings = "15 5";
        this.chartDefinition.legendItemPadding = "10";
        
        this.chartDefinition.baseAxisOverlappedLabelsMode = "leave";
        
    }
  
}
  1. Save the dashboard.

  2. 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?