Skip to content

Commit 4c1cce4

Browse files
committed
Update generated charts
1 parent b3c9315 commit 4c1cce4

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11771,19 +11771,31 @@ def add_data_point(self, label, value, color=None, chart_name=None):
1177111771
raise Exception('Expecting a numeric value for "value"!')
1177211772
if not color:
1177311773
color = ""
11774+
else:
11775+
color = color.replace("'", "\\'")
1177411776
label = label.replace("'", "\\'")
11775-
color = color.replace("'", "\\'")
11776-
data_point = """
11777-
{
11778-
name: '%s',
11779-
y: %s,
11780-
color: '%s'
11781-
},
11782-
""" % (
11783-
label,
11784-
value,
11785-
color,
11786-
)
11777+
if color:
11778+
data_point = """
11779+
{
11780+
name: '%s',
11781+
y: %s,
11782+
color: '%s'
11783+
},
11784+
""" % (
11785+
label,
11786+
value,
11787+
color,
11788+
)
11789+
else:
11790+
data_point = """
11791+
{
11792+
name: '%s',
11793+
y: %s,
11794+
},
11795+
""" % (
11796+
label,
11797+
value,
11798+
)
1178711799
data_point = textwrap.dedent(data_point)
1178811800
self._chart_data[chart_name].append(data_point)
1178911801
if self._chart_first_series[chart_name]:

0 commit comments

Comments
 (0)