Jump to content
Software FX Community

PointLabels Total in Stacked Bar Chart


ozykaboo

Recommended Posts

I am trying to create a stacked bar chart and display the TOTAL of each stack of series in the Chart.

For example, currently if we want to show the pointlabels for a stacked bar chart, the labels we will only see are the value for each series in the stack individually. What I would like to do is, in addition to showing each series value, is at the very top of the stack, to have it display the total for the entire stack of all series.

Is this possible in any way? 

 

 

 

Link to comment
Share on other sites

Yes. This is possible. The question is where do you want to display this total. Since you want to display the actual value and, in addition, the total value, you will have to decide where to display it as the space for the label will be already taken.

Foe example, if you want the total, and then in the next line the value for the last bar you can do: 

chart1.AllSeries.PointLabels.Visible =

true;

chart1.Series[chart1.Data.Series - 1].PointLabels.Format = "%T\n%v";

Link to comment
Share on other sites

The formatting code you gave me works great for getting the total.. thanks.

However, I was hoping to label the stack so that each series displayed its individual series value in the middle of its bar, with the total of the stack on very top (outside the stacked bars). This is assuming that you are using vertical bars of course... Maybe this could be posible with a work around through code by manually calculating the totals somehow???

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...