How to draw charts

Hello community,

I have the challenge drawing charts for management reports. I manage to extract those values from excel files.

I would now start implementing a new library creating charts - if none exists, yet. Does anyone know if there exists a robotframework library for drawing charts?

Regards,
Markus

2 Likes

Hi Markus. Sounds really interesting.

About any Python package can be used as a library - there is no need to restrict yourself to just “robotframework” libraries :wink: (and wrapping to custom library is quite easy also) Of course usability depends on what kind of interface the library provides.

I would probably at least try to use this one https://github.com/plotly/plotly.py and I would look into this one https://towardsdatascience.com/make-the-cutest-chart-in-python-visualize-your-data-with-hand-drawn-charts-f21157f76b4b

1 Like

I like the look of those cutechart charts, but maybe they are not for the management :smile:
graph.robot

*** Settings ***
Library  Graph.py

*** Tasks ***
Drawing Graphs
  Draw Line
  Draw Radar

Graph.py

from cutecharts.charts import Line
from cutecharts.charts import Radar
from cutecharts.components import Page
from cutecharts.faker import Faker

def draw_line():
    chart = Line("Line")
    chart.set_options(
        labels=["A", "B", "C", "D", "E", "F", "G"],
        x_label="I'm xlabel",
        y_label="I'm ylabel",
    )
    chart.add_series("series-A", [57, 134, 137, 129, 145, 60, 49])
    chart.add_series("series-B", [114, 55, 27, 101, 125, 27, 105])
    chart.render("example_line.html")

def draw_radar():
    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("example_radar.html")
3 Likes

Beautiful! :smiley:

1 Like