My application consists of numerous charts who's properties are configurable and defined in database tables. I currently specify the tooltip formatter as javascript which is different for each chart and is picked up at chart creation time and a javascript function created and attached to the chart. I can't see a way to do this in GWT Highcharts, but maybe I'm just missing something?
So I basically want to create a javascript function from a string and attach it to the chart as a tooltip formatter. Any advice would be great thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm, I can't think of a straightforward way to do this. GWT Highcharts is setup to allow you to code your formatter functions and other event callbacks in Java and then it handles the GWT/Javascript bindings for you. If you'd rather do the GWT/Javascript bindings on your own then you may be better off just doing things directly with JSNI.
Alternatively, you could take a look at modifying the "nativeRenderChart()" method in the "org.moxieapps.gwt.highcharts.client.BaseChart" class to attach your raw javascript function to the Highcharts instance (the function would of course need to be processed by the Javascript engine of the browser first if you're reading the text version of the function from a database table). If you see a way that you'd like to propose for allowing native javascript bindings to be attached to a GWT Highcharts instance, please let us know and we'd be happy to consider adding that capability in a future release.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm currently using the Highcharts-GXT library which is very flexible but I'm not sure about ongoing support so decided to look into GWT Highcharts. Initial impression is very positive - I think you've done a great job and your documentation is excellent.
I have quite a lot of code already in place so I'm currently investigating the possibility of converting across to your library and this was one of the issues that I came across.
It may be better for me to consider reworking the tooltip functionality so that I could do it java - it would be more in keeping with your library I guess and it's the way I would probably have done it if I'd used your library from the outset.
I'll do some more work on this over the next few weeks and hopefully I can use GWT Highcharts going forward - and make a donation of course :)
Keep up the good work!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My application consists of numerous charts who's properties are configurable and defined in database tables. I currently specify the tooltip formatter as javascript which is different for each chart and is picked up at chart creation time and a javascript function created and attached to the chart. I can't see a way to do this in GWT Highcharts, but maybe I'm just missing something?
So I basically want to create a javascript function from a string and attach it to the chart as a tooltip formatter. Any advice would be great thanks!
Hmm, I can't think of a straightforward way to do this. GWT Highcharts is setup to allow you to code your formatter functions and other event callbacks in Java and then it handles the GWT/Javascript bindings for you. If you'd rather do the GWT/Javascript bindings on your own then you may be better off just doing things directly with JSNI.
Alternatively, you could take a look at modifying the "nativeRenderChart()" method in the "org.moxieapps.gwt.highcharts.client.BaseChart" class to attach your raw javascript function to the Highcharts instance (the function would of course need to be processed by the Javascript engine of the browser first if you're reading the text version of the function from a database table). If you see a way that you'd like to propose for allowing native javascript bindings to be attached to a GWT Highcharts instance, please let us know and we'd be happy to consider adding that capability in a future release.
Thanks for the reply Shawn.
I'm currently using the Highcharts-GXT library which is very flexible but I'm not sure about ongoing support so decided to look into GWT Highcharts. Initial impression is very positive - I think you've done a great job and your documentation is excellent.
I have quite a lot of code already in place so I'm currently investigating the possibility of converting across to your library and this was one of the issues that I came across.
It may be better for me to consider reworking the tooltip functionality so that I could do it java - it would be more in keeping with your library I guess and it's the way I would probably have done it if I'd used your library from the outset.
I'll do some more work on this over the next few weeks and hopefully I can use GWT Highcharts going forward - and make a donation of course :)
Keep up the good work!