(self, agg_obj, chart_type='table', index=-1)
return self._add_block(agg_block, index)
Adds an aggregation object to the story.

        Args:
            agg_obj: an aggregation object (instance of aggregation.Aggregation)
            chart_type (str): string indicating the type of aggregation, can be:
                "table" or the name of the chart to be used, eg "barcharct",
                "hbarchart". Defaults to "table".
            index: an integer, if supplied determines where the new
                block will be added. If not supplied it will be
                appended at the end.

        Returns:
            Boolean that indicates whether block was successfully added.

        Raises:
            TypeError: if the aggregation object is not of the correct type.
Adds an aggregation object to the story.
Adds an aggregation object to the story .
def add_aggregation(self, agg_obj, chart_type='table', index=-1):
        """Adds an aggregation object to the story.

        Args:
            agg_obj: an aggregation object (instance of aggregation.Aggregation)
            chart_type (str): string indicating the type of aggregation, can be:
                "table" or the name of the chart to be used, eg "barcharct",
                "hbarchart". Defaults to "table".
            index: an integer, if supplied determines where the new
                block will be added. If not supplied it will be
                appended at the end.

        Returns:
            Boolean that indicates whether block was successfully added.

        Raises:
            TypeError: if the aggregation object is not of the correct type.
        """
        if not hasattr(agg_obj, 'id'):
            raise TypeError('Aggregation object is not correctly formed.')

        if not hasattr(agg_obj, 'name'):
            raise TypeError('Aggregation object is not correctly formed.')

        if index == -1:
            index = len(self._blocks)

        agg_block = AggregationBlock(self, index)
        agg_block.feed(agg_obj)
        agg_block.chart_type = chart_type

        return self._add_block(agg_block, index)
def add_aggregation ( self , agg_obj , chart_type = 'table' , index = - 1 ) : if not hasattr ( agg_obj , 'id' ) : raise TypeError ( 'Aggregation object is not correctly formed.' ) if not hasattr ( agg_obj , 'name' ) : raise TypeError ( 'Aggregation object is not correctly formed.' ) if index == - 1 : index = len ( self . _blocks ) agg_block = AggregationBlock ( self , index ) agg_block . feed ( agg_obj ) agg_block . chart_type = chart_type return self . _add_block ( agg_block , index )