I am using HighChart in my application.
I want to export chart image on a button click like http://jsfiddle.net/hfrntt/fXHB5/1896/.
but i want to save image in a predefined folder and remove the save dialog pop-up to save image.
On button click image saved on the predefined folder.(No save dialog)
Thanks in advance
You have to setup an exportserver. Upon the client sends the Highcharts SVG file to this service it will be converted to an image. Before the server returns the image to the client you can save it to the predefined filesystem.
Here you can find a php export server and a java based one. https://github.com/highslide-software/highcharts.com/tree/master/exporting-server developed by Highcharts
These exportservers are setup to remove the temporary created files. You have to change the code a bit to prevent this.
read also this article for more background information on Highcharts exportservers
This is going to involve much more than simply using highcharts. You are going to have to use some sort of wrapper that will actually render the chart/page on the server-side and then essentially output it as an image. The following are links taken from a post on the highcharts website.
GWT Highcharts wrapper
Highcharts-server-side-export (with Rhino/Batik)
Related
I am working on blog like web project using lexical editor in nextjs.
I am trying to implement image plugin in lexical editor. For now it coverts to base64 format which will be expensive for storing in database. Instead of storing base64 I want to store the image link along with other text inside database. Also I am facing issue to implement image plugin of lexical editor in nextjs.
steps I want to follow
I want to upload image in aws s3 and then want to show in editor as image.
Another way I am trying to implement like a modal will open where image can be selected
and it uploads to aws s3 and gets image url, then want to show image url in editor.
Is there any solution for it?
Thanks in advance for any suggestion
The newer version of Chartkick has a download option that displays a button over the javascript chart, when clicked will open a new browser window and render the chart as an image. This is great. However, that method does not seem to help render an image to use as an email attachment. Unless there is a way to call/render the chart using a chartkick method inside the mailer, grab the image and attach it...As far as I can tell, this functionality does not exist.
Anyone know of a way to attach a chartkick chart as an image email attachment?
Natively? No. Chartkick performs a download using their script chartkick.js and chart.bundle.js. It happens entirely client-side, not server-side. And it should not be opening a new window. It should just download the file directly onto the client's machine. Example here: https://chartkick.com/react
I have a Highcharts implementation. I need to be able to get the image data in my source code at client side. How can this be done?
I know there are exportChart methods, but they directly trigger a download and does not return an image in the source code.
I have also read about getting SVG from the chart and then converting that into an image, but that seems to be a workaround rather than a solution. Can this be done in a proper way or is there anything available in Highcharts for this?
Did you consider to use offline exporting module (http://code.highcharts.com/modules/offline-exporting.src.js)? It will allow you to export image without sending any data to an external server (https://www.highcharts.com/docs/export-module/client-side-export).
API Reference:
http://api.highcharts.com/highcharts/Chart.exportChartLocal
Example:
http://jsfiddle.net/9dom7je9/
I have to create a print preview page where I have to show some information and a highchart of the original page. Is there a way to export the highchart graph from one page to another?
There are probably many ways to accomplish this.
What language are you working in?
I would try it this way:
set the chart options in an external js file
include that js file in both the original page, and the 'preview' page
I assume the user will click on a link or button to open the preview page...?
send the data via POST to the new page, and instantiate the chart on the new page on page load
You could also look into using the Export package to
on link/button click, export the chart as an image, to the server
pass the url of the saved image to the new page, and load the image there
I have not worked with exporting to the server, and wouldn't bother with the set up for this when you can just pass the data and build the chart on the new page, but it's an option.
I have been told this is possible to do but cannot get this to work.
Basically I am trying to cache and image using forge.file.cacheURL()
Now I can get the file just fine and display it in the page by creating a new Image object but what I want to do is use this cached image to change the image in the topbar.
When ever I try to do it I get an error saying "file not found" and after reading the docs a little more it seems that trigger may have "src/" coded into the class because if I put just "image/logo.png" the logo.png will show up in the header because its part of the app package.
I guess the question is.. Is my assumption correct?
Thanks!
The native UI elements (topbar/tabbar) load images directly from your apps package, not through a URL in the same ways images are shown in the webview.
What this means is that currently you can only use images included in your app in the topbar/tabbar modules.
in case anyone is interested in this, the ability was added a while ago to the API so you can now use a cached image or filesaveURL feature of forge to change the header image dynamically.