def _(values: DataFrame, chart: Chart) -> None: """Renders into the given chart the values in the DataFrame.""" chart_data = CategoryChartData() chart_data.categories = list(values.index) for label in list(values): chart_data.add_series(label, list(values[label].values)) if hasattr(values, 'title'): chart.chart_title.text_frame.text = values.title chart.replace_data(chart_data)
def _(values: DataFrame, chart: Chart) -> None: """Renders into the given chart the values in the DataFrame.""" chart_data = CategoryChartData() chart_data.categories = values['categories'] for label, series in values['data'].items(): chart_data.add_series(label, series) if 'title' in values: chart.chart_title.text_frame.text = values['title'] chart.replace_data(chart_data)