Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Fixed svg function to return svg chart together with container div for highcharts #1541

Merged
merged 3 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions Orange/widgets/highcharts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment why this is overridden and why a non-SVG is returned.

html = self.frame.toHtml()
return html[html.index('<div id="container"'):html.rindex('</div>') + 6]


def main():
""" A simple test. """
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<svg '):html.index('</svg>') + 5]
return html[html.index('<svg '):html.index('</svg>') + 6]