


 function createFusionChart(jsonObj, containerId, chartContainer,width,height,imageName )
	{
	   //jsonObj='{"dataset":[{"renderas":"Column", "parentYAxis":"s", "valuePosition":"BELOW", "color":"#1ECC2A", "data":[{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"35", "showValue":"1", "link":"P-detailsPopUp,width=400,height=300,toolbar=no, scrollbars=no,resizable=no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname=customerinfo"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"10", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"10", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"100", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"0", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"},{"value":"12", "showValue":"1", "link":"P-detailsPopUp,width:400,height:300,toolbar:no, scrollbars:no,resizable:no-http://192.168.0.148:9090/ibase/dwh/GwtDashboardPage.html?metadataname:ordershipment"}], "seriesname":"Quantity Stduom"}], "categories":{"category":[{"label":"14-Aug"},{"label":"18-Aug"},{"label":"20-Aug"},{"label":"06-Sep"},{"label":"09-Sep"},{"label":"11-Sep"},{"label":"12-Sep"},{"label":"16-Sep"},{"label":"17-Sep"},{"label":"18-Sep"},{"label":"19-Sep"},{"label":"20-Sep"},{"label":"22-Sep"},{"label":"23-Sep"},{"label":"30-Sep"},{"label":"01-Oct"},{"label":"18-Nov"},{"label":"27-Nov"},{"label":"06-Dec"}]}, "chart":[{"caption":"Pending Order", "bgcolor":"F0F0F0", "showLegend":"1", "useroundedges":"1", "rotateValues":"0", "decimals":"1", "formatNumberScale":"0", "formatNumber":"1", "xAxisName":"Date Wise Summary", "yAxisName":"Date Wise Summary Value", "anchorBorderThickness":"3", "pyaxisname":"Value", "syaxisname":"Quantity"}]}';
	 try
		{
		 FusionCharts.setCurrentRenderer('javascript');
    		srcImagesPath="FusionChart/images/"+imageName+".swf";    		
    		if(imageName=="heatmap")
    		{
    			//alert("in heat map: height:"+height"  width:"+width);
//    			jsonObj='{ "chart": { "caption": "CPU Utilization % by time over the week", "bgcolor": "FFFFFF", "canvasborderthickness": "0", "labeldisplay": "WRAP", "plotbordercolor": "FFFFFF", "basefontcolor": "FFFFFF", "outcnvbasefontcolor": "333333", "showvalues": "0", "captionpadding": "5", "legendpadding": "0", "tooltipcolor": "333333", "canvasborderalpha": "0", "legendshadow": "0", "legendborderalpha": "0", "xaxisname": "Time of the day (hrs)", "showBorder": "0" }, "rows": { "row": [ { "id": "Mon" }, { "id": "Tue" }, { "id": "Wed" }, { "id": "Thu" }, { "id": "Fri" } ] }, "columns": { "column": [ { "id": "0" }, { "id": "1" }, { "id": "2" }, { "id": "3" }, { "id": "4" }, { "id": "5" }, { "id": "6" }, { "id": "7" }, { "id": "8" }, { "id": "9" }, { "id": "10" }, { "id": "11" }, { "id": "12" }, { "id": "13" }, { "id": "14" }, { "id": "15" }, { "id": "16" }, { "id": "17" }, { "id": "18" }, { "id": "19" }, { "id": "20" }, { "id": "21" }, { "id": "22" }, { "id": "23" } ] }, "dataset": [ { "data": [ { "rowid": "Mon", "columnid": "0", "value": "2" ,"link": "n-/ibase/dwh/GwtDashboardPage.html?metadataname=pendingorder"}, { "rowid": "Mon", "columnid": "1", "value": "4" }, { "rowid": "Mon", "columnid": "2", "value": "5" }, { "rowid": "Mon", "columnid": "3", "value": "5" }, { "rowid": "Mon", "columnid": "4", "value": "3" }, { "rowid": "Mon", "columnid": "5", "value": "3" }, { "rowid": "Mon", "columnid": "6", "value": "4" }, { "rowid": "Mon", "columnid": "7", "value": "5" }, { "rowid": "Mon", "columnid": "8", "value": "5" }, { "rowid": "Mon", "columnid": "9", "value": "6" }, { "rowid": "Mon", "columnid": "10", "value": "8" }, { "rowid": "Mon", "columnid": "11", "value": "12" }, { "rowid": "Mon", "columnid": "12", "value": "14" }, { "rowid": "Mon", "columnid": "13", "value": "23" }, { "rowid": "Mon", "columnid": "14", "value": "27" }, { "rowid": "Mon", "columnid": "15", "value": "32" }, { "rowid": "Mon", "columnid": "16", "value": "46" }, { "rowid": "Mon", "columnid": "17", "value": "19" }, { "rowid": "Mon", "columnid": "18", "value": "23" }, { "rowid": "Mon", "columnid": "19", "value": "25" }, { "rowid": "Mon", "columnid": "20", "value": "19" }, { "rowid": "Mon", "columnid": "21", "value": "16" }, { "rowid": "Mon", "columnid": "22", "value": "8" }, { "rowid": "Mon", "columnid": "23", "value": "7" }, { "rowid": "Tue", "columnid": "0", "value": "5" }, { "rowid": "Tue", "columnid": "1", "value": "7" }, { "rowid": "Tue", "columnid": "2", "value": "11" }, { "rowid": "Tue", "columnid": "3", "value": "3" }, { "rowid": "Tue", "columnid": "4", "value": "4" }, { "rowid": "Tue", "columnid": "5", "value": "2" }, { "rowid": "Tue", "columnid": "6", "value": "1" }, { "rowid": "Tue", "columnid": "7", "value": "9" }, { "rowid": "Tue", "columnid": "8", "value": "11" }, { "rowid": "Tue", "columnid": "9", "value": "16" }, { "rowid": "Tue", "columnid": "10", "value": "23" }, { "rowid": "Tue", "columnid": "11", "value": "34" }, { "rowid": "Tue", "columnid": "12", "value": "45" }, { "rowid": "Tue", "columnid": "13", "value": "68" }, { "rowid": "Tue", "columnid": "14", "value": "47" }, { "rowid": "Tue", "columnid": "15", "value": "52" }, { "rowid": "Tue", "columnid": "16", "value": "26" }, { "rowid": "Tue", "columnid": "17", "value": "49" }, { "rowid": "Tue", "columnid": "18", "value": "33" }, { "rowid": "Tue", "columnid": "19", "value": "28" }, { "rowid": "Tue", "columnid": "20", "value": "12" }, { "rowid": "Tue", "columnid": "21", "value": "10" }, { "rowid": "Tue", "columnid": "22", "value": "3" }, { "rowid": "Tue", "columnid": "23", "value": "2" }, { "rowid": "Wed", "columnid": "0", "value": "4" }, { "rowid": "Wed", "columnid": "1", "value": "6" }, { "rowid": "Wed", "columnid": "2", "value": "8" }, { "rowid": "Wed", "columnid": "3", "value": "12" }, { "rowid": "Wed", "columnid": "4", "value": "7" }, { "rowid": "Wed", "columnid": "5", "value": "10" }, { "rowid": "Wed", "columnid": "6", "value": "12" }, { "rowid": "Wed", "columnid": "7", "value": "14" }, { "rowid": "Wed", "columnid": "8", "value": "18" }, { "rowid": "Wed", "columnid": "9", "value": "20" }, { "rowid": "Wed", "columnid": "10", "value": "27" }, { "rowid": "Wed", "columnid": "11", "value": "33" }, { "rowid": "Wed", "columnid": "12", "value": "37" }, { "rowid": "Wed", "columnid": "13", "value": "43" }, { "rowid": "Wed", "columnid": "14", "value": "49" }, { "rowid": "Wed", "columnid": "15", "value": "54" }, { "rowid": "Wed", "columnid": "16", "value": "67" }, { "rowid": "Wed", "columnid": "17", "value": "75" }, { "rowid": "Wed", "columnid": "18", "value": "87" }, { "rowid": "Wed", "columnid": "19", "value": "72" }, { "rowid": "Wed", "columnid": "20", "value": "52" }, { "rowid": "Wed", "columnid": "21", "value": "23" }, { "rowid": "Wed", "columnid": "22", "value": "12" }, { "rowid": "Wed", "columnid": "23", "value": "4" }, { "rowid": "Thu", "columnid": "0", "value": "2" }, { "rowid": "Thu", "columnid": "1", "value": "3" }, { "rowid": "Thu", "columnid": "2", "value": "3" }, { "rowid": "Thu", "columnid": "3", "value": "5" }, { "rowid": "Thu", "columnid": "4", "value": "5" }, { "rowid": "Thu", "columnid": "5", "value": "7" }, { "rowid": "Thu", "columnid": "6", "value": "10" }, { "rowid": "Thu", "columnid": "7", "value": "9" }, { "rowid": "Thu", "columnid": "8", "value": "11" }, { "rowid": "Thu", "columnid": "9", "value": "12" }, { "rowid": "Thu", "columnid": "10", "value": "15" }, { "rowid": "Thu", "columnid": "11", "value": "23" }, { "rowid": "Thu", "columnid": "12", "value": "25" }, { "rowid": "Thu", "columnid": "13", "value": "28" }, { "rowid": "Thu", "columnid": "14", "value": "17" }, { "rowid": "Thu", "columnid": "15", "value": "22" }, { "rowid": "Thu", "columnid": "16", "value": "20" }, { "rowid": "Thu", "columnid": "17", "value": "33" }, { "rowid": "Thu", "columnid": "18", "value": "35" }, { "rowid": "Thu", "columnid": "19", "value": "20" }, { "rowid": "Thu", "columnid": "20", "value": "14" }, { "rowid": "Thu", "columnid": "21", "value": "6" }, { "rowid": "Thu", "columnid": "22", "value": "3" }, { "rowid": "Thu", "columnid": "23", "value": "1" }, { "rowid": "Fri", "columnid": "0", "value": "2" }, { "rowid": "Fri", "columnid": "1", "value": "4" }, { "rowid": "Fri", "columnid": "2", "value": "7" }, { "rowid": "Fri", "columnid": "3", "value": "11" }, { "rowid": "Fri", "columnid": "4", "value": "14" }, { "rowid": "Fri", "columnid": "5", "value": "12" }, { "rowid": "Fri", "columnid": "6", "value": "8" }, { "rowid": "Fri", "columnid": "7", "value": "12" }, { "rowid": "Fri", "columnid": "8", "value": "14" }, { "rowid": "Fri", "columnid": "9", "value": "16" }, { "rowid": "Fri", "columnid": "10", "value": "18" }, { "rowid": "Fri", "columnid": "11", "value": "20" }, { "rowid": "Fri", "columnid": "12", "value": "25" }, { "rowid": "Fri", "columnid": "13", "value": "27" }, { "rowid": "Fri", "columnid": "14", "value": "17" }, { "rowid": "Fri", "columnid": "15", "value": "16" }, { "rowid": "Fri", "columnid": "16", "value": "14" }, { "rowid": "Fri", "columnid": "17", "value": "12" }, { "rowid": "Fri", "columnid": "18", "value": "14" }, { "rowid": "Fri", "columnid": "19", "value": "14" }, { "rowid": "Fri", "columnid": "20", "value": "12" }, { "rowid": "Fri", "columnid": "21", "value": "10" }, { "rowid": "Fri", "columnid": "22", "value": "3" }, { "rowid": "Fri", "columnid": "23", "value": "2" } ] } ], "colorrange": { "gradient": "1", "minvalue": "0", "code": "a4c93f", "startlabel": "", "endlabel": "Very High", "color": [ { "minvalue": "0", "maxvalue": "20", "code": "a4c93f", "label": "Average", "alpha": "40" }, { "code": "e44a00", "minvalue": "20", "maxvalue": "100", "alpha": "40" } ] } }';
    			//jsonObj='{ "chart": { "caption": "Top Smartphone Ratings", "subcaption": "By Features", "xAxisName": "Features", "yAxisName": "Model", "showplotborder": "1", "xAxisLabelsOnTop": "1", "baseFontColor": "#333333", "baseFont": "Helvetica Neue,Arial", "captionFontSize": "14", "subcaptionFontSize": "14", "subcaptionFontBold": "0", "showBorder": "0", "bgColor": "#ffffff", "showShadow": "0", "usePlotGradientColor": "0", "canvasBgColor": "#ffffff", "canvasBorderAlpha": "0", "legendBgAlpha": "0", "legendBorderAlpha": "0", "legendShadow": "0", "legendItemFontSize": "10", "legendItemFontColor": "#666666", "toolTipColor": "#ffffff", "toolTipBorderThickness": "0", "toolTipBgColor": "#000000", "toolTipBgAlpha": "80", "toolTipBorderRadius": "2", "toolTipPadding": "5" }, "rows": { "row": [ { "id": "SGS5", "label": "Samsung Galaxy S5" }, { "id": "HTC1M8", "label": "HTC One (M8)" }, { "id": "IPHONES5", "label": "Apple iPhone 5S" }, { "id": "LUMIA", "label": "Nokia Lumia 1520" } ] }, "columns": { "column": [ { "id": "processor", "label": "Processor" }, { "id": "screen", "label": "Screen Size" }, { "id": "price", "label": "Price" }, { "id": "backup", "label": "Battery Backup" }, { "id": "cam", "label": "Camera" } ] }, "dataset": [ { "data": [ { "rowid": "SGS5", "columnid": "processor", "value": "8.7", "tllabel": "Quad Core 2.5 GHz", "trlabel": "OS : Android 4.4 Kitkat" }, { "rowid": "SGS5", "columnid": "screen", "value": "8.5", "tllabel": "5.1 inch", "trlabel": "AMOLED screen" }, { "rowid": "SGS5", "columnid": "price", "value": "9.3", "tllabel": "$600" }, { "rowid": "SGS5", "columnid": "backup", "value": "9.7", "tllabel": "29 Hrs", "trlabel": "Battery : 2800 MAH" }, { "rowid": "SGS5", "columnid": "cam", "value": "8", "tllabel": "16 MP", "trlabel": "Front Camera : 2.1 MP" }, { "rowid": "HTC1M8", "columnid": "processor", "value": "9.2", "tllabel": "Quad Core 2.3 GHz", "trlabel": "OS : Android 4.4 Kitkat" }, { "rowid": "HTC1M8", "columnid": "screen", "value": "8.3", "tllabel": "5 inch", "trlabel": "LCD screen" }, { "rowid": "HTC1M8", "columnid": "price", "value": "7.3", "tllabel": "$600" }, { "rowid": "HTC1M8", "columnid": "backup", "value": "8.8", "tllabel": "20 Hrs", "trlabel": "Battery : 2600 MAH" }, { "rowid": "HTC1M8", "columnid": "cam", "value": "8.7", "tllabel": "4 MP", "trlabel": "Front Camera : 5 MP" }, { "rowid": "IPHONES5", "columnid": "processor", "value": "9.1", "tllabel": "Dual Core", "trlabel": "OS : iOS 7" }, { "rowid": "IPHONES5", "columnid": "screen", "value": "8.6", "tllabel": "4 inch", "trlabel": "Retina LCD screen" }, { "rowid": "IPHONES5", "columnid": "price", "value": "7.2", "tllabel": "$649" }, { "rowid": "IPHONES5", "columnid": "backup", "value": "8.4", "tllabel": "10 Hrs", "trlabel": "Battery : 1560 MAH" }, { "rowid": "IPHONES5", "columnid": "cam", "value": "9.5", "tllabel": "8 MP", "trlabel": "Front Camera : 1.2 MP" }, { "rowid": "LUMIA", "columnid": "processor", "value": "8.8", "tllabel": "Quad Core 2.2 GHz", "trlabel": "OS: Windows Phone 8" }, { "rowid": "LUMIA", "columnid": "screen", "value": "9.1", "tllabel": "6 inch", "trlabel": "LCD screen" }, { "rowid": "LUMIA", "columnid": "price", "value": "9.7", "tllabel": "$470" }, { "rowid": "LUMIA", "columnid": "backup", "value": "9.2", "tllabel": "27 Hrs", "trlabel": "Battery : 3400 MAH" }, { "rowid": "LUMIA", "columnid": "cam", "value": "8.1", "tllabel": "20MP", "trlabel": "Front Camera : 1.2 MP" } ] } ], "colorrange": { "gradient": "0", "minvalue": "0", "code": "E24B1A", "startlabel": "Poor", "endlabel": "Good", "color": [ { "code": "E24B1A", "minvalue": "1", "maxvalue": "5", "label": "Bad" }, { "code": "F6BC33", "minvalue": "5", "maxvalue": "8.5", "label": "Average" }, { "code": "6DA81E", "minvalue": "8.5", "maxvalue": "10", "label": "Good" } ] },"styles": [{"definition":[{"name":"tlLabelFont", "type":"font1", "font":"verdana", "size":"14", "color":"AA3F55"},{"name":"trLabelFont", "type":"font", "font":"verdana", "size":"15", "color":"AA3F55"},{"name":"blLabelFont", "type":"font", "font":"verdana", "size":"50", "color":"FFFFFF"},{"name":"brLabelFont", "type":"font", "font":"verdana", "size":"17", "color":"AA3F55"},{"name":"datavaluesFont", "type":"font", "font":"verdana", "size":"18", "color":"red"}]}, {"application":[{"toobject":"tldatavalues", "styles":"tlLabelFont"},{"toobject":"trdatavalues", "styles":"trLabelFont"},{"toobject":"bldatavalues", "styles":"blLabelFont"},{"toobject":"brdatavalues", "styles":"brLabelFont"},{"toobject":"datavalues", "styles":"datavaluesFont"}]}] }';
    			var myChart = new FusionCharts({ type: 'heatmap', dataFormat: 'json' }); 
    			myChart.resizeTo( height,width );
		         		
    		}
    		else if(imageName!="heatmap") 
    		{
    			//alert("in graph: height:"+height"  width:"+width);
    			var myChart = new FusionCharts({ type: imageName, dataFormat: 'json' });
    			myChart.resizeTo( height,width );
    			//var myChart = new FusionCharts( ""+srcImagesPath+"", "json"+containerId, ""+height, ""+width, "0", "0","debugMode : false");
		     }
            myChart.setJSONData(jsonObj);
    	    myChart.render(chartContainer);
		}
	 
	 
		catch(e)
		{
			alert( "Excpeiton :: createFusionChart  ["+e.message+"]" );
		}    	
	}
 
 
