gencharts/__init__.py
def _chart_class(self, df, chart_type, **kwargs):
        """
        Get the right chart class from a string
        """
        if chart_type == "bar":
            return Chart(df).mark_bar(**kwargs)
        elif chart_type == "circle":
            return Chart(df).mark_circle(**kwargs)
        elif chart_type == "line":
            return Chart(df).mark_line(**kwargs)
        elif chart_type == "point":
            return Chart(df).mark_point(**kwargs)
        elif chart_type == "area":
            return Chart(df).mark_area(**kwargs)
        elif chart_type == "tick":
            return Chart(df).mark_tick(**kwargs)
        elif chart_type == "text":
            return Chart(df).mark_text(**kwargs)
        elif chart_type == "square":
            return Chart(df).mark_square(**kwargs)
        elif chart_type == "rule":
            return Chart(df).mark_rule(**kwargs)
        return None
def _chart_class(self, df, chart_type, **kwargs):
        if chart_type == "bar":
            return Chart(df).mark_bar(**kwargs)
        elif chart_type == "circle":
            return Chart(df).mark_circle(**kwargs)
        elif chart_type == "line":
            return Chart(df).mark_line(**kwargs)
        elif chart_type == "point":
            return Chart(df).mark_point(**kwargs)
        elif chart_type == "area":
            return Chart(df).mark_area(**kwargs)
        elif chart_type == "tick":
            return Chart(df).mark_tick(**kwargs)
        elif chart_type == "text":
            return Chart(df).mark_text(**kwargs)
        elif chart_type == "square":
            return Chart(df).mark_square(**kwargs)
        elif chart_type == "rule":
            return Chart(df).mark_rule(**kwargs)
        return None
def _chart_class ( self , df , chart_type , * * kwargs ) : if chart_type == "bar" : return Chart ( df ) . mark_bar ( * * kwargs ) elif chart_type == "circle" : return Chart ( df ) . mark_circle ( * * kwargs ) elif chart_type == "line" : return Chart ( df ) . mark_line ( * * kwargs ) elif chart_type == "point" : return Chart ( df ) . mark_point ( * * kwargs ) elif chart_type == "area" : return Chart ( df ) . mark_area ( * * kwargs ) elif chart_type == "tick" : return Chart ( df ) . mark_tick ( * * kwargs ) elif chart_type == "text" : return Chart ( df ) . mark_text ( * * kwargs ) elif chart_type == "square" : return Chart ( df ) . mark_square ( * * kwargs ) elif chart_type == "rule" : return Chart ( df ) . mark_rule ( * * kwargs ) return None
Get the right chart class from a string
Get the right chart class from a string