fusioncharts - How to use drill down functionality using pop up window in ASP.Net (Fusion Charts) -
i using drill downwards functionality can click bar chart , open new page new kid chart. don't want open new window, want utilize pop window kid chart in it. have seen illustration fusion-chart website using xml format , cannot follow example. here entire code working fine thing need alter instead of opening new page; need utilize pop window. how can that? pls help , time.. here main page code:
//aspx code <asp:literal id="chart_from_db" runat="server"> </asp:literal> //code behind protected void page_load(object sender, eventargs e) { sqlconnection con = new sqlconnection(configurationmanager.connectionstrings["myconnectionstring"].connectionstring); stringbuilder xmlstr = new stringbuilder(); xmlstr.append("<chart caption='total revenue' palette='3' showvalues='0' numberprefix='$' useroundedges='1'>"); { string sqlstatement = "select category, avgnumbers table1"; sqlcommand cmd = new sqlcommand(sqlstatement, con); con.open(); sqldatareader reader = cmd.executereader(); while (reader.read()) { xmlstr.appendformat("<set label='{0}' value='{1}' link='{2}'/>", reader["category"].tostring(), reader["avgnumbers"].tostring(), server.urlencode("drilldown1.aspx?avgdays=" + reader["category"].tostring())); } xmlstr.append("</chart>"); reader.close(); con.close(); fusioncharts.setrenderer("javascript"); chart_from_db.text = fusioncharts.renderchart( "fusionchartsxt/column3d.swf", // path chart's swf "", // page returns chart data. leave blank when using info string. xmlstr.tostring(), // string containing chart data. leave blank when using info url. "annual_revenue", // unique chart id "640", "340", // width & height of chart false, // disable debug mode true); // register javascript object }
and here kid page opens when chart clicked.
// aspx code <div> <asp:literal id="mychart" runat="server"> </asp:literal> //code benind protected void page_load(object sender, eventargs e) { sqlconnection con = new sqlconnection(configurationmanager.connectionstrings["myconnectionstring"].connectionstring); string avgdays = request.querystring["avgdays"]; stringbuilder xmlstr = new stringbuilder(); xmlstr.append("<chart caption='total revenue' palette='3' showvalues='0' numberprefix='$' useroundedges='1'>"); { string sqlstatement = "select monthyear, avgnumbers table2 avgdays= '" + avgdays.tostring() + "'"; sqlcommand cmd = new sqlcommand(sqlstatement, con); con.open(); sqldatareader reader = cmd.executereader(); while (reader.read()) { // build chart info in xml format xmlstr.appendformat("<set label='{0}' value='{1}' link='{1}'/>", reader["monthyear"].tostring(), reader["avgnumbers"].tostring()); } // end xml string xmlstr.append("</chart>"); // close result set reader object , connection object reader.close(); con.close(); // set rendering mode javascript, default flash. fusioncharts.setrenderer("javascript"); // phone call renderchart method, pass right parameters, , write homecoming value literal tag mychart.text = fusioncharts.renderchart( "fusionchartsxt/column3d.swf", // path chart's swf "", // page returns chart data. leave blank when using info string. xmlstr.tostring(), // string containing chart data. leave blank when using info url. "crab", // unique chart id "640", "340", // width & height of chart false, // disable debug mode true); // register javascript object }
please refer link below.,. http://docs.fusioncharts.com/charts/contents/javascript/js_linkedcharts.html
-linkedcharts in extjs window -opening linkedcharts in jquery prettyphoto -opening linkedcharts in jquery dialog
i hope... may help you!
asp.net fusioncharts
No comments:
Post a Comment