I get some JavaScript errors when I try to run this. Where did you download your env.js? I tried something I found in an article by John Resig, but I suspect it is old and out of date. I see there are github repositories for complete projects. How do I set up this?
with env.js-1.2 and js.jar 1.7-rc2,jquery 1.4.2, and highcharts latest (date.js is irrelevant here)
Don't forget to write width and height in chart options, or this will give you a chart of width=1 (pretty unreadable )
Sorry to bother you with this, but I still can't make it work. I have Rhino from env.js directly from the env.js website. It starts up, but complains it can't find my base.html file which is definately there. Could you zip up your entire folder, including rhino and env.js, test it and send it over to me? It would be really nice to get this working. The address is support at the highcharts domain.
I haven't played with env.js with highcharts in a while but are you doing a window.location="base.html"? IIRC, env.js also won't run scripts with type text/javascript by default, so you either need to change an option or change your base.html to include the javascripts with an text/envjs type .
testjs $ js
Rhino 1.7 release 2 2009 03 22
js> Packages.org.mozilla.javascript.Context.getCurrentContext().setOptimizationLevel(-1);
js> load('/home/mwolfetech/opt/env-js/dist/env.rhino.js');
[ Envjs/1.6 (Rhino; U; Linux amd64 2.6.18-164.11.1.el5; en-US; rv:1.7.0.rc2) Re
sig/20070309 PilotFish/1.2.13 ]
js> window.location = 'test.html'
test.html
js> charting.init(); // a function to create the highchart--may not be needed if you do it on document load with jQuery
js> jQuery('#idofchartcontainer').html() //See the results
You may want to check out the ruby JSpec gem though, it rolls a lot of this together to make JavaScript testing easier.
using your example and lots of trial and error. I was able to get a full server side Java implementation working. I have it running inside of tomcat. This is cool because now I don't have to fork any processes to execute it. I have the Rhino jar file in the tomcat class path and load the following scripts:
where 'script' is my client side rendering script with a few minor tweaks. I saved it into my _js directory. I added this to the bottom so I could get the results back out.
//////////////////////////
// GET EVERYTHING RUNNING
//////////////////////////
console.log('ready to go');
window.location = './base.html';
var chart = new Highcharts.Chart(options);
console.log($("#container").html());
//STORE THE INNER HTML IN A VARIABLE SO WE CAN GET AT IT
var svg;
svg = $("#container").html();
Hi,
I've spend few days trying to execute highcharts on server-side(Java), but coudn't.
I'm trying to use env.js+ rhino as well.
Highcharts are 2.2.1.
here is the code, I'm trying to use.
On executing that code, I'm getting JS error: uncaught JavaScript runtime exception: TypeError: Cannot set property "exportIcon" of undefined to "org.mozilla.javascript.InterpretedFunction@5b6df84b" (D:\Projects\one2team-highcharts-serverside-export-ca8afcf\src\my\test\exporting.js#669)
I did try to comment exportIcon initialisation, in exporting.js but got another problems.
Is there anyone who was successful on server side highcharts generation using 2.2.1 (actually there was one2team example that worked fine on 2.1.2 https://github.com/one2team/highcharts- ... ide-export but that example didn't work with 2.2.1 as well)
Hi, sorry for late reply. Have you attached exporting module as well? Have you tried to ask one2team on github about support for the latest version? It's a third party software so it's better to ask the author.
hfrntt wrote:Hi, sorry for late reply. Have you attached exporting module as well? Have you tried to ask one2team on github about support for the latest version? It's a third party software so it's better to ask the author.
As for one2team solution, it seems that there is no much work with that project. So, I've tried to write my own module for highcharts.
the very basic solution, that didn't work,is posted above. there is an exporting.js attached, but the problem seems to be with highcharts initialization. I wonder if someone was able to do server side exporting with newer highcharts.