ktsha
Members-
Content count
41 -
Joined
-
Last visited
Everything posted by ktsha
-
Hi sudipto, please find the attachments .xml,js,java xml.txt js.txt java.txt
-
Hi Sudipto, Please find the atatchment of the xml,js,java file in which my chart is rendering. Any help will be appreciated. xml.txt js.txt java.txt
-
Problem Regarding Link in Drill Down Fusion Chart
ktsha replied to ktsha's topic in Javascript Problems
here is my javascript function i am calling function updateFusionChart(condQuery,Mngmnt,stutus,kpi,serviceID){ alert("hi"); if ( !serviceID){ var strURL = "ChartServlet?GM=" + Mngmnt + "&status=" +stutus + "&kpi=" +kpi+ "&condQuery=" +condQuery; strURL = escape(strURL); var chart_CityDetails = new FusionCharts('FusionCharts/StackedBar3D.swf?ChartNoDataText=Click right chart to view Services Details', 'ServDetails', '550', '450', '0', '1'); chart_CityDetails.setDataURL(strURL); chart_CityDetails.render(Mngmnt+kpi+"ServDetailsDiv"); } else if (serviceID){ var strURL = "ChartServlet?GM=" + Mngmnt + "&status=" +stutus + "&serviceID=" +serviceID + "&kpi=" +kpi+"&condQuery="+condQuery; //URLEncode it - NECESSARY. strURL = escape(strURL); var chart_CityDetails = new FusionCharts('FusionCharts/StackedBar3D.swf?ChartNoDataText=Click right chart to view Services Details', 'SubServDetails', '800', '450', '0', '1'); chart_CityDetails.setDataURL(strURL); chart_CityDetails.render(Mngmnt+kpi+"SubServDetailsDiv"); } else { //Show error alert("Please wait for the charts to load."); return; } } i am using dataURL method. This is my java file private String getStack2D_Request_XML1(HttpServletRequest request,String condQuery,boolean forDataURL, String kpi, String L1, String L2, String L3, String condtion, boolean links, String DrillDownKPI) { SqlMapClient sqlMapClient = (SqlMapClient) getServletContext().getAttribute("sqlMapClient"); Map sqlParams = new HashMap(); String FuncName; List> resultList = null; sqlParams.put("whereCase",condQuery); sqlParams.put("whereCase_ServProvider",condtion); StringWriter chartXML = new StringWriter(); try { resultList = (List>) sqlMapClient.queryForList(kpi, sqlParams); XMLOutputFactory xOutputFactory = XMLOutputFactory.newInstance(); XMLStreamWriter2 xStreamWriter2 = (XMLStreamWriter2) xOutputFactory.createXMLStreamWriter(chartXML); xStreamWriter2.writeStartDocument(); xStreamWriter2.writeStartElement("chart"); if(resultList.size() >=1 ){ xStreamWriter2.writeAttribute("palette", "2"); xStreamWriter2.writeAttribute("showValues", "0"); xStreamWriter2.writeAttribute("animation", "1"); xStreamWriter2.writeAttribute("formatNumberScale", "0"); xStreamWriter2.writeStartElement("categories"); int start = 0; List funcNameList = new ArrayList(); List statusNameList = new ArrayList(); for (Map map : resultList) { FuncName = (String) map.get("func_name");// Human Resources, if (FuncName != null) FuncName = FuncName.replaceAll("&", "And"); else FuncName = "ALL"; funcNameList.add(FuncName); String status_name = (String) map.get("status_name"); statusNameList.add(status_name); xStreamWriter2.writeStartElement("category"); xStreamWriter2.writeAttribute("label", (String) map.get("status_name")); xStreamWriter2.writeEndElement();// category } xStreamWriter2.writeEndElement(); // categories int i,k ; Object[] series = (Object[]) resultList.get(0).keySet().toArray(); for (int j = 2; j < series.length-1; j++) { xStreamWriter2.writeStartElement("dataset"); System.out.println(" ================ > (String) series[j] :" + (String) series[j]); xStreamWriter2.writeAttribute("seriesName", (String) series[j]); // xStreamWriter2.writeAttribute("color", "A66EDD"); for (i = start,k = 0; i < resultList.size(); i++,k++) { Object[] record = (Object[]) resultList.get(i).values().toArray(); xStreamWriter2.writeStartElement("set"); String newCondQuery = URLEncoder.encode(condQuery); xStreamWriter2.writeAttribute("value", "" + record[j]); //xStreamWriter2.writeAttribute("link","j-//updateFusionChart(""+newCondQuery+"",""+funcNameList.get(k)+"",""+statusNameList.get(k)+"",""+DrillDownKPI+"");"); xStreamWriter2.writeAttribute("link","JavaScript:updateFusionChart(""+newCondQuery+"",""+funcNameList.get(k)+"",""+statusNameList.get(k)+"",""+DrillDownKPI+"" );"); //xStreamWriter2.writeAttribute("link","JavaScript:sample();"); //k++; xStreamWriter2.writeEndElement(); // set } xStreamWriter2.writeEndElement(); // dataset } xStreamWriter2.writeStartElement("styles"); xStreamWriter2.writeStartElement("definition"); xStreamWriter2.writeStartElement("style"); xStreamWriter2.writeAttribute("name", "CaptionFont"); xStreamWriter2.writeAttribute("type", "font"); xStreamWriter2.writeAttribute("size", "11"); // xStreamWriter2.writeAttribute("bgColor", "666666"); xStreamWriter2.writeAttribute("bold", "1"); xStreamWriter2.writeAttribute("color", "666666"); xStreamWriter2.writeEndElement(); // style xStreamWriter2.writeStartElement("style"); xStreamWriter2.writeAttribute("name", "LabelsFont"); xStreamWriter2.writeAttribute("type", "font"); xStreamWriter2.writeAttribute("size", "11"); // xStreamWriter2.writeAttribute("bgColor", "666666"); xStreamWriter2.writeAttribute("bold", "1"); // xStreamWriter2.writeAttribute("color", "FFFFFF"); xStreamWriter2.writeEndElement(); // style xStreamWriter2.writeEndElement(); // definition xStreamWriter2.writeStartElement("application"); xStreamWriter2.writeStartElement("apply"); xStreamWriter2.writeAttribute("toObject", "CAPTION"); xStreamWriter2.writeAttribute("styles", "CaptionFont"); xStreamWriter2.writeEndElement(); // apply xStreamWriter2.writeStartElement("apply"); xStreamWriter2.writeAttribute("toObject", "DataLabels"); xStreamWriter2.writeAttribute("styles", "LabelsFont"); xStreamWriter2.writeEndElement(); // apply xStreamWriter2.writeEndElement(); // application xStreamWriter2.writeEndElement(); // styles } xStreamWriter2.writeEndElement(); // chart xStreamWriter2.writeEndDocument(); xStreamWriter2.flush(); xStreamWriter2.close(); } catch (Exception e) { System.out.println("Exception occurred" + e.toString()); e.printStackTrace(); } return chartXML.toString().replace(""", "'"); } When i tried with fire bug the error was "syntax error javascript:updateFusionChart("1=1%20AND%20THE_DATE%20>=%20TO_DATE('01.01.2008',%20'DD.MM.YYYY')","Human%20Resources%20(Development)","Closed",""%20); Line 1 Any help will be appreciated. I am unable to post my XML generated .How can i post my XML. -
Hi sudipto, This is my link attribute value String newCondQuery = URLEncoder.encode(condQuery); xStreamWriter2.writeAttribute("link","JavaScript:updateFusionChart(""+newCondQuery+"",""+funcNameList.get(k)+"",""+statusNameList.get(k)+"",""+DrillDownKPI+"" );"); and this is the value that i am getting for newCondQuery 1%3D1+AND+THE_DATE+%3E%3D+TO_DATE%28%2701.01.2008%27%2C+%27DD.MM.YYYY%27%29 the " and ' are replaced by URLEncoder.
-
Problem Regarding Link in Drill Down Fusion Chart
ktsha replied to ktsha's topic in Javascript Problems
my code is not displaying in my replies. What should i do now. i put it in between -
Hope you are able to view my code.if else please tell me how to post the code. i had put the code in between
-
Problem with parameter passing of a javascript function in XML
ktsha replied to ktsha's topic in Javascript Problems
The problem is Solved. It was because of HTML Encoding problem . Use the below method or URLEcnoder class.There we have an encode method which will do the same -
Problem with parameter passing of a javascript function in XML
ktsha replied to ktsha's topic in Javascript Problems
Any one please help as it is very urgent to complete the sceduled work