We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Stacking Column Chart ( Values of each "color" in the stack)

Thread ID:

Created:

Updated:

Platform:

Replies:

99881 Jun 16,2011 11:39 AM Jun 21,2011 12:50 AM ASP.NET Web Forms (Classic) 3
loading
Tags: Chart
victor elizondo
Asked On June 16, 2011 11:39 AM

Hi everybody

I have two requests

1._ In the image I've attached, there a stacking columns chart. As all of you can see, there's a values for the orange column in the stack, I'm using C# in Visual Studio 2008 with aspx and the code snippet that basically activates those numbers is:

-----------------------------------------------------------------
ChartSeries series1 = new ChartSeries("Series1", ChartSeriesType.StackingColumn);

series1.Style.DisplayText = true;
-----------------------------------------------------------------

The problem is as all of you can see, the numbers are in the middle of the line of the column (In the image, the numbers are between the orange and the blue) and I want to know if there's a way to put down the number (the number 20 in the image must be just in the orange column).


2._ How can I show the sum value from the column stack in the above position in the column?

Best Regards.



stackingcol_3b8b3662.zip

Vijayabharathi K [Syncfusion]
Replied On June 17, 2011 02:23 AM

Hi Victor,

Thanks for using Syncfusion product.

1) there's a way to put down the number?

We suggest you to use “TextOrientation” property of series style to display the number within a column. Please refer the below code snippet to achieve this,

[C#]

this.chartControl1.Series[0].Style.TextOrientation = ChartTextOrientation.Down;

You can find more information about these properties in the online documentation link from below

http://help.syncfusion.com/ug_92/User%20Interface/ASP.NET/Chart/Documents/45184textorientation.htm

2) How can I show the sum value from the column stack in the above position in the column?

If your intention is to display the sum value in top of stacking column, we suggest you to use “CustomPoints” feature to display the sum value in top of stacking column. Please refer the below code snippet to achieve this,

[C#]

for (int i = 0; i < 5; i++)
{
ChartCustomPoint cp = new ChartCustomPoint();
double sum = series1.Points[i].YValues[0] + series2.Points[i].YValues[0] + series3.Points[i].YValues[0] + series4.Points[i].YValues[0];
cp.Text = "Sum:" + " " + sum;
cp.CustomType = Syncfusion.Windows.Forms.Chart.ChartCustomPointType.ChartCoordinates;
cp.Alignment = ChartTextOrientation.Up;
cp.XValue = i;
cp.YValue = sum;
cp.Color = Color.Black;
cp.Font.Bold = true;
cp.Font.Facename = "Verdana";
cp.Font.Size = 10F;
this.ChartWebControl1.CustomPoints.Add(cp);
}
You can find more information about these properties in the online documentation link from below

http://help.syncfusion.com/ug_92/User%20Interface/ASP.NET/Chart/Documents/453custompoints.htm

Please refer the attached screenshot for both queries.

Let us know if we misunderstood your query please provide us some clear details or screenshots about your requirement.

Regards,
Vijayabharathi






ScreenShot_ae994df0.zip

victor elizondo
Replied On June 20, 2011 05:44 PM

Hi Vijayabharathi

Thanks a lot for you useful help. Now I've solved this problem.

Best Regards.
Víctor


Vijayabharathi K [Syncfusion]
Replied On June 21, 2011 12:50 AM

Hi Victor,

Thanks for the update.

please let us know if you need further assistance

Regards,
Vijayabharathi


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;