Uchi Report post Posted February 16, 2013 Hi, i am trying to use the drill down functionality using the link method. I am able to use the link to open up a new page but what i am trying to do is to use the pop up window instead of opening a new page. How can i modify the code below in order to use pop up window: something like what is shown here: <set label="2004" value="37800" link="newchart-xmlurl-Data2004.xml" /> but was not able to modify my code. Here is my code: [color=gray]//aspx code[/color] <asp:[color=#2B91AF]Literal[/color] ID=[color=#800000]"chart_from_db"[/color] runat=[color=#800000]"server"[/color]> <[color=#800000]/asp:Literal> /[/color]/code behind [color=#00008B]protected[/color] [color=#00008B]void[/color] [color=#2B91AF]Page_Load[/color]([color=#00008B]object[/color] sender, [color=#2B91AF]EventArgs[/color] e) { [color=#2B91AF]SqlConnection[/color] con = [color=#00008B]new[/color] [color=#2B91AF]SqlConnection[/color]([color=#2B91AF]ConfigurationManager[/color].[color=#2B91AF]ConnectionStrings[/color][[color=#800000]"MyConnectionString"[/color]].[color=#2B91AF]ConnectionString[/color]); [color=#2B91AF]StringBuilder[/color] xmlStr = [color=#00008B]new[/color] [color=#2B91AF]StringBuilder[/color](); xmlStr.[color=#2B91AF]Append[/color]([color=#800000]"<chart caption='Total Revenue' palette='3' showValues='0' numberPrefix='$' useRoundEdges='1'>"[/color]); { [color=#00008B]string[/color] sqlStatement = [color=#800000]"SELECT Category, AvgNumbers FROM Table1"[/color]; [color=#2B91AF]SqlCommand[/color] cmd = [color=#00008B]new[/color] [color=#2B91AF]SqlCommand[/color](sqlStatement, con); con.[color=#2B91AF]Open[/color](); [color=#2B91AF]SqlDataReader[/color] reader = cmd.[color=#2B91AF]ExecuteReader[/color](); [color=#00008B]while[/color] (reader.[color=#2B91AF]Read[/color]()) { xmlStr.[color=#2B91AF]AppendFormat[/color]([color=#800000]"<set label='{0}' value='{1}' link='{2}'/>"[/color], reader[[color=#800000]"Category"[/color]].[color=#2B91AF]ToString[/color](), reader[[color=#800000]"AvgNumbers"[/color]].[color=#2B91AF]ToString[/color](), [color=#2B91AF]Server[/color].[color=#2B91AF]UrlEncode[/color]([color=#800000]"DrillDown1.aspx?AvgDays="[/color] + reader[[color=#800000]"Category"[/color]].[color=#2B91AF]ToString[/color]())); } xmlStr.[color=#2B91AF]Append[/color]([color=#800000]"</chart>"[/color]); reader.[color=#2B91AF]Close[/color](); con.[color=#2B91AF]Close[/color](); [color=#2B91AF]FusionCharts[/color].[color=#2B91AF]SetRenderer[/color]([color=#800000]"javascript"[/color]); chart_from_db.[color=#2B91AF]Text[/color] = [color=#2B91AF]FusionCharts[/color].[color=#2B91AF]RenderChart[/color]( [color=#800000]"FusionChartsXT/Column3D.swf"[/color], [color=gray]// Path to chart's SWF[/color] [color=#800000]""[/color], [color=gray]// Page which returns chart data. Leave blank when using Data String.[/color] xmlStr.[color=#2B91AF]ToString[/color](), [color=gray]// String containing the chart data. Leave blank when using Data URL.[/color] [color=#800000]"annual_revenue"[/color], [color=gray]// Unique chart ID[/color] [color=#800000]"640"[/color], [color=#800000]"340"[/color], [color=gray]// Width & Height of chart[/color] [color=#00008B]false[/color], [color=gray]// Disable Debug Mode[/color] [color=#00008B]true[/color]); [color=gray]// Register with JavaScript object[/color] } Share this post Link to post Share on other sites
Guest Sashibhusan Report post Posted February 18, 2013 Hi, If you are required to open a pop-up window and render the drilled-down/child chart, you would need to start the link with prefix "p-" and would need to pass the URL of the page which will render the child chart, as the last parameter. Ref. Code: <set label="2004" value= "37800" link="P-nameOfWindow, resizable=no-showChildChart.asp"/> For more information on "Opening links in pop-up windows", please follow the link below: http://docs.fusioncharts.com/charts/contents/?DrillDown/PopUps.html Also, for more information on "FusionCharts Link format", please follow the link below: http://docs.fusioncharts.com/charts/contents/?DrillDown/LinkFormat.html Hope this helps! Looking forward to your valuable feedback. Share this post Link to post Share on other sites
Uchi Report post Posted February 20, 2013 thanks for your response but that is the problem i am facing because this example is just using XML and i am pulling the data from a database so what i don't know is how to translate this example when pulling the data from sql server database. If you can show me how to do that i would appreciate. thanks Hi, If you are required to open a pop-up window and render the drilled-down/child chart, you would need to start the link with prefix "p-" and would need to pass the URL of the page which will render the child chart, as the last parameter. Ref. Code: <set label="2004" value= "37800" link="P-nameOfWindow, resizable=no-showChildChart.asp"/> For more information on "Opening links in pop-up windows", please follow the link below: http://docs.fusionch...own/PopUps.html Also, for more information on "FusionCharts Link format", please follow the link below: http://docs.fusionch...LinkFormat.html Hope this helps! Looking forward to your valuable feedback. Share this post Link to post Share on other sites
Guest Sashibhusan Report post Posted February 21, 2013 Hi, As I have mentioned in the previous post,if you will use "P-" to open child chart in a pop up window, you would need to create a separate chart in the linked ASP page. (for Example: as per the sample code snippet, in showChildChart.asp). Please note that instead of passing dynamic generated XML data to the link, you will have to render the chart in the same linked ASP page, so that while clicking on the data plot, the linked ASP page will open in the pop up where you can get the child chart. However, currently we do not have any ready implementation of the same. Hope this helps! Share this post Link to post Share on other sites