def pie_base() -> Pie: chart = Pie("Pie-基本示例") chart.set_options(labels=Faker.choose()) chart.add_series(Faker.values()) return chart pie_base().render()
def radar_legend_colors(): chart = Radar("Radar-颜色调整", width="100%") chart.set_options(labels=Faker.choose(), colors=Faker.colors, legend_pos="upRight") chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) return chart
def line_base() -> Line: chart = Line("Line-基本示例", width="100%") chart.set_options(labels=Faker.choose(), x_label="I'm xlabel", y_label="I'm ylabel") chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) return chart
def line_tickcount_colors(): chart = Line("Line-调整颜色", width="100%") chart.set_options(labels=Faker.choose(), colors=Faker.colors, y_tick_count=8) chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) return chart
def pie_legend_font(): chart = Pie("Pie-Legend", width="100%") chart.set_options( labels=Faker.choose(), legend_pos="upRight", font_family='"Times New Roman",Georgia,Serif;', ) chart.add_series(Faker.values()) return chart
def bar_base() -> Bar: chart = Bar("Bar-基本示例") chart.set_options(labels=Faker.choose(), x_label="I'm xlabel", y_label="I'm ylabel") chart.add_series("series-A", Faker.values()) return chart
def bar_tickcount_colors(): chart = Bar("Bar-调整颜色") chart.set_options(labels=Faker.choose(), y_tick_count=10, colors=Faker.colors) chart.add_series("series-A", Faker.values()) return chart
def test_faker(): attrs = Faker.choose() values = Faker.values() assert_equal(len(attrs), len(values))
def radar_base() -> Radar: chart = Radar("Radar-基本示例", width="100%") chart.set_options(labels=Faker.choose()) chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) return chart
def pie_base() -> Pie: chart = Pie("Pie-基本示例", width="100%") chart.set_options(labels=Faker.choose()) chart.add_series(Faker.values()) return chart
def pie_radius(): chart = Pie("Pie-Radius", width="100%") chart.set_options(labels=Faker.choose(), inner_radius=0) chart.add_series(Faker.values()) return chart
def line_legend(): chart = Line("Line-Legend 位置", width="100%") chart.set_options(labels=Faker.choose(), legend_pos="upRight") chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) return chart
from cutecharts.charts import Radar from cutecharts.faker import Faker chart = Radar("Radar-基本示例") chart.set_options(labels=Faker.choose()) chart.add_series("series-A", Faker.values()) chart.add_series("series-B", Faker.values()) chart.render()