Top Java script Charting Frameworks


Building Business Intelligence applications is always require the lot of effort and time. As all already might aware of that the Charting applications comes under the business intelligence applications.

There are many number of java charting frame works are available in the market. Some of them might be opensource, some of them are freeware and others might be premium based frameworks. As per my opinion, implementing the charting applications using java based frameworks takes lot of time and bringing good look and feel is night mare to developers.

In this post, I am planning to put some points about the Java script based charting libraries. If you feel interesting about this, just learn more details in the particular websites.

  • FusionCharts Suite XT: You can build delightful JavaScript charts for web and mobile applications. Charts will be rendered in JavaScript (HTML5) Charts using SVG and VML. It accepts the JSON and XML are the input parameters. You can integrate with the JQuery library. It also provides the API for serviside integration for ASP.NET, PHP, ASP, Java, Ruby on Rails etc. It supports zooming, scrolling and pinning. Provides 90+ chart types in both 2D and 3D. Its a licensed and paid library for production environment.
  • HighCharts : Interactive JavaScript charts for your web projects. These charts will be rendered in JavaScript (HTML5) Charts using SVG and VML. It accepts the JSON as input format. It provides only 2D format charts. It supports zooming and panning support. Its paid for commercial usage and Non-commercial usage is free. It supports 25+ chart types in 2D. Maps and 3D charts are not supported.
  • Google Chart Tools: Google Chart tools display live data on your site. These charts will be rendered in HTML5 charts using SVG and VML. It is free library for all usages. The JavaScript files are loaded directly from Google’s servers. So your application always has to be online to view the charts. 13 chart types in 2D. Maps available as GeoChart.
  • Sencha ExtJS Charts: This is Plugin-free Charting (part of the extJS framework). These charts will be rendered in JavaScript Charts using SVG and VML. It doesn’t supports zooming or panning. 13 chart types in 2D. Maps and 3D charts not supported.
  • Chart.js:It is a easy, object oriented client side graphs for designers and developers. Its a Canvas based charts. It is Free under MIT license. The charts are drawn using Canvas and hence cannot offer any interactivity. 6 chart types are available.
  • Flot: It is an attractive JavaScript plotting for jQuery. It renders in the charts in the form of HTML5 charts using Canvas and VML. It provides 8 chart types in 2D. Maps and 3D charts not supported.Its a free library.
  • jqPlot: It is a Versatile and Expandable jQuery Plotting Plugin and renders in HTML5 charts using Canvas. Ability to provide the 25+ chart types in 2D. Maps and 3D charts not supported. It can be used under GPL and MIT licences. Supports Quintile Pyramid Charts, Engel & Lorenz Curves, Multi-level pie, Block plots.
  • amCharts: It is a Robust JavaScript Charting Tool / Interactive JavaScript Charts. It renders the charts in the format of JavaScript (HTML5) Charts using SVG and VML. It provides the 18 chart types in 2D and 3D. Maps available as part of amMaps package. Only can be used with the paid licence. Support for PDF not available. Zooming and panning support is available.
  • gRaphaël: You can build stunning charts on your website. It renders the charts in the format of JavaScript (HTML5) Charts using SVG and VML. Supports 4 chart types in 2D. Maps and 3D charts are not supported. It can be used under MIT licence. No support for zooming or panning. Provides the Dot Charts.

Understanding of complete libraries helps us in taking a decision before designing the applications. Lets be let me know your inputs on this post.

Source: http://www.fusioncharts.com/javascript-charting-comparison/?utm_source=Competitor-Mailer&utm_medium=email&utm_content=Main-C2A&utm_campaign=GrownUps

Other Useful links:

List of Java script MVC Frameworks

Enabling javascript in browsers

Decimal Validation in JavaScript

Creation of Dynamic rows in javascript

Conversion of string into uppercase

Avoid nested loops using Collection Framework in Java


High performance is essential for any software implemented in any programming language. And, loops plays major role in this regard. This post explains how to avoid the loops using Java’s Collection framework.

Below are the two Java programs to understand how the performance could be increased using the Collection framework.

Using nested loops

package in.javatutorials;

/**
* Finds out the Duplicates is String Array using Nested Loops.
*/
public class UsingNesteadLoops {
  private static String[] strArray = { "Cat", "Dog", "Tiger",     "Lion", "Lion" };

  public static void main(String[] args) {
   isThereDuplicateUsingLoops(strArray);
  }

  /**
   * Iterates the String array and finds out the duplicates 
   */
   public static void isThereDuplicateUsingLoops(String[]     strArray) {

   boolean duplicateFound = false;
   int loopCounter = 0;

   for (int i = 0; i < strArray.length; i++) {
   String str = strArray[i];
   int countDuplicate = 0;

   for (int j = 0; j < strArray.length; j++) {
      String str2 = strArray[j];
      if (str.equalsIgnoreCase(str2)) {
         countDuplicate++;
      }
      if (countDuplicate > 1) {
         duplicateFound = true;
         System.out.println("Duplicates Found for " + str);
      }
      loopCounter++;
   }// end of inner nested for loop

   if (duplicateFound) {
    break;
   }
}// end of outer for loop

System.out.println("Looped " + loopCounter + " times to find the result");
}

}

If we run the above program, it will be looped 20 times to find out the duplicates in the string array which has the length of 5. Number of loops increases exponentially depending on size of array, hence the performance takes a hit. These are not acceptable to use in applications which require high performance.

Without using nested loops

package in.javatutorials;

import java.util.HashSet;
import java.util.Set;

/**
* Finds out the Duplicates is String Array using Collection.
*/
public class AvoidNesteadLoopsUsingCollections {

private static String[] strArray = { "Cat", "Dog", "Tiger", "Lion", "Lion" };

public static void main(String[] args) {
 isThereDuplicateUsingSet(strArray);
}

/**
* Iterates the String array and finds out the duplicates
*/
public static void isThereDuplicateUsingSet(String[] strArray) {
  boolean duplicateFound = false;
  int loopCounter = 0;
  Set setValues = new HashSet();

  for (int i = 0; i < strArray.length; i++) {
    String str = strArray[i];

    if(setValues.contains(str)){
        duplicateFound = true;
        System.out.println("Duplicates Found for " + str);
    }
    setValues.add(str);
    loopCounter++;

    if (duplicateFound) {
       break;
    }
   }// end of for loop

   System.out.println("Looped " + loopCounter + " times to find the result");
 }

}
  • Above approach takes only 5 loops to identify the duplicates in the same array.
  • It is more readable , easier to maintain and performs better.
  • If you have an array with 1000 items, then nested loops will loop through 999000 times and utilizing a collection will loop through only 1000 times.

Other Useful links: