From e6ea6f670d355011401d7a83f7606fc00ef3b7d9 Mon Sep 17 00:00:00 2001 From: PrimozGodec Date: Tue, 6 Sep 2016 09:46:46 +0200 Subject: [PATCH 1/3] [FIX] Modified svg function to take the whole content of svg tags. Before last > was missing. --- Orange/widgets/webview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orange/widgets/webview.py b/Orange/widgets/webview.py index ff2d29105ae..aebc248de2d 100644 --- a/Orange/widgets/webview.py +++ b/Orange/widgets/webview.py @@ -88,4 +88,4 @@ def svg(self): """ Return SVG string of the first SVG element on the page, or raise ValueError if not any. """ html = self.frame.toHtml() - return html[html.index('') + 5] + return html[html.index('') + 6] From 61e0a1da3953070cbeed351ff41bb9036246d835 Mon Sep 17 00:00:00 2001 From: PrimozGodec Date: Tue, 6 Sep 2016 17:44:26 +0200 Subject: [PATCH 2/3] Added svg function in highcharts that override svg function form webview and returns whole div instead only svg part. It is required in report that also axis labels are shown. --- Orange/widgets/highcharts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Orange/widgets/highcharts.py b/Orange/widgets/highcharts.py index a59ec8d0aab..679f06692f9 100644 --- a/Orange/widgets/highcharts.py +++ b/Orange/widgets/highcharts.py @@ -325,6 +325,12 @@ def _on_selected_points(self, points): self._selection_callback([np.sort(selected).astype(int) for selected in points]) + def svg(self): + """ Return SVG string of the first SVG element on the page, or + raise ValueError if not any. """ + html = self.frame.toHtml() + return html[html.index('
') + 6] + def main(): """ A simple test. """ From 4ab7ba0cd6bee6cc631e22274211289b79a68e64 Mon Sep 17 00:00:00 2001 From: PrimozGodec Date: Tue, 20 Sep 2016 10:12:35 +0200 Subject: [PATCH 3/3] Added description for a svg function. --- Orange/widgets/highcharts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Orange/widgets/highcharts.py b/Orange/widgets/highcharts.py index 679f06692f9..bb3cc75ecab 100644 --- a/Orange/widgets/highcharts.py +++ b/Orange/widgets/highcharts.py @@ -326,8 +326,11 @@ def _on_selected_points(self, points): for selected in points]) def svg(self): - """ Return SVG string of the first SVG element on the page, or - raise ValueError if not any. """ + """ + Returns div that is container of a chart. + This method overrides svg method from WebView because + SVG itself does not contain chart labels (title, axis labels, ...) + """ html = self.frame.toHtml() return html[html.index('
') + 6]