GWT Standard theme == relatively much bigger IE buttons. Fix?
I've noticed that in IE buttons are noticeably larger using the standard GWT CSS theme than these buttons are in other browsers. This makes consistent cross-browser sizing difficult for me. Just eyeballing I'd say the IE buttons are around 50% wider and taller than in the other browsers. For example, Buttons with plenty of space between them in FF look squeezed together in IE, and so on. Questions: Have you seen this behavior (or is it just me)? Do you know why it happens? Simple fix that makes the IE buttons closer to the FF buttons in size? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Best ways to avoid unwelcome CSS cascade side effects?
I still recall an incredulous friend's exasperation: I merely changed the value of X and, inexplicably, a completely different thing, Y, now has a different value, too! An obscure side effect of the CSS cascade? No. FORTRAN COMMON blocks. Here are two cases where I or those I know got burned by the CSS cascade: 1) A CSS rule attached to a img selector in a far-flung stylesheet pushed all the images into strange positions. Fix: a weird image tag padding rule was responsible. It was just a mistake in the CSS and was simply removed. 2) A table td selector short-circuited font properties applied to the table and intended to define the table-cells' font properties via inheritance. Fix: The problematic table td selector could not be easily changed, so more specific styles were added directly to the table cells that beat out the table td selector in the CSS cascade. The exasperating thing was that, in each case, everything worked just fine until, somewhere else, completely independent of the code that worked fine in isolation, someone injected a seemingly innocuous CSS snippet that short-circuited the previous CSS specs. Questions: 1) Have you been burned by such CSS cascade side effects? What got you? How did you correct the problem? 2) Are there any strategies that, if they do not totally eliminate, can at least minimize such problems? What works best for you? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWT Standard theme == relatively much bigger IE buttons. Fix?
Thanks, when I added the following doctype at the top of the host page: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/ TR/html4/strict.dtd The IE button sizes dropped down a notch. (Previously, I had not included any doctype at all...that gave me the gargantuan IE buttons) I also tried this doctype, which also corrected the problem: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http:// www.w3.org/TR/html4/loose.dtd The buttons in IE are still bigger, but not grossly so, and they no longer bump up against each other like the did before, so they look acceptable. (Got the above doctypes from the link I found here: http://groups.google.com/group/google-web-toolkit/msg/bca2b847b68957b2) Any ideas about which of the above two doctypes (or some others) are better? They both seem to work fine as far as I can tell at this point, except that some of my text sizes changed in FF (which I suppose I can fix by following some of your other suggestions). On Sep 12, 9:47 pm, Ian Bambury ianbamb...@gmail.com wrote: Two things - GWT themes are only there (mostly) to style GWT widgets AFAICT, they are not a complete cross-browser solution to all css differences. Maybe one day. Buttons are browser and OS dependent and whatever you do, you'll never get a Safari button to look like an IE button. So... I'd suggest you add your own css before the theme to level all the browsers and then build up the defaults you personally want - including button text size (this is probably THE most useful thing you can do to reduce css problems, that and a proper doctype). And if you want to have buttons look the same in all browsers, use the GWT PushButton. HTH Ian http://examples.roughian.com 2009/9/13 John Gunther johncurtisgunt...@yahoo.com I've noticed that in IE buttons are noticeably larger using the standard GWT CSS theme than these buttons are in other browsers. This makes consistent cross-browser sizing difficult for me. Just eyeballing I'd say the IE buttons are around 50% wider and taller than in the other browsers. For example, Buttons with plenty of space between them in FF look squeezed together in IE, and so on. Questions: Have you seen this behavior (or is it just me)? Do you know why it happens? Simple fix that makes the IE buttons closer to the FF buttons in size? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
[gwt-contrib] Re: GWTCanvas status?
On Wed, Jul 29, 2009 at 12:22 PM, Ray Cromwell cromwell...@gmail.comwrote: On Wed, Jul 29, 2009 at 8:57 AM, Joel Webber j...@google.com wrote: Is VML performance really that bad? I'm quite sure you've done a lot more testing than I have :) My understanding has always been that it sucked miserably for implementing a direct-mode API like Canvas, largely because of the obvious and inherent abstraction-inversion problems. But if you're implementing a retained-mode SVG-like API, I thought it's performance was fairly reasonable. But that's largely assumption on my part, and could well be wrong. I think it is reasonable for applications for which retained-mode SVG is ideally suited: apps where not much graphically changes on each update and for which hit-detection/clicking/picking is important. That is, if you're doing Visio in the browser, it'll probably work. Personally, and this is just my perspective, the immediate-mode API brings with it implications of performance and application type. After all, if I'm going to go through all the trouble of maintaining draw order, rendering loops, and hit-detection manually, I'm either a glutton for punishment, or there's an expectation it's going to be faster. I've long through we should have the equivalent of O3D for 2D in GWT, an O2D API, whereby, one constructs a scenegraph, can tag bits for immutability, and then ask the API to render it, which could pick SVG or Canvas depending on object types. That is, I think GWTCanvas is the wrong abstraction to encourage people to develop the kinds of apps that VML or SVG is good at. They should be writing code this like: scene.beginUpdate(); Circle c=new Circle(radius); c.setStyle(styleObject); c.addClickHandler(...); scene.add(c); Stroke s = new Stroke(); s.addPoint(x,y); s.curveTo(x2,y2); scene.add(s); scene.doneUpdate(); Brad's stuff looks great, and I really like the idea of using Flash's renderer, which does indeed not suck. My biggest concern, however, is that any interaction with the SVG DOM could be abysmally slow, as it would appear that it has to go back and forth between js and flash, which is really, really slow. Thoughts? I've heard it's gotten faster in later HTML5 browsers, but it's probably very slow between Flash/IE6. The issue with IE6 isn't just VML, it's also the performance of JS for updating lots of stuff at a decent Hz. In Chronoscope, if I substitute a NullCanvas (no drawing actually done), performance is still sub-par. The interesting thing about SVG Web IMHO isn't its performance for real time updates of lots of draw changes, it's that it has far more capability than VML emulation layers. In other words, VML is a subset of Canvas, but SVGWeb is actually a super-set and can do stuff that canvas can't. -Ray On Wed, Jul 29, 2009 at 11:43 AM, Ray Cromwell cromwell...@gmail.comwrote: Another crazy possibility is to use Brad Neuberg's SVGWeb ( http://code.google.com/p/svgweb/). He's implemented almost 100% of SVG and SMIL in Flash plus a JS wrapper, so as to enable HTML5 features in IE6. I have to say that the demos are very impressive. IMHO, IE6+VML is a lost cause for all but the most simple of graphical apps. The performance of the JS as well as VML is so gimped, that even if you get stuff working and looking the same, it'll likely be disappointing from a UI latency perspective. It's like writing a video game that has to simultaneously run on a 4-core 3Ghz x86 with latest GPU, and a Pentium3 system with VGA graphics. You either have to provide two rendering loops, one with the amount of stuff cut way way back, or make the lesser system unplayable. On Wed, Jul 29, 2009 at 7:52 AM, Joel Webber j...@google.com wrote: I agree that it's probably best to go ahead and fix the bugs in GWTCanvas that are likely to show up in any SVG/VML translation. And while I don't think anyone's actually worked out the performance of excanvas.js vs GWTCanvas, but I'm more concerned with getting a respectable SVG/VML layer implemented than with trying to chase the fool's errand of building the Canvas API on top of VML, where there will always be cases that perform horribly. @Jaime, Dan: What do you guys think? I know the ball's still in my court to help get Dan's work reviewed and ready for public consumption, but in the meantime taking fixes for GWTCanvas seems sensible. On Wed, Jul 29, 2009 at 2:05 AM, John Gunther johncurtisgunt...@yahoo.com wrote: I added a patch to fix the GWTCanvas bug that caused me the most grief: http://code.google.com/p/google-web-toolkit-incubator/issues/detail?i... Turned out, this problem was a basic one with IE's VML support: right after you apply DOM.removeChild to remove a child that contains VML, the fill and stroke colors, as well as the stroke widths that you so laboriously constructed during
[gwt-contrib] Re: GWTCanvas status?
Appreciate your replies, I now have a much better sense of where GWT vector graphics is heading. With my use of GWTCanvas, the fact that there was a per-pixel memory cost with the canvas tag (that does not exist with VML) forced me to do some extra work to shrink-wrap the canvas around each rendered curve. So, I can imagine how having everything sort of work like VML (element based rather than pixel based) could be a big consistency plus. I also found Ray's argument that many have tried to emulate canvas with VML and failed convincing. On the other hand: o The use of Flash would create a new proprietary dependency that does not exist with GWTCanvas at present. o Though my vector graphics needs were limited (I only required a canvas subset) I was able to do everything I wanted to using GWTCanvas (though working around the IE bugs was a pain). o Relative to other browsers, with the feature subset I used, IE's vector graphics rendering isn't nearly as slow as its HTML rendering. So, once I figured out I needed to minimize stroke count, I was happy with the IE rendering performance of GWTCanvas. From the perspective of a black-box user of GWTCanvas, except for the IE bugs (which I was able to work around) it met my application's needs well. Without it GChart would still be stuck in the visual getto of HTML-only rendering. So I hope any improved system will preserve GWTCanvas' many good features, such as being packaged as a Widget, and having a reasonably low cost per widget (which made it possible for me to give each curve it's own GWTCanvas, and update them independently). My totally biased operational definition of if any new vector graphics library is 'good': when I implement GChartCanvasLite using the new library, my live demo and tests will 'just work', and run as fast or faster than with the GWTCanvas based implementation. On Jul 17, 7:33 am, Joel Webber j...@google.com wrote: Ray's basically right about this -- you can't simulate canvas on vml (extant attempts to do so with limited success notwithstanding). When GWTCanvas was originally designed, SVG performance on some browsers was absolutely atrocious, while Canvas and VML were basically acceptable. So Jaime and I attempted to design an API that would use Canvas and VML for a rendering layer, while trying to nudge the developer towards a use pattern that would work well in practice. Since then, the situation has changed quite a lot. SVG performance on Gecko, WebKit, and Opera has finally gotten up to speed, making it possible (or at least a *lot* easier) to build a sensible scene-graph API that uses just VML and SVG. I strongly believe this will end up being a better API, because the rendering back-ends will be (more or less) equally capable and similarly constructed. Dan Rice (cc'd) has started working on this approach, but it may be a little while before it sees the light of day. In the meantime, if you have patches for any of the issues you listed in GWTCanvas, don't hesitate to let us know. Cheers, joel. On Fri, Jul 17, 2009 at 12:04 AM, Ray Cromwell cromwell...@gmail.comwrote: The only realistic way to truly emulate canvas on IE is to use Flash. VML just doesn't cut it. Even after lots of community effort on excanvas.js, it still falls short of even the old Canvas that Safari first exported, and that doesn't even take into account that performance is pretty bad too. Silverlight could be a deferred binding option as well, but Flash has 95% penetration and would work in a majority of cases. You could still fallback to VML in some of those intranet settings that don't allow plugins, but as you say, you'd have to bifurifcate the Canvas API into what's supportable by VML and what's supportable by everything else, and code your draw paths to deal with them separately. Even with Flash, there's some stuff like fetching or setting pixel data that would be quite slow, in that regard, I think image processing ops should be encoded declaratively in a scenegraph, much like Java2D/JAI Renderable, and shipped over to Flash for execution rather than trying to bring them into the browser's JS engine. -Ray On Thu, Jul 16, 2009 at 8:36 PM, John Gunther johncurtisgunt...@yahoo.com wrote: There are a number of GWTCanvas bug reports that are still categorized as New, some several months old, some submitted by me. http://code.google.com/p/google-web-toolkit-incubator/issues/list?can... Has anyone looked at these yet? Anyone have plans to fix any of them (or are there any fixes that have not yet been committed yet?) I've also noticed a project called gwt-canvas (http://code.google.com/ p/gwt-canvas/ http://code.google.com/%0Ap/gwt-canvas/) Are the two projects related in any way (they list a gwt.team.jaimeyap as a contributor, though not jaime...@google.com. Presume they are the same person, right)? I was thinking of trying to better understand and maybe even fix
[gwt-contrib] Bifurcate GWTCanvas feature set like RichTextArea does it?
RichTextArea supports a basic and an extended feature set: http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/RichTextArea.html I imagine this approach was taken because the RichText capability gap was too large cross browser to feasibly emulate everything in the worst browsers. Would it make sense to take the same approach with GWTCanvas? (The vector graphics capability gap between IE6 and FF3 may also be too large to be feasibly spanned via emulation alone). For example, Client-side GChart has gained a lot of value from this relatively small subset of GWTCanvas's features: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChartCanvasLite.html Many flowsheet simulation packages could also be comfortably implemented via some such subset (plus the standard GWT Widgets, of course). If such a bifurcation allowed GWTCanvas to graduate from the incubator much faster, I think it would be worthwhile. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] GWTCanvas status?
There are a number of GWTCanvas bug reports that are still categorized as New, some several months old, some submitted by me. http://code.google.com/p/google-web-toolkit-incubator/issues/list?can=2q=GWTCanvascolspec=ID+Type+Status+Priority+Milestone+Owner+Summarycells=tiles Has anyone looked at these yet? Anyone have plans to fix any of them (or are there any fixes that have not yet been committed yet?) I've also noticed a project called gwt-canvas (http://code.google.com/ p/gwt-canvas/) Are the two projects related in any way (they list a gwt.team.jaimeyap as a contributor, though not jaime...@google.com. Presume they are the same person, right)? I was thinking of trying to better understand and maybe even fix some of the bugs I reported but wanted to make sure I was not missing anything first. Thanks for any info you can provide. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
Client-side GChart 2.5: Faster, sharper, GWTCanvas-rendered, pie, line and area charts.
Client-side GChart lets you add charts to your GWT applications with nothing more than its 3,000 or so lines of Apache 2.0 licensed Java. GChart 2.5 adds a GWT canvas rendering option for better looking, more quickly drawn, alpha-transparent, pie, line, and area charts. Homepage (live-demo, downloads, docs): http://gchart.googlecode.com Additional features include improved chart print-ability, inside/ outside/centered ticks, improved plot-area clipping, and faster single- curve updates. For details, see the 2.5 release notes: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p5features.html Related links: 1) Maybe some Pie charts? eheheh - Ping http://groups.google.com/group/Google-Web-Toolkit/msg/bc5d585989ab9f6e The above post predicted I'd need to use canvas for pie slices and such well over a year ago. Thousands of banded-filled slices, aliased lines, and one GWTCanvas later...I agree. 2) Many have mentioned GChart's graphical quality limitations: I saw gchart but I need pie charts that are completely filled - plcoirier, see: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3cc6eb7516777ba0/c8564523c005d668?#c8564523c005d668 If you can live with somewhat not-so-sexy graphs (especially pie charts), GChart (http://code.google.com/p/gchart/) is pretty easy to integrate into a GWT app. - Ravi Mundoli, see: http://groups.google.com/group/Google-Web-Toolkit/msg/a4de63397dd71b7e At http://yoxel.com GChart is only used for our burn-down chart (during iteration tracking). I experimented quite a bit with GChart for the dashboards but the pie charts still looked much better when server-generated with our other package (also server generated version was faster). - Alexey, see: http://code.google.com/p/gchart/issues/detail?id=11#c9 It's still not Flash, but at least it now has a decent pie slice. 3) The incubator's GWTCanvas: Valuable but buggy. GWTCanvas: http://code.google.com/p/google-web-toolkit-incubator/wiki/GWTCanvas Without a library like GWTCanvas, the enhancements of this release would never have been feasible, since implementing a cross-browser vector graphics abstraction is way out of GChart's scope. Though very useful as-is, I spent a few days (at least it felt like a few days) just working around the following GWTCanvas bugs: http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=241 http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=275 http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=278 http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=281 http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=282 A fully debugged GWTCanvas in the standard GWT distribution would also greatly simplify GWT flowsheet modeling, games, etc. If you agree, you can vote for (star) this issue in the GWT issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=1554 John C. Gunther http://gchart.googlecode.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
GWTCanvas: Can I stroke a line that replaces what was there before with transparent pixels?
I'm using GWTCanvas in the gwt-incubator: Say I draw a filled red rectangle. Next, I create a line across that rectangle's diagonal. Now, I could set that line's color to green, blue, etc. and stroke and get a diagonal line. But I don't seem to be able to set that line's color to transparent so that I get an empty diagonal line that shows whatever else might be underneath the canvas on the page, etc. I guess another way to put this is that I need a clear for stroked paths. More useful example: Stroke a thick path, change to a thinner thickness, restroke same path with transparent pixels. Now you've got an empty tube around the path (drawing two || lines to create such a tube is much harder). Is this possible with GWTCanvas now? If not, is it feasible to add the capability? GWTCanvas: http://code.google.com/p/google-web-toolkit-incubator/wiki/GWTCanvas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
GWTCanvas vs gwt-canvas ?
What's the difference between GWTCanvas (in the incubator) and gwt- canvas? GWTCanvas: http://code.google.com/p/google-web-toolkit-incubator/wiki/GWTCanvas gwt-canvas: http://code.google.com/p/gwt-canvas/ Overall, GWTCanvas is working well for me, but I'm a bit unhappy with its IE performance in the rendering of bordered rectangles (playing around with some test code, it seemed at one point that, in IE only, simple HTML element rendering of a bordered rectangle was actually just a bit faster than using GWTCanvas; GWTCanvas is much faster in IE for more complex shapes that would require many HTML elements, like pie slices, though). Would gwt-canvas be faster for IE bordered rectangle rendering? Is it worth trying? How is it different/better than the incubator's GWTCanvas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GWTCanvas, in a nested Grid == buggy shifts in x-coordinates in IE7. Workarounds?
I filed an issue with the GWT incubator project that reproduces this problem with a much simpler chunk of code (all you need is a single grid, no nesting required) than where I initially found it in the more complicated code: http://code.google.com/p/google-web-toolkit-incubator/issues/detail?id=275 Pretty sure it's a GWTCanvas bug. In the issue above I provide code to reproduce it and a workaround. John On May 6, 12:43 am, John Gunther johncurtisgunt...@yahoo.com wrote: I'm using a GWTCanvas widget inside of div inside of...inside of a Grid widget inside of another Grid widget inside of...etc. It all works just fine in Firefox. But in IE7 I'm finding that, unless I left-align the innermost Grid cell, the x-coordinates are getting mangled, shifting the stuff drawn inside the canvas (in this case, they are pie slices, but I have also seen it with rectangles in an earlier test with somewhat less nesting...but still with those same two nested Grids) along x inappropriately. Oddly, the canvas itself is positioned correctly, it is as if the drawn elements within it are dragged to the right-in some cases (right- aligned) entirely off the canvas, in others (center-aligned) seems about half-way. I'm seeing this within a complex nested DOM structure, have not yet tested if any old Grid cell would produce this problem. Other, similar, stuff, not nested in a Grid (but nested in divs only) renders just fine in both FF and IE, The outer Grid is hidden and the inner is visible, which is kind of an unusual combination and thus could have something to do with it, perhaps? Has anyone seen anything like this before? Any workarounds (nothing I've tried so far to beat this has worked). John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
GWTCanvas, in a nested Grid == buggy shifts in x-coordinates in IE7. Workarounds?
I'm using a GWTCanvas widget inside of div inside of...inside of a Grid widget inside of another Grid widget inside of...etc. It all works just fine in Firefox. But in IE7 I'm finding that, unless I left-align the innermost Grid cell, the x-coordinates are getting mangled, shifting the stuff drawn inside the canvas (in this case, they are pie slices, but I have also seen it with rectangles in an earlier test with somewhat less nesting...but still with those same two nested Grids) along x inappropriately. Oddly, the canvas itself is positioned correctly, it is as if the drawn elements within it are dragged to the right-in some cases (right- aligned) entirely off the canvas, in others (center-aligned) seems about half-way. I'm seeing this within a complex nested DOM structure, have not yet tested if any old Grid cell would produce this problem. Other, similar, stuff, not nested in a Grid (but nested in divs only) renders just fine in both FF and IE, The outer Grid is hidden and the inner is visible, which is kind of an unusual combination and thus could have something to do with it, perhaps? Has anyone seen anything like this before? Any workarounds (nothing I've tried so far to beat this has worked). John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Easiest way to package a library with optional features requiring a sub-library?
I'm late to reply as usual but really appreciate the info. Will likely revise my planned approach along the lines you have indicated to use deferred binding. On Apr 19, 7:46 pm, Thomas Broyer t.bro...@gmail.com wrote: On 18 avr, 07:42, JohnGuntherjohncurtisgunt...@yahoo.com wrote: Thanks for the great info, sorry I didn't see your reply till now. I think your first idea would not work in my case because I would have to have code that referenced the optional module even if they didn't use it (there are if (usingOptionModule) do this by invoking its methods otherwise do something else kinds of constructs in there) So they would always have to include the module anyway, or the compiler would complain about the method invocations not being defined? Right. I've never used deferred binding before (except what GWT does automatically) but had begun to read up on it (Hanson and Tacy's GWT in Action and Dewsbury's Google Web Toolkit Applications both cover it) after making my post. Your set-property variant seems like it would be the nicest for users. I've never compiled anything that had multiple variants (say for different browsers) but where I only had selected a single one of them...I've always just let GWT crank out all the various permutations. The compiler won't complain that the code for actually implementing the value=true option isn't available if I only actually use the value=false setting? It won't. It just grabs the replace- with I actually selected for and ignores the other ones..does not attempt to verify that my module is correct regardless of the specific property setting some specific user may have selected? No, it only compiles (and checks) what you tell it to compile. (maybe the -validateOnly would do it, but wouldn't bet on it) BUT...how can it know before it gets used which properties will be specified, so it seems that it must check that all the code for any permutation is available, since a module that has a true option and associated replace-withs has to provide the code to implement that option, too, since someone might use it with true. If you call the compiler, it means you're compiling an application, so checking other permutations would be useless (woudl take time without any impact on the output; would you like the compiler throwing an error for something you're actually not compiling?). The compiler doesn't know about libraries. That implies I somehow have to physically bundle the optional module with my module, No. So what I am leaning towards now is defining an ordinary Java interface (IOptionalLibraryObjectFactory) that creates instances of the optional library's objects that users of the optional library must implement (I tried this, and it does work). If they don't implement it, there are no refs to the optional library and I compile without error. Problem with this approach (at least the way I've tried it) is users end up having to add a good deal of boilerplate Java code to use the optional library. Try the deferred-binding way and judge by yourself ;-) If you check out chapter 10 of Google Web Toolkit Applications there is an example there that maybe would do everything I'd need, but it involves actually generating the said boilerplate automatically via putting stuff in the rebind folder, generate-with clauses, etc. and that just seemed like too much work...if it's that hard maybe wiser to make the users of my library paste in their own boilerplate and concentrate on just making it easy for them to grab that boilerplate? Using simple replace-with deferred bindings as I proposed is much simpler and less error-prone thatn generating code that's probably not needed... (just replace your if(useOptionalModule) structures with 2 classes (the one using the useOptionalModule could eventually inherit the other) and a replace-with rule; if the class to be split is public, refactor to use a helper internal class and split that one, so that your users won't have to use GWT.create()) For best performances, your internal helper classes should be singletons (private static class, instantiated once only in a private static final field); the compiler should then inline the helper's methods and your helper's class won't exist at all in the compiled JS. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How much slower is PRETTY mode?
A while back I was doing some performance tests and my recollection was, for that application, in FF2, it was something like 10% slower in PRETTY. This was with GWT 1.4. Not a lot, but just enough that I decided not to performance test in PRETTY. (The big performance impact in FF2 is if Firebug is completely disabled or not. Firebug must be completely disabled (via Tools/ Addons) with a FF restart to get the real numbers (plus just about everything looks like it has a memory leak with Firebug on)) John On Apr 19, 10:20 am, Dobes Vandermeer dob...@gmail.com wrote: Okay, that's helpful. Maybe it's worth slowing down the downloads for a while to get some better insight into some of the errors customers are getting, since it'll allow me to read the stack traces Firefox includes in the exceptions. On Sun, Apr 19, 2009 at 1:46 AM, Vitali Lovich vlov...@gmail.com wrote: I just listened to the talk - didn't hear him say anything regarding performance of long name vs short names. The execution difference for smaller names shouldn't exist for the new generation of browsers using JIT for javascript (i.e. FF3.5, Safair 4, Chrome). Even with older browsers, I don't see it being super significant - 1-2% at most if it's even measurable. The execution of the javascript code by the interpreter should far outweigh the cost of tokenizing the input even if you have a 100 character name. The cost of doing a 100 byte memcpy should be insignificant compared to all the other stuff the interpreter must do. However, I could be wrong - I haven't tested this in any way, so hard numbers from real-world examples would probably be best. On Sun, Apr 19, 2009 at 12:25 AM, Arthur Kalmenson arthur.k...@gmail.com wrote: I don't know the exact numbers. But if I remember correctly, during Bruce's presentation, Faster-than-Possible Code: Deferred Binding with GWT ( http://sites.google.com/site/io/faster-than-possible-code-deferred-bi... ) at Google I/O 2008, he mentioned something about smaller function and variable names executing faster then longer names. Also, as Vitali said, you're code is going to be rather bloated. We were accidentally running one of our apps in PRETTY and found the before compression size was 3 MB and after compression was 400kb. When we changed to OBF, the before compression size was 500kb and compressed was somewhere around 120kb. What's the reason that you want to run it as PRETTY? If you want to make the functions callable from regular JS, you should take a look at Ray Cromwell's excellent GWT Exporter project: http://code.google.com/p/gwt-exporter/ -- Arthur Kalmenson On Sat, Apr 18, 2009 at 1:46 AM, Vitali Lovich vlov...@gmail.com wrote: I believe that it should be the same performance in terms of execution. You're download times will probably suffer - I wouldn't be surprised if the code bloats by 2-3x if not more. On Fri, Apr 17, 2009 at 11:40 PM, Dobes dob...@gmail.com wrote: I'm considering deploying a version in PRETTY mode since it may solve a Safari 4 issue I'm having and it would also allow me to interpret the stack traces produced by Firefox a lot better. However, I'm wondering what experiences people have had with the performance of PRETTY more - how is it? Thanks in advance, Dobes -- Dobes Vandermeer Director, Habitsoft Inc. dob...@habitsoft.com 778-891-2922 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Easiest way to package a library with optional features requiring a sub-library?
Thanks for the great info, sorry I didn't see your reply till now. I think your first idea would not work in my case because I would have to have code that referenced the optional module even if they didn't use it (there are if (usingOptionModule) do this by invoking its methods otherwise do something else kinds of constructs in there) So they would always have to include the module anyway, or the compiler would complain about the method invocations not being defined? I've never used deferred binding before (except what GWT does automatically) but had begun to read up on it (Hanson and Tacy's GWT in Action and Dewsbury's Google Web Toolkit Applications both cover it) after making my post. Your set-property variant seems like it would be the nicest for users. I've never compiled anything that had multiple variants (say for different browsers) but where I only had selected a single one of them...I've always just let GWT crank out all the various permutations. The compiler won't complain that the code for actually implementing the value=true option isn't available if I only actually use the value=false setting? It just grabs the replace- with I actually selected for and ignores the other ones..does not attempt to verify that my module is correct regardless of the specific property setting some specific user may have selected? BUT...how can it know before it gets used which properties will be specified, so it seems that it must check that all the code for any permutation is available, since a module that has a true option and associated replace-withs has to provide the code to implement that option, too, since someone might use it with true. That implies I somehow have to physically bundle the optional module with my module, something I'm trying to avoid. So what I am leaning towards now is defining an ordinary Java interface (IOptionalLibraryObjectFactory) that creates instances of the optional library's objects that users of the optional library must implement (I tried this, and it does work). If they don't implement it, there are no refs to the optional library and I compile without error. Problem with this approach (at least the way I've tried it) is users end up having to add a good deal of boilerplate Java code to use the optional library. If you check out chapter 10 of Google Web Toolkit Applications there is an example there that maybe would do everything I'd need, but it involves actually generating the said boilerplate automatically via putting stuff in the rebind folder, generate-with clauses, etc. and that just seemed like too much work...if it's that hard maybe wiser to make the users of my library paste in their own boilerplate and concentrate on just making it easy for them to grab that boilerplate? John On Apr 6, 10:21 am, Thomas Broyer t.bro...@gmail.com wrote: On 6 avr, 04:31, JohnGuntherjohncurtisgunt...@yahoo.com wrote: Sorry, for late reply, I just saw your post. I think you are correct. But, my goal is to eliminate the need for users to physically add the extra JAR file associated with the optional library to their project (unless they need the optional features it provides). What I want is: o Just 1 JAR distributed by me. o Code for optional library in separate JAR distributed/maintained by others o Users of my library don't have to physically mess with the optional JAR (no need to download it, place it on build path, or add an inherits clause) if they don't use those optional features in their code. Ideally, my code might even somehow check if the optional library is available. If so, it uses it, otherwise it uses the built-in fallback. But it would be OK if the developer using my library would just tell it if the optional library is to be used or not. Can't you put those optional features into another module that developers would only inherit if they want to (and thus would have to pull the third-party JAR and put it in the classpath only when opting- in)? If you don't want (or can't, for whichever reason) separate the optional features in a distinct module, than you can use deferred- binding; and opting-in could be either: - inheriting another module containing the appropriate replace-with mappings - setting a property (set-property) to a specific value (this property having been set to a default value in your module) which would trigger different replace-with rules (all in the same module), e.g. your module contains (along with all the needed generate-with mappings) define-property name=use.optional.features values=true,false/set-property name=use.optional.features value=false/, and the developer opts in by adding this line to his module: set-property name=use.optional.features value=true/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to
Re: Easiest way to package a library with optional features requiring a sub-library?
Sorry, for late reply, I just saw your post. I think you are correct. But, my goal is to eliminate the need for users to physically add the extra JAR file associated with the optional library to their project (unless they need the optional features it provides). What I want is: o Just 1 JAR distributed by me. o Code for optional library in separate JAR distributed/maintained by others o Users of my library don't have to physically mess with the optional JAR (no need to download it, place it on build path, or add an inherits clause) if they don't use those optional features in their code. Ideally, my code might even somehow check if the optional library is available. If so, it uses it, otherwise it uses the built-in fallback. But it would be OK if the developer using my library would just tell it if the optional library is to be used or not. I think that if my code contains explicit references to the external library, the GWT compiler will complain about classes that don't exist (even if users of my library never call that code) unless that optional JAR is on the build path, etc. The fact that the compiler may eliminate the dead code in the end doesn't eliminate the hassle of having to add a JAR you are not using to your build path, etc. just to make the compiler happy. I realize this is a relatively small hassle but every little bit helps. I don't want to just bundle the code from the optional library into my JAR (as I've seen some projects do) because I can't control when the optional library guys release their next version, and don't want to release a new version of my library every time they do. John On Mar 15, 8:10 pm, Vitali Lovich vlov...@gmail.com wrote: I may not be understanding your question. GWT will compile your code into whatever Javascript is actually used. So when GWT compiles your user's code, if they don't use the parts that rely on the optional library, they won't get that library automagically, AFAIK, by the GWT compiler recognizing this. Caveat: The inherits stuff in the module configuration might still cause code to be compiled, but the dead-code elimination in the compiler should cause it to not be included in the result, thus your user's code should have those optional libraries omitted. If you care about compilation-speed, you'd have to have the user edit your gwt.xml file to include only the modules used by your code they rely on. Perhaps someone more familiar with the internals of the gwt compiler can comment as to whether or not my explanation is correct or way off base. On Sun, Mar 15, 2009 at 12:28 AM, John Gunther johncurtisgunt...@yahoo.comwrote: Is it possible to release a GWT library that has optional features that require an additional library (written by someone else, packaged in a module JAR) but that does not require its users to load that additional library if they don't need the optional features? What is the best way to do this that results in users of the library having the least number of steps to configure it with or without the optional features? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Easiest way to package a library with optional features requiring a sub-library?
Is it possible to release a GWT library that has optional features that require an additional library (written by someone else, packaged in a module JAR) but that does not require its users to load that additional library if they don't need the optional features? What is the best way to do this that results in users of the library having the least number of steps to configure it with or without the optional features? John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Putting widget on top of gchart
Thanks for reporting back, glad that helped. I'm not aware of an easier or more element-efficient way to do what you are doing than those I proposed. Thanks for the suggestion re: direct way to change individual point styles, etc. without adding a new curve. No way to do that with current product, but, in light of your example, a great idea for a future feature addition. I'm currently planning GChart 2.5 and if possible will try to work it into that release. Please consider adding it to the GChart issue tracker. Will also try to improve how GChart reduces model coordinates into pixels, in a future release. Incidentally, it's best to post future very GChart-specific questions directly to the GChart issue tracker (there are only 21 issues to date, so to keep things a bit simpler, it doubles as GChart's forum, too). This general GWT forum is best for GChart-related questions where you need to draw responses from non-GChart users, too (comparing alt charting approaches in GWT, for example). http://code.google.com/p/gchart/issues/list John C. Gunther On Feb 24, 2:11 pm, Paul Wang sec...@gmail.com wrote: Thanks for the workaround. Changing symbol to VBAR_BASELINE_CENTER and then setBaseline makes the semi-transparent images work now. I'll use this method for the short term. It certainly would be simpler if I didn't have to create another curve since it does add to the number of rendered elements on the web page. Is it possible to change the symbol at individual points? Originally I wanted to dim the color of certain points but couldn't find a method to do that. Is there an example for me to look at? I also looked at annotation but unfortunately didn't seem to be able to satisfy my requirement at this time. The functionality does seem really useful though. Thanks. -- Paul Wang On Feb 20, 4:37 pm, John Gunther johncurtisgunt...@yahoo.com wrote: I played around with GChartExample21.java (available in the chart gallery and linked to in my previous post) a bit, and was able to produce a 1px overlap between adjacent bars that I think is consistent with the problem you reported. I also found that I could eliminate this 1px adjacent bar overlap by changing the following lines inGChart.java: VBarBottom(int wm, int hm) { super(wm, hm,0.5,0.5,0.5,0.5); } To instead read: VBarBottom(int wm, int hm) { super(wm, hm,0.0,0.0,0.5,0.5); } The 0.5s adds a half pixel widening to the left and right edges of the symbol. This is intended to make symbol edges align better with the gridlines, and is helpful in some other cases, too, but this half pixel padding seems to be causing the 1px overlap, and that appears to be preventing you from doing what you want to do. The easiest way to eliminate the 1px overlap that I found (without changing theGChart.java source code) was to switch from SymbolType.VBAR_SOUTH to SymbolType.VBAR_BASELINE_CENTER. This works because the VBAR_BASELINE_CENTER symbol type's constructor does not have the 1/2 pixel padding (it already has 0,0 instead of 0.5, 0.5). To make the VBAR_BASELINE_CENTER symbol type in other respects behave the same as VBAR_SOUTH, you'll have to set the baseline of the curve so that it equals the minimum value displayed on the Y axis, for example, via something like: getCurve().getSymbol().setBaseline(theMinValueShownOnTheYAxis); Will try to correct the root cause (not sure I fully understand that yet, BTW) in a future release (maybe via a feature that let's you explicitly control if the 1/2 px padding is present? If you have suggestions, I'm interested to hear them). Submit this problem to theGChartissue tracker if you don't want to let me forget it. Thanks for taking the time to create a test and report the problem that you found (I never considered this particular usage scenario of translucent overlapping bars before your post). Getting back to your original problem, it might be simpler to create 20 1-point curves and just change the background color or other features of each symbol/point/curve to represent the enabled or disabled state, rather than the two-curve strategy I suggested earlier (this is almost certainly a simple/better approach if you only have 20 bars on the chart, and you are not planning to use a chart key). Finally, the simplest way to indicate that some of these bars are not like the others is via setAnnotationText or setAnnotationWidget, especially if you are flexible about the way that such differences get indicated (e.g indicating such differences via a label, a small icon at the center of each bar, etc.) John On Feb 17, 2:37 pm, Paul Wang sec...@gmail.com wrote: Thanks for the idea. I tried it out and it seems like it would work except that the bars seems be overlap a bit. In the example below the bars have width of 53px but are positioned
Re: Client-side GChart 2.4 Released: Click events, pop-ups, selection brushes, etc.
The follow-up Client-side GChart 2.41 release adds methods to help those who need to create points at the mouse location or convert between client-window (pixel) and chart-data (model) coordinates. The new LayZLine(tm) Chart Editor on the live demo illustrates how you can use v2.41's getMouseCoordinate method, along with other features introduced in v2.4, to create a simple line chart editor with just 45 semicolon-terminated code lines. GChart 2.41 Release Notes: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p41features.html Updated Live Demo: http://gchart.googlecode.com/svn/trunk/live-demo/v2_41/com.googlecode.gchart.gchartdemoapp.GChartDemoApp/GChartDemoApp.html Original post in this forum requesting the client/model conversion features: http://groups.google.com/group/Google-Web-Toolkit/msg/80301715acb6f719 John C. Gunther http://gchart.googlecode.com On Feb 2, 12:52 pm, John Gunther johncurtisgunt...@yahoo.com wrote: Thank-you, very glad you appreciate the new release. On Feb 2, 8:59 am, saurabh hirani saurabh.hir...@gmail.com wrote: Checked out the page. I had used 2.3 and seeing pop up integration and on the fly editing of pie chart sizes was really cool. Great stuff. Congratulations and all the best with makingGChartbigger and better. On Jan 28, 10:41 am, John Gunther johncurtisgunt...@yahoo.com wrote: Client-sideGChartis an open source, 100% pure Java chart library for GWT supporting line, pie, and bar charts. With version 2.4,GChartnow tracks mouse activities over the chart, and selects points, displays pop-ups, and fires off click events accordingly. HomePage:http://gchart.googlecode.com Live demo:http://gchart.googlecode.com/svn/trunk/live-demo/v2_4/com.googlecode Release notes:http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/clie... Mouse over and click on the live demo to see the new features in action. Beyond that, the release notes describe every change, and link back to the new features' javadocs and sample code. John C. Gunther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to add points in chart by clicking on different areas of it?
GChart 2.41 is out and it incorporates a getMouseCoordinate method and adds an improved version of the simple line chart editor I linked to above to the Chart Gallery and live demo. Thanks for adding your request for these features to the GChart issue tracker. See this related post for more details about v2.41: http://groups.google.com/group/Google-Web-Toolkit/msg/137e190dfa0c17af John On Feb 3, 11:20 am, saurabh hirani saurabh.hir...@gmail.com wrote: On Feb 2, 6:54 pm, saurabh hirani saurabh.hir...@gmail.com wrote: Hi John, Just added a new example chart titled World's Simplest Line Chart Editor that shows you how to add points to a Client-sideGChartcurve by clicking on empty space on the chart (you'll need to download the latest v2.4 version of Cllient-sideGChartto use this code): Code:http://gchart.googlecode.com/svn/trunk/gcharttestapp/src/com/googleco... Screen-shot:http://gchart.googlecode.com/svn/trunk/gchart/src/com/googlecode/gcha... Thanks a lot for providing such a thorough explanation of how this can be done. I really appreciate your putting in time to answer these queries. I will download 2.4 and check it out. Basically, I wanted to do this because I wanted to highlight an area of an already drawn chart. In the meantime, while I could not know how to do this, I had checked out orkut's photo-tagging feature which allows us to draw a rectangle over an already existing image. While I implemented drawing a rectangle over an image using GWT with client cordinates, I realized that it fails when my image is larger than my browser window. Because as I scroll down or on the side my client cordinates with respect to a reference point at the top are lost. As in, my image's top left edge whose cordinate was say (20, 100) before I scroll is no longer in the frame and (20, 100) becomes the cordinate of the point at the top left of the browser window which is not the top left edge but a portion of the image which came into picture when I scrolled down. I saw that you are using clientX and clientY. So I thought maybe this information would be useful. And due to your example I found the missing piece to my puzzle. getScrollLeft and getScrollTop - I was searching for methods which could give me these cordinates to solve the problem as described above. I was studying your code and I used it in my work of drawing rectangle using GWT and it worked. Thanks a lot. - Saurabh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Putting widget on top of gchart
I noticed this is your very first post to any Google forum. Welcome. GChart 2.4 has a built-in single point selection capability. Here's an example of how to use that: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/package-summary.html#GChartExample21 To emulate multiple selection, you could add a second curve that had the same symbol type (and other properties such as width) as the first (so that it would overlay it) but only included the points (bars) you wanted to be selected. The setImageURL method could then be applied to this second curve, passing in your semi-transparent image. Selection/deselection would then be a matter of adding/removing points to/from this second curve, and calling the update method to refresh the chart. John C. Gunther http://gchart.googlecode.com On Feb 11, 1:38 pm, Paul Wang sec...@gmail.com wrote: Hi, I'd like to put a semi-transparent panel on top of a gchart to show disabled areas of a bar graph. I looked through gchart 2.4 and didn't see anything that'd let me easily find out where bars are located so I can position a panel on top of it. Is there a better way to do this? I also need to do this without any user input (no events). -- Paul Wang --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Client-side GChart 2.4 Released: Click events, pop-ups, selection brushes, etc.
Thank-you, very glad you appreciate the new release. On Feb 2, 8:59 am, saurabh hirani saurabh.hir...@gmail.com wrote: Checked out the page. I had used 2.3 and seeing pop up integration and on the fly editing of pie chart sizes was really cool. Great stuff. Congratulations and all the best with makingGChartbigger and better. On Jan 28, 10:41 am, John Gunther johncurtisgunt...@yahoo.com wrote: Client-sideGChartis an open source, 100% pure Java chart library for GWT supporting line, pie, and bar charts. With version 2.4,GChartnow tracks mouse activities over the chart, and selects points, displays pop-ups, and fires off click events accordingly. HomePage:http://gchart.googlecode.com Live demo:http://gchart.googlecode.com/svn/trunk/live-demo/v2_4/com.googlecode Release notes:http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/clie... Mouse over and click on the live demo to see the new features in action. Beyond that, the release notes describe every change, and link back to the new features' javadocs and sample code. John C. Gunther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to add points in chart by clicking on different areas of it?
Thank, good to know what you were trying to do. Unfortunately, there are not specific tools in GChart that do the drag-selection rectangle thing, or let you highlight more than a single point. There are poor man's ways to do similar things. You might let the user click in the upper left, then lower right, and use the two clicks to define the rectangle. Not quite the same, I know, but doable via the new ClickEvents support. You could add a curve with one point (BOX_SOUTHEAST) and manipulate width and height to draw the selection rectangle after the second click. You might also try using Annotations (which can be widgets centered on the point which overwrite it, for example) on each selected point to represent that fact that they are selected. John On Feb 2, 8:54 am, saurabh hirani saurabh.hir...@gmail.com wrote: Hi John, Just added a new example chart titled World's Simplest Line Chart Editor that shows you how to add points to a Client-sideGChartcurve by clicking on empty space on the chart (you'll need to download the latest v2.4 version of Cllient-sideGChartto use this code): Code:http://gchart.googlecode.com/svn/trunk/gcharttestapp/src/com/googleco... Screen-shot:http://gchart.googlecode.com/svn/trunk/gchart/src/com/googlecode/gcha... Thanks a lot for providing such a thorough explanation of how this can be done. I really appreciate your putting in time to answer these queries. I will download 2.4 and check it out. Basically, I wanted to do this because I wanted to highlight an area of an already drawn chart. In the meantime, while I could not know how to do this, I had checked out orkut's photo-tagging feature which allows us to draw a rectangle over an already existing image. While I implemented drawing a rectangle over an image using GWT with client cordinates, I realized that it fails when my image is larger than my browser window. Because as I scroll down or on the side my client cordinates with respect to a reference point at the top are lost. As in, my image's top left edge whose cordinate was say (20, 100) before I scroll is no longer in the frame and (20, 100) becomes the cordinate of the point at the top left of the browser window which is not the top left edge but a portion of the image which came into picture when I scrolled down. I saw that you are using clientX and clientY. So I thought maybe this information would be useful. I don't know if I could communicate my thoughts clearly. But I will check out your code and I have put in an enhancement request on theGChartissue tracker. regards, Saurabh Hirani. saurabh.hir...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to add points in chart by clicking on different areas of it?
Saurabh, Just added a new example chart titled World's Simplest Line Chart Editor that shows you how to add points to a Client-side GChart curve by clicking on empty space on the chart (you'll need to download the latest v2.4 version of Cllient-side GChart to use this code): Code: http://gchart.googlecode.com/svn/trunk/gcharttestapp/src/com/googlecode/gchart/gcharttestapp/client/GChartExample22.java Screen-shot: http://gchart.googlecode.com/svn/trunk/gchart/src/com/googlecode/gchart/client/doc-files/gchartexample22.png This example will eventually make its way into GChart's Chart Gallery, but for now you have to grab them directly from subversion using the links above.(Don't forget to add the chart to the RootPanel and call the chart's update method--these steps are not included in the code above. See note at top of the Chart Gallery for details), I've pasted in the key lines from this example below, which transform from client to model coordinates. The first two code lines use generic GWT methods that anyone who just need to shift the origin of the client coordinates to the upper left corner of the current element could use (after removing the GChart calls from these two lines): // 1st, translate mouse client x,y coordinates into // pixel distances from upper-left of plot area: double xPx = Window.getScrollLeft() + Event.getCurrentEvent().getClientX() - getAbsoluteLeft() - getYAxis().getAxisLabelThickness() - getYAxis().getTickLabelThickness() - getYAxis().getTickLength(); double yPx = Window.getScrollTop() + Event.getCurrentEvent().getClientY() - getAbsoluteTop() - getChartTitleThickness(); // 2nd, transform those pixel offsets to model units: double x = getXAxis().getAxisMin()*(1-xPx/getXChartSize()) + getXAxis().getAxisMax()*(xPx/getXChartSize()); // note the pixelY-to-cartesianY min/max swap double y = getYAxis().getAxisMax()*(1-yPx/getYChartSize()) + getYAxis().getAxisMin()*(yPx/getYChartSize()); // add point, using the model units: getCurve().addPoint(insertionPoint++, x, y); HTH, John C. Gunther http://gchart.googlecode.com On Jan 28, 12:34 am, John Gunther johncurtisgunt...@yahoo.com wrote: Client-sideGChart2.4 was just released today, It supports click events, so that might help you. Unfortunately, there are still no client to model coordinate conversion functions. Please consider adding a request for this feature to theGChartissue tracker. In the meantime, looking at the setClientX, setClientY, xToPixel, yToPixel internal methods inGChart.java might help you to implement such conversion functions on your own (I had considered adding a clientToModel method within the Axis class for 2.4, which is where I think this fits into the current API). Appreciate hearing that you found the product helpful. John C. Guntherhttp://gchart.googlecode.com On Jan 9, 7:53 am, saurabh hirani saurabh.hir...@gmail.com wrote: Hi all, Thanks for developing a great product likeGChartwhich integrates so easily with GWT and works like charm. I had a query - I want to draw a chart where I can click on any point along the x-y axis to determine the point cordinates in model units. Once I get that, I can do an addPoint() to add the point to the curve. I tried doing that inGChartbut I did not find any methods through which I can handle a mouse click event to get the x-y cordinates in model units. I can get the cordinates by implementing an EventListener for the chart but those cordinates are of the browser window and in different units. So it does not help. How can we accomplish this in GChart? Also, asGChartis a subclass of widget, I can use widget's methods on it. But as Curve, Point are classes enclosed withinGChart, I cannot use widget methods on it. Am I right in saying this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Client-side GChart 2.4 Released: Click events, pop-ups, selection brushes, etc.
Appreciate the positive feedback, thanks for testing it out, looking forward to your report. On Jan 28, 5:40 am, doopa niallhas...@googlemail.com wrote: Good work John. Congratulations on the new release. I'll be testing this later and will be sure to update you. Thanks, niall On Jan 28, 6:41 am, John Gunther johncurtisgunt...@yahoo.com wrote: Client-side GChart is an open source, 100% pure Java chart library for GWT supporting line, pie, and bar charts. With version 2.4, GChart now tracks mouse activities over the chart, and selects points, displays pop-ups, and fires off click events accordingly. HomePage:http://gchart.googlecode.com Live demo:http://gchart.googlecode.com/svn/trunk/live-demo/v2_4/com.googlecode Release notes:http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/clie... Mouse over and click on the live demo to see the new features in action. Beyond that, the release notes describe every change, and link back to the new features' javadocs and sample code. John C. Gunther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: How to add points in chart by clicking on different areas of it?
Client-side GChart 2.4 was just released today, It supports click events, so that might help you. Unfortunately, there are still no client to model coordinate conversion functions. Please consider adding a request for this feature to the GChart issue tracker. In the meantime, looking at the setClientX, setClientY, xToPixel, yToPixel internal methods in GChart.java might help you to implement such conversion functions on your own (I had considered adding a clientToModel method within the Axis class for 2.4, which is where I think this fits into the current API). Appreciate hearing that you found the product helpful. John C. Gunther http://gchart.googlecode.com On Jan 9, 7:53 am, saurabh hirani saurabh.hir...@gmail.com wrote: Hi all, Thanks for developing a great product like GChart which integrates so easily with GWT and works like charm. I had a query - I want to draw a chart where I can click on any point along the x-y axis to determine the point cordinates in model units. Once I get that, I can do an addPoint() to add the point to the curve. I tried doing that in GChart but I did not find any methods through which I can handle a mouse click event to get the x-y cordinates in model units. I can get the cordinates by implementing an EventListener for the chart but those cordinates are of the browser window and in different units. So it does not help. How can we accomplish this in GChart? Also, as GChart is a subclass of widget, I can use widget's methods on it. But as Curve, Point are classes enclosed within GChart, I cannot use widget methods on it. Am I right in saying this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Client-side GChart 2.4 Released: Click events, pop-ups, selection brushes, etc.
Client-side GChart is an open source, 100% pure Java chart library for GWT supporting line, pie, and bar charts. With version 2.4, GChart now tracks mouse activities over the chart, and selects points, displays pop-ups, and fires off click events accordingly. HomePage: http://gchart.googlecode.com Live demo: http://gchart.googlecode.com/svn/trunk/live-demo/v2_4/com.googlecode.gchart.gchartdemoapp.GChartDemoApp/GChartDemoApp.html Release notes: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p4features.html Mouse over and click on the live demo to see the new features in action. Beyond that, the release notes describe every change, and link back to the new features' javadocs and sample code. John C. Gunther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Printing Gchart
Couple of more remarks on printing GCharts that may be helpful. The graphical part of a GChart (unless you are using the optional bolt- on canvas line curve capability) is simply a bunch of images absolutely positioned within a box (via AbsolutePanel). So it seems reasonable that this collection of images should act very similarly to a single image chart on the page from the point of view of printing. Thus there is no logical reason you should not be able to print a page containing a GChart just as easily as you could print a page containing an image-based chart. In theory. Now, under normal circumstances, all those images are the same single 1x1 px blank gif. and the background and border and size are manipulated to produce the rectangles of the chart's parts. If this use of image backgrounds is a problem during printing, GChart has methods that allow you to specify a non-blank default image, plus a different image for each curve. These methods are setBlankImageURL and setImageURL, respectively. and could be used to effectively replace the background color with a real image color (assuming the use of image background colors presented a problem during printing, as it can in FF2). Here are the javadoc links for these two methods, for reference: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.html#setBlankImageURL%28java.lang.String%29 http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Symbol.html#setImageURL%28java.lang.String%29 For example, the dropped axis lines during printing you mentioned might be corrected by passing a 1x1 px black GIF to setBlankImageURL and various 1x1px colored images to setImageURL to define each curve's inside color instead of the usual use of setBackgroundColor (I've not actually tried this, but it should work). The other part of a GChart is the text. These are placed within single- celled tables (for alignment purposes) and those tables are absolutely positioned on the same box. Again, I don't see why this should be significantly different than printing an image-based chart, either (the alignment techniques are--over a reasonable range--font-size independent). HTML and widget-based annotations and such are the wild-cards, opening it up to just about anything. But, presumably, if you built the HTML/ Widget and wanted to print it, you'd be responsible for that (the same table-based aligned positioning used for text is used for HTML/ widgets, so they should stay in appropriate positions on the chart). Unfortunately, I have zero practical experience building printable web pages so all this is just educated guess work; if anyone has real experience with printable pages and is willing to share that experience to help improve GChart's printability, I'd appreciate that. John On Jan 7, 12:13 am, John Gunther johncurtisgunt...@yahoo.com wrote: In Firefox 2, if you select File, Print Preview, then Page Setup, then FormatOptions, and make sure that Print Background (color and images) is checked, I see the live demo page more or less correctly in Print Preview with this checked. But lots of stuff is missing (including axis lines) if this is unchecked (note: default setting is unchecked). GChartuses backgrounds of blank images for much of what it does, which is why you need to check this to get everything to print that shows on the screen in Firefox 2. I don't testGChartfor how well the chart's can be printed in the various browsers (I've never had much luck printing out web pages, period). In the end it is HTML in the browser, so it should be printable to the degree that HTML is, in theory, but it was looking pretty ugly in print preview when I tried to print the live demo page from IE7 just now. FF2 (with the setting above) seemed to do much better. HTH, John C. Guntherhttp://gchart.googlecode.com On Jan 2, 10:57 am, ArunDhaJ arund...@gmail.com wrote: Hi, I'm not able to see the axis lines on printing the chart. In my Bar chart, bars are printing fine, but not able to print lines... Plz help me whether I'm missing any thing.. Thanks ArunDhaJwww.arundhaj.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Printing Gchart
In Firefox 2, if you select File, Print Preview, then Page Setup, then FormatOptions, and make sure that Print Background (color and images) is checked, I see the live demo page more or less correctly in Print Preview with this checked. But lots of stuff is missing (including axis lines) if this is unchecked (note: default setting is unchecked). GChart uses backgrounds of blank images for much of what it does, which is why you need to check this to get everything to print that shows on the screen in Firefox 2. I don't test GChart for how well the chart's can be printed in the various browsers (I've never had much luck printing out web pages, period). In the end it is HTML in the browser, so it should be printable to the degree that HTML is, in theory, but it was looking pretty ugly in print preview when I tried to print the live demo page from IE7 just now. FF2 (with the setting above) seemed to do much better. HTH, John C. Gunther http://gchart.googlecode.com On Jan 2, 10:57 am, ArunDhaJ arund...@gmail.com wrote: Hi, I'm not able to see the axis lines on printing the chart. In my Bar chart, bars are printing fine, but not able to print lines... Plz help me whether I'm missing any thing.. Thanks ArunDhaJwww.arundhaj.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Vertical annotation text in GChart
Couple of things that may help you: 1) To allow more space for long axis labels and thus avoid the overwriting problem you mentioned in the first place, you can explicitly set axis label thickness via Client-side GChart's setAxisLabelThickness method: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Axis.html#setAxisLabelThickness%28int%29 2) A simple way to add vertical (sort of) text is by using HTML within setAnnotationText. This snippet should display the word price vertically: getCurve().getPoint().setAnnotationText (htmlcenterpbrrbribrcbre/center); BTW, same trick works with the setAxisLabel, and addTick methods. If you have trouble getting stuff to align right, try using a mono- spaced font (e.g. surrounding the text with tt/tt). Likely there are better HTML vertical text tricks out there, but this is the only one I know. Note the importance of the html prefix, otherwise GChart treats everything as plain text. Here's the setAnnotationText method's javadocs for reference: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Curve.Point.html#setAnnotationText%28java.lang.String,%20int,%20int%29 3) If you have any GWT Widgets handy that can display true vertical text (or you can create one) then you can use GChart's setAnnotationWidget to display that text via such a Widget. It seems there ought to be such a widget, somewhere out there...if you know of one, please post back. If you can't find or build such a Widget you could of course use an image of the text you wanted and an Image widget. Here's the setAnnotationWidget's javadoc: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Curve.Point.html#setAnnotationWidget%28com.google.gwt.user.client.ui.Widget,%20int,%20int%29 GChart's addTick method also supports widgets. Finally, don't overlook the setAnnotationXShift and setAnnotationYShift methods for fine tuning the positions of your annotations. Vertical text is a valuable feature that other chart libraries I've seen support directly, and I'd definitely consider adding it (if I could get a clue as to how to do it). On the other hand, a Widget- based solution to this problem keeps GChart simpler, and (in theory) should make it easier to swap in alternative vertical-text-rendering approaches. Appreciate your question, HTH/HNY John C. Gunther http://gchart.googlecode.com On Jan 1, 1:09 am, ArunDhaJ arund...@gmail.com wrote: Hi, I'm using gchart to generate Bar Charts for my application, and using GWT 1.4.62. The Axis label gets overridden by the adjacent labels when the text is very long. So, I thought to use setAnnotationText to set the labels within the bar itself. It shows horizontally, but I need the text to be displayed vertically over the bar of the chart. How can I display it? Regards, ArunDhaJwww.arundhaj.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: UI alignment collapses with GChart
By default, Client-side GChart's axis min/max are data determined, which I believe is what is causing the collapsing with no data that you mentioned. To stop that, explicitly set axis min/max via the setAxisMax and setAxisMin methods, as described here: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Axis.html#setAxisMax%28double%29 HTML **CAN** be used in axis labels (via the addTick method) and point labels (via the setAnnotationText method). But there is a trick to it: the strings you pass in must be prefixed with html as described here: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Curve.Point.html#setAnnotationText%28java.lang.String,%20int,%20int%29 The two packages for generating a single image file chart I most often hear mentioned are jFreeChart and the Google Chart API. Based on this forum, lots of GWTers use both. There are also quite a few Google Chart API wrappers; charts4j (formerly called gchartjava) might interest you as it gives the Google Chart API a Java API: http://code.google.com/p/charts4j/ But I hope you'll also give Client-side GChart another look in light of the above info (a new release 2.4, that provides significantly better hover feedback is in the works). HTH, John C. Gunther http://gchart.googlecode.com On Dec 16, 2:17 am, ArunDhaJ arund...@gmail.com wrote: Hi All, I'm using GChart for my application. Its UI collapses when there is no points to draw. Is there any charting component which gives me a single image file for the chart ??? Since the points lable is plain text I'm not able to format the position of labels. Like, the X-axis label should be horizontal instead of veritical. Please let me know any charting component, if available Thanks in Advance ArunDhaJwww.arundhaj.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: static method wrap(Element) conflicts compiler error. Why?
Sorry missed your reply until now. Such an error message as you suggest would have made it a lot easier, in my case, to track down what the problem was. Part of the issue is that 1.4 compliance does not fail in every case, so I had been working along for a while with GWT 1.5 and 1.4 compliance without any error (in a project migrated from GWT 1.4) which made it harder to recognize the cause when I eventually hit a combination that did not work. My first thought was of some typo that produced the above obscure Java syntax error which I didn't recognize-- not the compliance thing. John On Nov 11, 11:09 am, Jason Essington jason.essing...@gmail.com wrote: Well in general the code is probably filled with syntax errors when using the Java 1.4 compiler ... And since GWT 1.5.x is not compatible with the Java 1.4 compiler I would consider this a non issue. Since GWT 1.5 is not compatible with Java 1.4 I would not expect it to work and the messages themselves are not particularly relevant at that point. I suppose it would be nice if the gwtCompiler would fail fast if you attempted to compile with an unsupported version of Java and display a nice message in the lines of: GWT 1.5.x requires Java 1.5 or better. Compile failed! -jason On Nov 10, 2008, at 8:26 PM, John Gunther wrote: Using GWT 1.5.2, and starting with this class: public class NamedHTML extends HTML implements HasName { public String getName() {return null;} public void setName(String name) {} } If I compile the above class in Eclipse with Project, Properties, Java Compiler, Compiler compliance level: 1.4, then Eclipse produces this perplexing error message on the first line: X The static method wrap(Element) conflicts with the abstract method in HTML The error goes away if make any one of these changes: 1) Switch to Compiler compliance level: 5.0, 2) Eliminate the implements HasName 3) Replace extends HTML with extends Label I understand that, in general, I need to use compiler compliance level 5.0 with GWT 1.5.2 (because GWT 1.5.2 uses 5.0 syntax) but I don't understand why the compiler thinks I've got a syntax error with the original situation, but thinks my code is OK in cases 2) and 3). John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
static method wrap(Element) conflicts compiler error. Why?
Using GWT 1.5.2, and starting with this class: public class NamedHTML extends HTML implements HasName { public String getName() {return null;} public void setName(String name) {} } If I compile the above class in Eclipse with Project, Properties, Java Compiler, Compiler compliance level: 1.4, then Eclipse produces this perplexing error message on the first line: X The static method wrap(Element) conflicts with the abstract method in HTML The error goes away if make any one of these changes: 1) Switch to Compiler compliance level: 5.0, 2) Eliminate the implements HasName 3) Replace extends HTML with extends Label I understand that, in general, I need to use compiler compliance level 5.0 with GWT 1.5.2 (because GWT 1.5.2 uses 5.0 syntax) but I don't understand why the compiler thinks I've got a syntax error with the original situation, but thinks my code is OK in cases 2) and 3). John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: gchart pop-up on data point
Yes. Just use the setAnnotationWidget method (and related methods like setAnnotationLocation) in a manner similar to how you used addTick with widget arguments.. See the Client-side GChart javadocs for details: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.Curve.Point.html#setAnnotationWidget%28com.google.gwt.user.client.ui.Widget,%20int,%20int%29 The live demo's grouped bar chart provides an example that uses setAnnotationWidget: the labels on top of each bar are clickable buttons. Click the source code link on that chart for the example code: http://gchart.googlecode.com/svn/trunk/live-demo/v2_3/com.googlecode.gchart.gchartdemoapp.GChartDemoApp/GChartDemoApp.html John C. Gunther http://gchart.googlecode.com On Oct 31, 8:45 am, Ginny [EMAIL PROTECTED] wrote: Is there a way to implement a pop-up on a data point ingchart? I'm using tick widgets now to enable pop-ups on the x-axis, but I'd really like to have this capability on a per-data-point basis. Ginny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GChart: Can i have gray dotted gridlines and solid axes?
Sorry, you cannot style a client-side GChart's gridlines. You can use the setGridColor method, which may help do part of what you are looking for: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/GChart.html#setGridColor%28java.lang.String%29 If you must have dotted gridlines, and don't mind a bit of extra work, you can add a curve with a SymbolType of YGRIDLINE (or XGRIDLINE) add points at the y-coordinates where you want to draw the gridlines, and use setBorderStyle(dotted) on that curve, and appropriately change its width, height, etc (basically, you will be drawing your own gridlines via a special curve; since curves have more options, you can get more varied gridlines). Thanks for your question. If you think more gridline options are needed, please consider submitting an issue to the GChart issue tracker. John C. Gunther http://gchart.googlecode.com On Oct 9, 11:59 pm, meng [EMAIL PROTECTED] wrote: Hi, I can't find ways to style the gridlines.I only find chart.getYAxis().setHasGridlines(true); can i have thin dotted gray gridlines and thick solid dark Axes? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GChart and Maven 2
Appreciate the complement. I understand that a Maven2 repo makes it easier for Maven2 users to include GChart as one of their project's libraries, but I have not a clue as to how to set up a Maven2 repo. So, unless its really easy to set up a repo if you've never used Maven2 before, or unless someone who knows how to set up a repo volunteers to do that (or to tell me how to do it) for Client-side GChart, it won't happen any time soon (I've really got my hands full right now trying to figure out how to properly integrate GWTCanvas' capabilities into the product) Sounds like a great idea, though, so please add it to the Client-side GChart issue tracker. John C. Gunther http://gchart.googlecode.com On Oct 9, 2:42 am, adamp [EMAIL PROTECTED] wrote: GChart looks really nice. I'd like to use it in a project but don't see it - specifically 2.3 - on any of the maven 2 repositories out there. Will it be added to a repo soon? Thanks, Adam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Client-side GChart 2.2: Sparklines and better/faster solidly filled line charts.
Sorry, client-side GChart does not provide a method for transforming from pixels into model coordinates. It also does not provide a simple way to select points using the mouse--it does not even provide a simple way you can represent the selected/unselected state of a point. If you implement a great mouse selection tool and want to contribute it back to the product, I'll be most delighted to have been proven wrong, but looking at your code and given how the product was designed, in my expert opinion: don't waste any more time on this! You CAN make a Client-side GChart interactive quite easily by adding standard GWT widgets as chart annotations, footnotes, tick labels, etc. and controlling the display only GChart's properties in response to events from those widgets. The live demo's bar chart (accessible from the GChart home page link below) provides a good example of how to do this. Here's a link to another site that uses the same simple technique to scroll a data set through a GChart via a couple of next/previous buttons: http://bocaciegapark.com/bocatides.php(scroll down to see their GChart) For some applications, such scrolling (or some similar, widget-driven technique) is a viable alternative to mouse point selection/zooming. But, if you really need the mouse point selection zoom-in functionality, it's best to use a different charting tool. (I recall seeing a timepedia chronoscope demo a while back that did the point selection/zoom in thing quite nicely). John C. Gunther http://gchart.googlecode.com On Sep 23, 5:15 pm, amadeus [EMAIL PROTECTED] wrote: Hi, I'm using your software and I would add a simple zoom tool with mouse selection I need to know the exact position of axis origin (left bottom) to transform x,y mouse in chart's coordinates here my code after sinkEvents(Event.ONMOUSEMOVE|Event.ONMOUSEDOWN| Event.ONMOUSEUP); I tried to calculate the origin public void onBrowserEvent(Event event) { double x; double y; double mouseX=event.getClientX()-getAbsoluteLeft(); double mouseY=getAbsoluteTop()+getOffsetHeight()-event.getClientY(); Axis xAxis = getXAxis(); Axis yAxis = getYAxis(); double dx=xAxis.getAxisLabelThickness() + xAxis.getTickLabelThickness() + xAxis.getTickLength(); double dy=yAxis.getAxisLabelThickness() + yAxis.getTickLabelThickness() + yAxis.getTickLength(); x=mouseX-dx; y=mouseY-dy; // transform in chart coordinates x=xmin+x*(xmax-xmin)/getXChartSize(); y=ymin+y*(ymax-ymin)/getYChartSize(); I'm on the right way or there is a simpler method? thanks Albert ps Excuse me for my english On 22 Set, 23:12, John Gunther [EMAIL PROTECTED] wrote: Client-sideGChartis an open source GWT library that supports bar, line, and pie charts, and yet adds nothing but its ~2,000 lines of Java to your application's list of dependencies: http://gchart.googlecode.com This 2.2 release adds: * A new LINE symbol type for faster/better solidly connected line charts * A new layout algorithm that centers title, footnotes, axis labels and legend within explicitly-sizable bands around the plot area. In particular, since these bands have default thicknesses of 0px when empty, Sparkline charts are now straightforward. For full details, including links to example charts illustrating the new features, see theGChart2.2 release notes: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/clie... Related posts/acknowledgments: 1) This post by Niall Haslam motivated the much-needed switch to a new chart decoration layout algorithm: http://groups.google.com/group/Google-Web-Toolkit/msg/5be9867eb81c9ca4 2) I used the technique explained in this post by Ian Bambury (http://examples.roughian.com) to workaround a perplexing IE7-only screen-not-repainting problem that the revisions of this release inadvertently exposed: http://groups.google.com/group/Google-Web-Toolkit/msg/31b2d8e0eace6f3c 3) The improved line chart capabilities were motivated by the far-too- slowly-updating solidly connected line chart code that Malcolm Gorman sent me. A new live demo chart, deliberately (HTML-element) sized similarly to Malcolm's chart, illustrates various ways (smaller charts, lower resolution connecting lines) you can use the new LINE symbol type to workaround the significant performance limitations that still remain for this kind of non-rectangle-friendly chart. Your ideas for improving Client-sideGChartand help in solving its implementation problems were essential to this 2.2 release. Thank-you. John C. Guntherhttp://gchart.googlecode.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group
Need to draw straight lines fast in a GWT chart library
My library, Client-side GChart, doesn't render solidly connected, large-sized, line charts quickly enough for at least one user (probably because it draws them with a series of rectangular HTML elements). Anyone have any suggestions for drawing reasonably good-looking straight lines fast that works the same way on all GWT supported browsers? To be specific, on the last chart of my live demo (accessible from the home page below, scroll to the bottom of the demo): if you click the button that moves it into hi-res mode, on my machine it shows 4000ms in the elapsed time message. I'd like that to be at least 10 times faster. John C. Gunther http://gchart.googlecode.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Invisible outer Grid triggers screen repaint problem in IE7. Any workarounds?
Ian, Sorry for the delayed response, missed your re-post. My recollection is I tried visibility: visible without the visibility: hidden first, and it seemed that IE7 was smart enough to realize I hadn't changed a thing, and to ignore me. Just in case you are curious to reproduce this on your own with the actual code, it's the grouped bar chart on the Client-side GChart 2.2 demo application (accessible from the home page) where I first saw the symptoms. If you comment out the two lines that do the invisible/ visible thing from GChart.java (or, even one of them, if my memory holds) then, in IE7, the ghosts of the buttons' previous positions on top of each bar remain behind, after clicking the update button. John C. Gunther http://gchart.googlecode.com On Aug 23, 8:29 am, Ian Bambury [EMAIL PROTECTED] wrote: Well, apart from writing a bat and wall game on a Spectrum (probably the first proper program I ever wrote) and converting IBM360 Assembler programs to Cobol, I've not really been that involved. It's always been in the same category as swimming the Atlantic: it would be nice to be able to say I'd done it, but I don't actually want to do it :-) But I did get my feet wet once or twice. Ian 2008/8/23 Paul Sullivan [EMAIL PROTECTED] Sorry - completely off topic 6502... oh those were the days!! I was a mere boy when the good ol' 64 taught me the basics of ML :) Be good to hark on about those days Ian if your interested :) mail me [EMAIL PROTECTED] Do much win32 MASM nowadays? Paul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Client-side GChart 2.2: Sparklines and better/faster solidly filled line charts.
Client-side GChart is an open source GWT library that supports bar, line, and pie charts, and yet adds nothing but its ~2,000 lines of Java to your application's list of dependencies: http://gchart.googlecode.com This 2.2 release adds: * A new LINE symbol type for faster/better solidly connected line charts * A new layout algorithm that centers title, footnotes, axis labels and legend within explicitly-sizable bands around the plot area. In particular, since these bands have default thicknesses of 0px when empty, Sparkline charts are now straightforward. For full details, including links to example charts illustrating the new features, see the GChart 2.2 release notes: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p2features.html Related posts/acknowledgments: 1) This post by Niall Haslam motivated the much-needed switch to a new chart decoration layout algorithm: http://groups.google.com/group/Google-Web-Toolkit/msg/5be9867eb81c9ca4 2) I used the technique explained in this post by Ian Bambury (http://examples.roughian.com) to workaround a perplexing IE7-only screen-not-repainting problem that the revisions of this release inadvertently exposed: http://groups.google.com/group/Google-Web-Toolkit/msg/31b2d8e0eace6f3c 3) The improved line chart capabilities were motivated by the far-too- slowly-updating solidly connected line chart code that Malcolm Gorman sent me. A new live demo chart, deliberately (HTML-element) sized similarly to Malcolm's chart, illustrates various ways (smaller charts, lower resolution connecting lines) you can use the new LINE symbol type to workaround the significant performance limitations that still remain for this kind of non-rectangle-friendly chart. Your ideas for improving Client-side GChart and help in solving its implementation problems were essential to this 2.2 release. Thank-you. John C. Gunther http://gchart.googlecode.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Poll: GWT 1.4.62 vs 1.5 -- what are you using? what are your plans?
Trying to get a sense of how quickly the migration to GWT 1.5 from 1.4.62 will (or has already) occurred by asking: 1) Are you using GWT 1.5 right now? 2) Are you using 1.4.62 right now? 3) Do you expect to be using GWT 1.5 six months from now? 4) Do you expect to be using GWT 1.4.62 six months from now? 5) Do you expect to be using GWT 1.5 one year from now? 6) Do you expect to be using GWT 1.4.62 one year from now? 7) How long before you expect to abandon 1.4.62 completely and use only 1.5 or higher? My answers: No, Yes, Yes, Yes, Yes, Yes, 4 years from now. John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: GChart - display issues. Sparklines
Just released GChart 2.2 which fixes this problem by letting you precisely size the space allocated for chart decorations (title, footnotes, axis labels and legend) around the chart's plot area. See the first item in these 2.2 release notes for details and a link to an example no space added GChart: http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/client/doc-files/gchart2p2features.html Thanks for reporting this problem: It's now easy to define the exact pixel size of the chart as a whole, including decorations, so that GCharts can fit into fixed sized rectangles on a page, just like images do. John C. Gunther http://gchart.googlecode.com On Aug 5, 7:11 am, MN [EMAIL PROTECTED] wrote: @Niall: if you found a nice workaround, please post your codesnippet here. thanks. On 1 Aug., 16:13, Niall Haslam [EMAIL PROTECTED] wrote: Hi all, I am usingGChartto display some graphical information. I want to create something like the sparklines that is available from the google chart api. Therefore I want to create a simple widget where the first pixel of the widget is the first data point. However, inGChartthere seem is always spaceat the left and bottom of the widget for where the X axis and Y axis labels and titles should go. Does anyone know how to make them disappear and therefore make a graph that looks like this: http://chart.apis.google.com/chart?chs=100x20cht=lschco=0077CCchm=... TheGChartdocs suggest mailing here in the absence of aGChartspecific mailing list. Sorry if it isn't relevant. Thanks, Niall. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---