Uchi

How To Show Total Sum Values On Pie Chart

Recommended Posts

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);

   }

Share this post


Link to post
Share on other sites
Guest Bindhu

Hi,

 

A warm welcome to the FusionCharts Forum :)

 

In order to suffice your requirement, you will have to explicitly specify the value in the subcaption.

 

Ref. Code :

<chart subCaption="Total : 75"..........></chart>

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

A warm welcome to the FusionCharts Forum :)

 

In order to suffice your requirement, you will have to explicitly specify the value in the subcaption.

 

Ref. Code :

<chart subCaption="Total : 75"..........></chart>

 

Hope this helps.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Automatic calculation of all the values to display one value as a total in sub caption is not possible.

 

You would need to manually specify the total value in the subCaption.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now