Пример #1
0
def pie_base() -> Pie:
    chart = Pie("Pie-基本示例")
    chart.set_options(labels=Faker.choose())
    chart.add_series(Faker.values())
    return chart

    pie_base().render()
Пример #2
0
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
Пример #5
0
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
Пример #6
0
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
Пример #7
0
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
Пример #8
0
def test_faker():
    attrs = Faker.choose()
    values = Faker.values()
    assert_equal(len(attrs), len(values))
Пример #9
0
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
Пример #10
0
def pie_base() -> Pie:
    chart = Pie("Pie-基本示例", width="100%")
    chart.set_options(labels=Faker.choose())
    chart.add_series(Faker.values())
    return chart
Пример #11
0
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
Пример #12
0
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
Пример #13
0
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()