I have to create a graph or a chart in GWT which look like
P,Y,T,A,R are the organisations and the 10 is the Max limit .
For P the value is 5 , For Y value is 7..
Is there any library availabe for this chart .?
If not can any tell me the approach to achieve this.??
Thanks
You can always use d3.js. There are hundreds of example charts.
It's a JavaScript library, so you will need to use JSNI to use it. There is also a GWT wrapper for it called gwt-d3.
Here is an example of a spider/radar plot. The advantage of d3 is that it's very customizable, interactive and (in my opinion) the prettiest chart library for javascript.
We use JFreeChart (http://www.jfree.org/jfreechart) library on server side successfuly in GWT application. JFreeChart brings us great flexibility to what could be rendered. The only major drawback is that it runs only on server side (JVM). You need special servlet for handling graph generations. On client side you should create e.g. img html element with special url passing either chart parameters or special token (for chart identification) returned in previous RPC (Ajax) call, invoked for chart processing.
This approach requires more work than using client-side charting library, but brings you possibility to tune up charts in future in the way you need. Please check JFreeChart Web Start Demo with sources -http://www.jfree.org/jfreechart/samples.html. For your use case there is one nice example - Spider Web Chart Demo - which is certainly possible to adopt for your requirements.
Related
I would like to know if it is possible with Unity3D to have an object with the following properties, consider a human for example:
Leg length can be set when you create the object in your game.
Arm length can be set aswell.
It can be set for every part of your model.
Ability to use all joints of bones of your model programatically.
Also is it possible to run Unity3D from Java? Or what would be the best way to get around with Unity3D having a Java background.
Regards.
There are all sorts of Joints available in Unity3D which you can use with Javascript quite effectively. Check out Character, Fixed and Hinge joints - try adding those components to your gameobject and tweaking their values in the inspector. You can connect items / bones with these and set things like max length, bounciness, breakage points, and more. Once you are comforatable with these you can then add them through code using AddComponent.
As far as scaling your objects you can achieve this by making each joint / portion of the figure a different gameobject, and hold them together in a parent object. Then, you can go through the children of the parents and adjust the local scale of each child using this.
Im using C# script with my unity project, from a Java background, and I found it pretty easy to pick up -- in general I've thought C# is pretty similar to Java, and C# script I've found to be pretty similar to C#.
I need to plot an ECG graph using Javascript without using any API's. I will get a response (graph-co-ordinates) from the server and i have to plot a graph. It can be done in Javascript "CANVAS" or "SVG". But i dont know where to start. Give me some guidance for this criteria.
Use an API, and hours of work have already been done for you. Plenty mistakes have been made and learned from. You save yourself lots of work. Given the nature of your plots, choose your library based on maturity, how well the date-time axis is supported and on if you can easily add a raster to the canvas.
A good candidate, seems to me, is Highcharts, if the licence (Creative Commons non-commercial) agrees with you.
Once you have chosen your library, first plot the simplest sample plot using their demos or tutorial.
Then pick a couple examples from the demo or tutorial that demonstrate aspects of your ECG plots (date time axis, raster, style/colors, splines?)
Then move on to showing sample data from one of your ECGs.
You can use a tiny but useful ECG chart display tool. https://github.com/sergey-chuvayev/ecg_display_plugin
In my java web application, i want to reflect pie chart dynamically on the basis of database value and give me a some way on the basis of that i can do it?? which is a better way do it either through STRUTS 2.0 or JSP,SERVLET. Thanks in advance.......
You need something that generates charts like JFreeChart (on the server) or Flot (in the browser).
It doesn't really make sense to ask if you should use 'Struts 2 or JSP,Servlet' - this is not really relevant to how you generate a chart - use whatever server side technology you think is appropriate.
I've read several GWT developer blogs that mentioned some "rule of thumb" whereby if your resultant JavaScript will be 100 lines of code or greater, it is better to just write the JavaScript yourself (instead of generating it through GWT).
My question is: how can you tell how many LOC GWT will produce? This seems like a difficult rule of thumb to follow, and one that requires writing 2 sets of code (first writing the GWT, and then re-writing it in JavaScript)!?!?
Have I misunderstood something here?
The point of GWT is to save us from having to write JavaScript and using Vaadin (a java Web applications framework built on top of GWT) I created a number of UI controls I wouldn't even know how to do in JavaScript.
The concern you do need to keep in mind is performance. I wrote a form that took over 20 seconds to render in IE8. It doesn't matter how many LOC to your users, no one will wait so long for a page to appear.
I am wondering if there exist libraries that could help me draw such figures on screen quickly using JAVA.
The dataset and number of nodes etc need to be parametrized.
If no such libraries exist, which tools in Swing would get me started. I want a quick and dirty way to represent this information.
Edit :
Also it would help if you could tell me what to search on google to get results for such a tailored query.
You can call GraphViz from within Java, converting any Java-based tree structure into the necessary GraphViz formats, and then reading the resulting .png image back into Java. That is probably the easiest approach, in terms of code-to-write (credit goes to SyntaxT3rr0r for proposing it first).
Customizing JGraph would also work, but I doubt that any of the default node-types would cut it. There are examples in the manual covering how to code your own node types and representations. JGraph allows easy graphical editing of node labels and positions, has hierarchical layouts (the type you use for trees); and it supports "ports" of origin (and also destination) for your parent-child edges. You can try their editor demo (included in their default download) if you just want a quick test.