Export fusioncharts to pdfMake - fusioncharts

I am building a report with pdfMake in which I need to include some charts rendered at the web page with fusioncharts. The available client-side export options provided by fusioncharts aren't working for me because I need to obtain the image file (or base64) somehow to pass it to the function building the document, without having to retrieve it elsewhere.
I understand that fusioncharts have server-side export options, but I haven't found guidence or clear info about if this is kind of the start to the solution I am looking for.
AMcharts has the 'export to base64' feature just the way I need (link below); so any help, tips, solution or workaround to get it done with fusioncharts would be really appreciated.
https://www.amcharts.com/kbase/get-base64-representation-chart-image/

You can get Base64 string data for FusionChart chart by consuming its API method getSVGString, using this method you will get SVG string for the chart which you can convert to Base64 string using JS via window.btoa().
JSFiddle: http://jsfiddle.net/sikrigagan/2ovov3nL/
To know more about this method, check this developer documentation page.

Related

Generate PDF with pie chart -iText7

The obvious primary reason for using iText being , our company already have a license.
Requirement:
Generate a report that includes pie chart.
Our UX gave us a HTML, And I'm using html2pdf plugin to generate pdf.
We're using tlx-chart for its simplest code.
Issue:
PDF doesn't render/show piechart. No errors seen in logs.
HTML is being created perfectly (Althought iText conversion seems to be not so good), and When I load it with chromedriver as provided in KB article below, it renders overlapped 2 piecharts instead of 1.
So, This knowledgebase article from iText doesn't help.
Infact, I've thought I cannot keep on updating chromedriver,selenium on prod server.
I've to provide a loosely coupled (OS>PDF>PIE) to generate PDF.
Code Snippet:
HtmlConverter.convertToPdf(reportHtml, pdfWriter, new ConverterProperties());
"<tlx-chart id=\"mychart\" chart-type=\"PieChart\" chart-editable=\"true\" chart-columns=\"${['Element','Percentage']}\" chart-data=\"${${pieData}}\" </tlx-chart>"
Please Help!
So the issue is to embed piechart in PDF since JavaScript tags were not being rendered by iText library. And I resolved this in my case using jFreeChart.
Generate an image using jFreechart and embed that image in HTML
iText perfectly renders this as per HTML CSS
For detailed explanation and code snippet on this please visit here
An alternative way is also documented here

How to integrate ECharts with BIRT/Pentaho?

