(self)
return chart
Generate the chart.

        Returns:
            Instance of altair.Chart
Generate the chart.
Generate the chart .
def generate(self):
        """Generate the chart.

        Returns:
            Instance of altair.Chart
        """
        encoding = self.encoding.copy()
        encoding['x'] = self.encoding['y']
        encoding['y'] = self.encoding['x']

        chart = self._get_chart_with_transform()
        self._add_url_href(encoding)

        if self.chart_title:
            bars = chart.mark_bar().properties(
                title=self.chart_title)
        else:
            bars = chart.mark_bar()

        bars.encoding = alt.FacetedEncoding.from_dict(encoding)

        text = bars.mark_text(align='left', baseline='middle', dx=3).encode(
            text='{0:s}:{1:s}'.format(
                encoding['x']['field'], encoding['x']['type']))

        chart = (bars + text)
        return chart
def generate ( self ) : encoding = self . encoding . copy ( ) encoding [ 'x' ] = self . encoding [ 'y' ] encoding [ 'y' ] = self . encoding [ 'x' ] chart = self . _get_chart_with_transform ( ) self . _add_url_href ( encoding ) if self . chart_title : bars = chart . mark_bar ( ) . properties ( title = self . chart_title ) else : bars = chart . mark_bar ( ) bars . encoding = alt . FacetedEncoding . from_dict ( encoding ) text = bars . mark_text ( align = 'left' , baseline = 'middle' , dx = 3 ) . encode ( text = '{0:s}:{1:s}' . format ( encoding [ 'x' ] [ 'field' ] , encoding [ 'x' ] [ 'type' ] ) ) chart = ( bars + text ) return chart