Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/lcd/lcd_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,
max_value: int = 100,
autoscale: bool = False,
line_color: Tuple[int, int, int] = (0, 0, 0),
line_width: int = 2,
graph_axis: bool = True,
axis_color: Tuple[int, int, int] = (0, 0, 0),
background_color: Tuple[int, int, int] = (255, 255, 255),
Expand Down Expand Up @@ -397,7 +398,7 @@ def DisplayLineGraph(self, x: int, y: int, width: int, height: int,

# Draw plot graph
draw = ImageDraw.Draw(graph_image)
draw.line(list(zip(plotsX, plotsY)), fill=line_color, width=2)
draw.line(list(zip(plotsX, plotsY)), fill=line_color, width=line_width)

if graph_axis:
# Draw axis
Expand Down
1 change: 1 addition & 0 deletions library/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def display_themed_line_graph(theme_data, values):
max_value=theme_data.get("MAX_VALUE", 100),
autoscale=theme_data.get("AUTOSCALE", False),
line_color=line_color,
line_width=theme_data.get("LINE_WIDTH", 2),
graph_axis=theme_data.get("AXIS", False),
axis_color=theme_data.get("AXIS_COLOR", line_color), # If no color specified, use line color for axis
background_color=theme_data.get("BACKGROUND_COLOR", (0, 0, 0)),
Expand Down
17 changes: 17 additions & 0 deletions res/themes/theme_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: False
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -183,6 +184,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: False
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -284,6 +286,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -347,6 +350,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -411,6 +415,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: False
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -470,6 +475,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: False
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -540,6 +546,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -599,6 +606,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -658,6 +666,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -717,6 +726,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: False
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -771,6 +781,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -820,6 +831,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -911,6 +923,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -981,6 +994,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -1016,6 +1030,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -1052,6 +1067,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down Expand Up @@ -1087,6 +1103,7 @@ STATS:
HISTORY_SIZE: 10
AUTOSCALE: True
LINE_COLOR: 61, 184, 225
LINE_WIDTH: 2
AXIS: True
AXIS_COLOR: 255, 135, 0
# BACKGROUND_COLOR: 0, 0, 0
Expand Down