File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,15 @@ def _on_selected_points(self, points):
325325 self ._selection_callback ([np .sort (selected ).astype (int )
326326 for selected in points ])
327327
328+ def svg (self ):
329+ """
330+ Returns div that is container of a chart.
331+ This method overrides svg method from WebView because
332+ SVG itself does not contain chart labels (title, axis labels, ...)
333+ """
334+ html = self .frame .toHtml ()
335+ return html [html .index ('<div id="container"' ):html .rindex ('</div>' ) + 6 ]
336+
328337
329338def main ():
330339 """ A simple test. """
Original file line number Diff line number Diff line change @@ -88,4 +88,4 @@ def svg(self):
8888 """ Return SVG string of the first SVG element on the page, or
8989 raise ValueError if not any. """
9090 html = self .frame .toHtml ()
91- return html [html .index ('<svg ' ):html .index ('</svg>' ) + 5 ]
91+ return html [html .index ('<svg ' ):html .index ('</svg>' ) + 6 ]
You can’t perform that action at this time.
0 commit comments