Uchi

Members
  • Content count

    8
  • Joined

  • Last visited

About Uchi

  • Rank
    Forum Newbie
  1. 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
  2. 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] }
  3. Hi, I am trying to create multi-series column chart and i am having problem creating this simple chart. I want to use the GroupCategory field as Series names and i also want to use the Date field as the Category and TotalCount field is the value. How can i create such multi-series column chart? please help as i am strugling with this. thanks. Here is my code: public string CreateHistoricalChart() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString); string sqlStatement = "select Date, GroupCategory, COUNT(Status)TotalCount from MainTable group by Date, GroupCategory"; SqlCommand cmd = new SqlCommand(sqlStatement, con); con.Open(); SqlDataReader reader = cmd.ExecuteReader(); string strXML; strXML = "<graph decimalPrecision='0' name='MyXScaleAnim' type='ANIMATION' duration='1' start='0' param='_xscale' showNames='1' labelDisplay='Rotate' useEllipsesWhenOverflow='1' pieSliceDepth='30' formatNumberScale='0'>"; while (reader.Read()) { strXML += "<set name='" + reader["Date"].ToString() + reader["GroupCategory"].ToString() + "' value='" + reader["TotalCount"].ToString() + "' />"; } strXML += "</graph>"; return FusionCharts.RenderChart("../FusionCharts/Column3D.swf", "ChartID", strXML, "FactorySum6", "870", "350", false, true); }
  4. I am trying to show my fusion chart in a specific area specially where i am calling the CreateChart function in my aspx file so i only want the chart to load upon clicking a button. The way I have it right now is that the chart loads as soon as the page loads but what I would like to see is the chart only loads when the button is clicked. I have tried different ways but not able to get it right since I am not so familiar with fusion charts. Thanks Here is my ASPX file: <table class="style1"> <td class="style8"> <asp:Button ID="btnClick" runat="server" Height="29px" Text="Button" Width="158px" onclick="btnClick_Click" /> </td> <td class="style4" colspan="2"> <% =CreateChart() %> </td> </tr> </table> and here is my code behind: public string CreateChart() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString); string sqlStatement = "select Status1, Count(Status1) as TotalCount from MyTable where Closing_Date = '" + txtStartClosingDate.Text + "' and Closing_Date <= '" + txtEndClosingDate.Text + "' and Status1 is not null group by Status1"; SqlCommand cmd = new SqlCommand(sqlStatement, con); con.Open(); SqlDataReader reader = cmd.ExecuteReader(); string strXML; strXML = "<graph labelDisplay='auto' useEllipsesWhenOverflow='1' decimals='2' decimalPrecision='0' showValues='1' enablesmartlabels='0' showlabels='0' legendAllowDrag='1' numberSuffix=' Days' showLegend='1' pieSliceDepth='45' formatNumberScale='0'>"; while (reader.Read()) { strXML += "<set name='" + reader["Category"].ToString() + "' value='" + reader["AvgNumbers"].ToString() + "' />"; } strXML += "</graph>"; return FusionCharts.RenderChart("../FusionCharts/Pie2D.swf", "ChartID", strXML, "FactorySum", "450", "450", false, false); }
  5. thanks, but is there a way to auto capture that value? the value keep changes always based on the dynamic that i generate.
  6. Is there a way to display the total sum of the pie chart in fusion charts? [color=#00008B]public[/color] [color=#00008B]string[/color] [color=#2B91AF]CreateChart[/color]() { [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=#00008B]string[/color] sqlStatement = [color=#800000]"SELECT Category, AvgNumbers FROM MyTable"[/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]string[/color] strXML; strXML = [color=#800000]"<graph caption='Average Days To Close' subcaption='I want to show here the Total Sum' labelDisplay='auto' useEllipsesWhenOverflow='1' decimalPrecision='0' showValues='1' enablesmartlabels='0' showlabels='0' legendAllowDrag='1' numberSuffix=' Days' showLegend='1' pieSliceDepth='45' formatNumberScale='0'>"[/color]; [color=#00008B]while[/color] (reader.[color=#2B91AF]Read[/color]()) { strXML += [color=#800000]"<set name='"[/color] + reader[[color=#800000]"Category"[/color]].[color=#2B91AF]ToString[/color]() + [color=#800000]"' value='"[/color] + reader[[color=#800000]"AvgNumbers"[/color]].[color=#2B91AF]ToString[/color]() + [color=#800000]"' />"[/color]; } strXML += [color=#800000]"</graph>"[/color]; [color=#00008B]return[/color] [color=#2B91AF]FusionCharts[/color].[color=#2B91AF]RenderChart[/color]([color=#800000]"/FusionCharts/Pie3D.swf"[/color], [color=#800000]"ChartID"[/color], strXML, [color=#800000]"FactorySum"[/color], [color=#800000]"450"[/color], [color=#800000]"450"[/color], [color=#00008B]false[/color], [color=#00008B]false[/color]); }
  7. Hi, Pls. ignore my ignorance as I am new to fusion charts and also new to this site. I have created fusion charts in ASP and all what i am trying to do is to show the total sum values of all the slices of the pie chart. For instance, if i have 3 slices on my pie chart: and each one has these values: 20, 30, 25; so i want to show the total 75 in the sub caption area. Is there a way to do this? please help. public string CreateChart() { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString); string sqlStatement = "SELECT Category, AvgNumbers FROM MyTable"; SqlCommand cmd = new SqlCommand(sqlStatement, con); con.Open(); SqlDataReader reader = cmd.ExecuteReader(); string strXML; strXML = "<graph caption='Average Days To Close' subcaption='I want to show here the Total Sum' labelDisplay='auto' useEllipsesWhenOverflow='1' decimalPrecision='0' showValues='1' enablesmartlabels='0' showlabels='0' legendAllowDrag='1' numberSuffix=' Days' showLegend='1' pieSliceDepth='45' formatNumberScale='0'>"; while (reader.Read()) { strXML += "<set name='" + reader["Category"].ToString() + "' value='" + reader["AvgNumbers"].ToString() + "' />"; } strXML += "</graph>"; return FusionCharts.RenderChart("/FusionCharts/Pie3D.swf", "ChartID", strXML, "FactorySum", "450", "450", false, false); }