I'm looking for a report engine which may:
connect to data source via JDBC
create logic data set by grouping/aggregating the raw data
include a data filter on the top of each report, which allows my client use the report interactively
add custom charts, in my case, it's ECharts https://github.com/ecomfe/echarts
support multi-tenancy paradigm (new requirement)
Now BIRT and Pentaho are the two players on my table.
For pentaho, it's really hard to find useful document to at least clarify if it's capable. Please if you're familiar with it, let me know if pentaho community version meets my requirements.
For BIRT, I've found evidence it support my first 3 needs. But for custom charts, I can only find examples/docs about adding custom IMAGE/SVG charts. As ECharts is based on canvas, I'm not sure if it's possible to integrate ECharts with BIRT.
Thank you!
Yes, it is possible to integrate javascript charts in BIRT. Basically:
Select the top-level element of your report outline -> Script tab -> clientScripts
Include here your echart resources (.js and .css) using "head.js" (see link below for more informations)
Add a text element to the report
Set the type of this new element to 'HTML'
In a script tag, initialize your echart object in a "head.ready()" instruction (see link below for more informations). The tricky part is to understand how to use a server-side dataset in a client-side chart within this html script.
You can find more informations and a full example of a such report here, this example embeds a jvectormap in a birt report. Furthermore, see a live demo here, where a JIT chart is integrated in a BIRT report.
However since these charts are created using a client-side framework, obviously BIRT won't be able to export them in PDF format. You can see in the live demo linked above, how a BIRT report can easily handle a different output when users export to PDF.
You can do it in Pentaho, but which tool to use it's a matter of debate.
Using Pentaho Report Designer:
- Connects to DBs using JDBC;
- Allows grouping rows based on a field or fields and calculating functions such as running sums;
- Can use selectors (single or multi-valued selectors) to interact with the report, passing the selector values to the queries;
- As far as I can tell, you don't have many options to choose a specific charting engine.
However, you can use CCC as the charting engine, which is a Protovis based Javascript charting engine, cross-browser compatible (for the most part), renders SVG charts with a decent fallback for IE (I believe the fallback is flash but I'm not sure if it changed recently) and produces decent looking charts.
If you HAVE to use that chart library, then I suggest using C-Tools dashboards instead, where you can embed as many different JS files you want and you have full control over the JS and CSS of the page. But most of the reporting functions from PRD will have to be implmented by you.

how to generate pdf in GXT/GWT?

i am using GWT/EXTGWT. on click of submit button i get list of records from db. i need to export them to pdf. please suggest me how to do this?
if data to be exported is more then that should be exported to multiple pages.
Thanks!
There's little in context of GWT here, apart from the fact that you have a GWT based application. What you are really looking for is a tool that generates PDF, given data.
There are hosts of them available :
iText
jPDF Writer...
Obviously, iText has been the most widely known and successful one! Here's a good tutorial - http://www.vogella.de/articles/JavaPDF/article.html
Try some tools like itext pdf generator Searching online will give you many more options.

creating Graphs and charts in iphone application?

I saw a couple of applications in the itunes store with stunning visuals, how is it possible to create those graphs and charts. I know these things can also be created using Java script, is javascript used to create them ?
You're looking for Core Plot.
you can draw chart's of your choice there is one API is available in Google for that using that API you van show your chart in UIWebView here I am providing the URL for that.That Url Required different kind of parameter for that.
http://chart.apis.google.com/chart?cht=bvg&chs=320x200&chd=t:315654000000,378799000000,421849000000&chxs=1N*cUSD&chxr=a&chds=a&chco=50b1c7,EBB671,DE091A&chbh=25,5,25&chxt=x,y,x,x&chxl=0:|2006|2008|2010|2:||5+Year+%+Sales+Growth++33%||3:||3+Year+%+Sales+Growth++11%||&chdl=Sales+Growth&chtt=Revenue+Trend&chts=000000,12,c
For More Detail please refer this URL: http://code.google.com/apis/chart/image/

Looking for an interactive pie chart to use with GWT (without extern communication)?

I'm looking for a stand-alone Pie Chart which I can use in a GWT application. The Chart should be interactive, so that I can react on user input (read mouse clicks on the chart).
I've already looked at Google Chart Tools with GWT Visualization. This is exactly what I want. A simple to use PieChart class with user interaction and a simple and comprehensive data input. Except that the data is transfered to Google for the rendering part. The data should not leave the client or our server.
Have you tried Fusion Charts? Here's the Pie Chart showcase. Its a Flash object hence you will need to use JSNI to embed the object into your widget or use a library like GWT2SWF to do it for you.
I have used Fusion Charts + GWT2SWF combination in one of my products, and would recommend it to anyone looking for a interactive flash charting tool (outside of google's toolset)
A colleague of mine found following library: GChart. Rather then using Flash we'll try to draw our own. Not sure how easy this will be.
You mentioned:
"The Data should not leave the server"
With Google visualization APIs (as opposed to the chart apis) the data remains on your server, only the code is downloaded from google.
However, if you meant that you shouldnt need access to google at all, then GCharts is the only remaining and a pretty good option.
Check out GWT-RCharts hosted on http://code.google.com/p/gwt-rcharts/ . It is stand alone i.e doesn't have external dependency like Visualization. The API works on SVG/VML specification so no plugin dependency. You may find it quite easy to install, implement and use. You can find the demo at http://gwt-rcharts.appspot.com/