Workspace 6.21.5
Signals | Public Member Functions | Protected Member Functions | List of all members
ChartWebPage Class Reference

Web page used to render a chart. Separated out from the widget so that it can be re-used in various other contexts, such as off-screen rendering.

#include <DataAnalysis/Chart/chartwebpage.h>

Inheritance diagram for ChartWebPage:
[legend]

Signals

void renderComplete ()
 

Public Member Functions

 ChartWebPage (QWidget *parent=nullptr)
 
 ~ChartWebPage () override
 
void flushD3Transitions ()
 
void getChartAsSvgXml (const QWebEngineCallback< const QVariant & > &resultCallback)
 
void getHtml (const QWebEngineCallback< const QString & > &resultCallback)
 
bool renderChart (const Chart &chart, bool embedChartInHtml=false)
 

Protected Member Functions

bool acceptNavigationRequest (const QUrl &url, NavigationType type, bool isMainFrame) override
 
QWebEnginePage * createWindow (WebWindowType type) override
 
void javaScriptConsoleMessage (JavaScriptConsoleMessageLevel level, const QString &message, int lineNum, const QString &sourceId) override
 
void setRendering (bool b)
 

Constructor & Destructor Documentation

◆ ChartWebPage()

ChartWebPage ( QWidget *  parent = nullptr)
explicit

◆ ~ChartWebPage()

~ChartWebPage ( )
overridedefault

Member Function Documentation

◆ acceptNavigationRequest()

bool acceptNavigationRequest ( const QUrl &  url,
NavigationType  type,
bool  isMainFrame 
)
overrideprotected

◆ createWindow()

QWebEnginePage * createWindow ( WebWindowType  type)
overrideprotected

◆ flushD3Transitions()

void flushD3Transitions ( )

◆ getChartAsSvgXml()

void getChartAsSvgXml ( const QWebEngineCallback< const QVariant & > &  resultCallback)

Asynchronously return a string by calling the callback object, containing the serialized XML content of the internal SVG representing the rendered chart. This serialized SVG will have all of the CSS rules active in the document embedded into it so that it requires no attached CSS file.

◆ getHtml()

void getHtml ( const QWebEngineCallback< const QString & > &  resultCallback)

Asynchronously return a string containing the HTML context by calling the callback.

◆ javaScriptConsoleMessage()

void javaScriptConsoleMessage ( JavaScriptConsoleMessageLevel  level,
const QString &  message,
int  lineNum,
const QString &  sourceId 
)
overrideprotected

◆ renderChart()

bool renderChart ( const Chart chart,
bool  embedChartInHtml = false 
)
Parameters
chartThe chart to render to the page.
embedChartInHtmlIf true, the contents of the chart will be embedded in the HTML, allowing the page to be exported as a stand-alone web page.

Renders the specified chart on the web page, which is set up to render D3 / NVD3 charts. Note that this function is asynchronous - if action needs to be taken after the chart has been rendered, callers will need to connect to the renderComplete signal.

◆ renderComplete

void renderComplete ( )
signal

◆ setRendering()

void setRendering ( bool  b)
protected