(
            self, chart_name='', chart_title='', as_html=False,
            interactive=False, as_chart=False, color='')
return chart.to_dict()
Encode aggregation result as Vega-Lite chart.

        Args:
            chart_name: Name of chart as string, defaults to initialized
                value of the chart type..
            chart_title: The title of the chart.
            as_html: Boolean indicating if chart should be returned in HTML.
            interactive: Boolean indicating if chart should be interactive.
            as_chart: Boolean indicating if chart should be returned as a
                chart object (instance of altair.vegalite.v3.api.LayerChart).
            color: String with the color information for the chart.

        Returns:
            Vega-Lite chart spec in either JSON or HTML format.

        Raises:
            RuntimeError if chart type does not exist.
Encode aggregation result as Vega-Lite chart.
Encode aggregation result as Vega - Lite chart .
def to_chart(
            self, chart_name='', chart_title='', as_html=False,
            interactive=False, as_chart=False, color=''):
        """Encode aggregation result as Vega-Lite chart.

        Args:
            chart_name: Name of chart as string, defaults to initialized
                value of the chart type..
            chart_title: The title of the chart.
            as_html: Boolean indicating if chart should be returned in HTML.
            interactive: Boolean indicating if chart should be interactive.
            as_chart: Boolean indicating if chart should be returned as a
                chart object (instance of altair.vegalite.v3.api.LayerChart).
            color: String with the color information for the chart.

        Returns:
            Vega-Lite chart spec in either JSON or HTML format.

        Raises:
            RuntimeError if chart type does not exist.
        """
        if not chart_name:
            chart_name = self.chart_type
        chart_class = chart_manager.ChartManager.get_chart(chart_name)

        if not chart_class:
            raise RuntimeError('No such chart type: {0:s}'.format(chart_name))

        chart_data = self.to_dict(encoding=True)
        chart_object = chart_class(
            chart_data, title=chart_title, sketch_url=self._sketch_url,
            field=self.field, extra_query_url=self._extra_query_url)

        if color:
            chart_object.set_color(color)

        chart = chart_object.generate()

        if interactive:
            chart = chart.interactive()

        if as_html:
            return chart.to_html()

        if as_chart:
            return chart
        return chart.to_dict()
def to_chart ( self , chart_name = '' , chart_title = '' , as_html = False , interactive = False , as_chart = False , color = '' ) : if not chart_name : chart_name = self . chart_type chart_class = chart_manager . ChartManager . get_chart ( chart_name ) if not chart_class : raise RuntimeError ( 'No such chart type: {0:s}' . format ( chart_name ) ) chart_data = self . to_dict ( encoding = True ) chart_object = chart_class ( chart_data , title = chart_title , sketch_url = self . _sketch_url , field = self . field , extra_query_url = self . _extra_query_url ) if color : chart_object . set_color ( color ) chart = chart_object . generate ( ) if interactive : chart = chart . interactive ( ) if as_html : return chart . to_html ( ) if as_chart : return chart return chart . to_dict ( )