MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / extract_chart

Method extract_chart

seleniumbase/fixtures/base_case.py:13356–13390  ·  view source on GitHub ↗

Extracts the HTML from a SeleniumBase-generated chart. @Params chart_name - If creating multiple charts at the same time, use this to select the one you wish to use.

(self, chart_name=None)

Source from the content-addressed store, hash-verified

13354 time.sleep(0.1)
13355
13356 def extract_chart(self, chart_name=None):
13357 """Extracts the HTML from a SeleniumBase-generated chart.
13358 @Params
13359 chart_name - If creating multiple charts at the same time,
13360 use this to select the one you wish to use."""
13361 if not chart_name:
13362 chart_name = "default"
13363 if chart_name not in self._chart_data:
13364 raise Exception("Chart {%s} does not exist!" % chart_name)
13365 the_html = ""
13366 for chart_data_point in self._chart_data[chart_name]:
13367 the_html += chart_data_point
13368 the_html += """
13369 ]
13370 }]
13371 });
13372 </script>
13373 """
13374 axis = "xAxis: {\n"
13375 axis += " labels: {\n"
13376 axis += " useHTML: true,\n"
13377 axis += " style: {\n"
13378 axis += " fontSize: '14px',\n"
13379 axis += " },\n"
13380 axis += " },\n"
13381 axis += "categories: ["
13382 for label in self._chart_label[chart_name]:
13383 axis += "'%s'," % label
13384 axis += "], crosshair: false},"
13385 the_html = the_html.replace("xAxis: { },", axis)
13386 self._chart_xcount += 1
13387 the_html = the_html.replace(
13388 "chartcontainer_num_", "chartcontainer_%s_" % self._chart_xcount
13389 )
13390 return the_html
13391
13392 ############
13393

Callers 15

__process_dashboardMethod · 0.95
grafiek_uitpakkenMethod · 0.80
extraire_le_graphiqueMethod · 0.80
estrarre_il_graficoMethod · 0.80
extracto_gráficoMethod · 0.80
차트_추출Method · 0.80
提取图表Method · 0.80
extrair_gráficoMethod · 0.80
test_multi_seriesMethod · 0.80

Calls

no outgoing calls

Tested by 7

test_multi_seriesMethod · 0.64
test_pie_chartsMethod · 0.64
test_line_chartMethod · 0.64
test_chart_makerMethod · 0.64
test_area_chartMethod · 0.64