Beispiel #1
0
    def plot(self) -> Chart:
        analysis = CommonStylesAnalysis(self.recipe_scope)
        df = analysis.common_styles_relative(num_top=20)
        if len(df) == 0:
            raise NoDataException()

        figure = BarChart().plot(df, 'beer_style', 'recipes_percent', None,
                                 '% of the Style\'s Recipes')
        return Chart(figure, title=self.get_chart_title())
Beispiel #2
0
    def plot(self) -> Chart:
        analysis = CommonStylesAnalysis(self.recipe_scope)
        df = analysis.common_styles_absolute(num_top=20)
        if len(df) == 0:
            raise NoDataException()

        figure = BarChart().plot(df, 'beer_style', 'recipes', None,
                                 'Total Number of Recipes')
        return Chart(figure, title=self.get_chart_title())
Beispiel #3
0
 def common_styles_relative(self) -> DataFrame:
     analysis = CommonStylesAnalysis(self.recipe_scope)
     return analysis.common_styles_relative(num_top=20)