Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Highcharts on a PDF
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Highcharts on a PDF
 Login/Join
 
Gold member
posted
Hello,

Did anyone try to create Highcharts graph on a PDF output?


Thanks

This message has been edited. Last edited by: FP Mod Chuck,


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 80 | Location: New York | Registered: February 04, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Is that a chart type?


WebFOCUS 8204, Unix, Windows
 
Posts: 1617 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Is not Highcharts HTML?

You know PDF is not HTML?

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 103 | Registered: April 06, 2009Reply With QuoteReport This Post
Gold member
posted Hide Post
I have created this in another framework (Zend) where I would create a html chart and then use the "wkhtmltopdf" tool in unix to generate a pdf output. I was wondering if this can be achieved in WebFocus.


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 80 | Location: New York | Registered: February 04, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
So, are you doing this because of a specific requirement or just as a challenge to see if it can be done? If you have a specific chart type that doesn't exist in WebFOCUS or github, I could see why you'd want to know how to do something like this.


WebFOCUS 8204, Unix, Windows
 
Posts: 1617 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
quote:
Originally posted by BabakNYC:
So, are you doing this because of a specific requirement or just as a challenge to see if it can be done? If you have a specific chart type that doesn't exist in WebFOCUS or github, I could see why you'd want to know how to do something like this.


I have a requirement to create a Dashboard having multiple containers and I am using highcharts graph in one of those container. I know highcharts has an exporting module where I can easily download the same graph into a PDF, but my requirement is to be able to export the whole dashboard into a pdf file.
Yes! I had to create a chart which was not available in WebFOCUS.


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 80 | Location: New York | Registered: February 04, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Nothing native in WebFOCUS although PhantomJS is installed with it. PhantomJS is a "headless" browser and you can capture webpages into an image file using it.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5575 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
We haven't done this server-side yet, but... Most (all?) of those JS charting libraries generate an SVG image embedded in the HTML output.

If you can run the JS chart server-side (for example using Tony's suggested PhantomJS or perhaps nodejs), capture the svg node + children and store that in a file. You can then embed that vector image in your PDF.

Ideally, you could create a HTML fragment (instead of a full page) consisting of just the generated SVG stuff for the chart and save that as a file.
We do this client-side using a popup window as the target document for the rendered chart, so that there is no left-over stuff (like the script-tags that include the chart library!).


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1641 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Member
posted Hide Post
WebFOCUS charting can be extended to make charts from external JavaScript charting libraries such as HighCharts behave like built-in WebFOCUS charts.

See the documentation:
---------------------
Creating HTML5 Charts With WebFOCUS Language Release 8.2 Version 04
Chapter 14: Adding Your Own Chart Types to the Chart Library
https://webfocusinfocenter.inf.../pdfs4/wfjschart.pdf

Note: This is also valid for earlier releases of WebFOCUS 82xx

This technique requires JavaScript programming skills.

Excerpts from the manual:

WebFOCUS supports the ability to add new, custom chart types to its list of built-in charts. These custom chart types are called extensions or plug-ins. An extension is a block of code that accesses resources external to WebFOCUS. This chapter describes the structure of an extension and the steps necessary to create your own and add it to the chart library.

Chart extensions are written in JavaScript. The visual part of a visualization can be drawn with HTML, Canvas, or SVG. Extensions can include external CSS and JS libraries (such as d3), which can be used to build almost any visualization. The WebFOCUS Extension API is limited to new, complete chart types only. It is not possible to add features to existing chart types, and it is not possible to modify or extend parts of WebFOCUS outside of the chart area allocated to your extension.
This chapter summarizes the process of writing, configuring, and installing a chart extension.

Detailed instructions can be found on the Information Builders GitHub site: https://github.com/ibi/wf-extensions-chart


WebFOCUS 8.x, Windows 10, Ubuntu Linux
 
Posts: 16 | Location: New York City | Registered: March 01, 2010Reply With QuoteReport This Post
Member
posted Hide Post
quote:
... but my requirement is to be able to export the whole dashboard into a pdf file.



In the PDF file containing the whole dashboard, is each container in the dashboard to appear on its own page in the PDF, or does the entire dashboard appear on a single page in the PDF like a screen shot?


WebFOCUS 8.x, Windows 10, Ubuntu Linux
 
Posts: 16 | Location: New York City | Registered: March 01, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
quote:
Originally posted by Ira Kaplan:


In the PDF file containing the whole dashboard, is each container in the dashboard to appear on its own page in the PDF, or does the entire dashboard appear on a single page in the PDF like a screen shot?


The entire dashboard need not be on a single page, but I need to try to fit in as many containers of a dashboard on a page to be visually appealing.


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 80 | Location: New York | Registered: February 04, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Highcharts on a PDF

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.