MCPcopy Create free account
hub / github.com/scanny/python-pptx / make_category_chart_data

Function make_category_chart_data

tests/chart/test_xmlwriter.py:683–702  ·  view source on GitHub ↗

Return a |CategoryChartData| instance populated with *cat_count* categories of type *cat_type* and *ser_count* series. Values are auto-generated.

(cat_count, cat_type, ser_count)

Source from the content-addressed store, hash-verified

681
682
683def make_category_chart_data(cat_count, cat_type, ser_count):
684 """
685 Return a |CategoryChartData| instance populated with *cat_count*
686 categories of type *cat_type* and *ser_count* series. Values are
687 auto-generated.
688 """
689 category_labels = {
690 date: (date(2016, 12, 27), date(2016, 12, 28), date(2016, 12, 29)),
691 float: (1.1, 2.2, 3.3, 4.4, 5.5),
692 str: ("Foo", "Bar", "Baz", "Boo", "Far", "Faz"),
693 }[cat_type]
694 point_values = count(1.1, 1.1)
695 chart_data = CategoryChartData()
696 chart_data.categories = category_labels[:cat_count]
697 for idx in range(ser_count):
698 series_title = "Series %d" % (idx + 1)
699 series_values = tuple(islice(point_values, cat_count))
700 series_values = [round(x * 10) / 10.0 for x in series_values]
701 chart_data.add_series(series_title, series_values)
702 return chart_data
703
704
705def make_xy_chart_data(ser_count, point_count):

Calls 3

add_seriesMethod · 0.95
CategoryChartDataClass · 0.90
countFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…