Pie chart labels

9561
7
Jump to solution
06-16-2015 01:34 PM
ELTerrell
New Contributor III

Hi,

I just created a map with pie charts representing points and their %'s of Dems, Reps, and UNA's.  I was wondering if there is an easy way to create labels which are the percent of each site.  For example I'd like for a pie chart's label to say 50% D, 25% R, 25% UNA.  Any thoughts on how this could be easily done?  Other than adding text for each one...

Tags (2)
1 Solution

Accepted Solutions
SepheFox
Frequent Contributor

The only way I can think of to do that, would be to have three copies of the layer (two can have no symbology), label each one with a different field, convert to annotation, and then edit the annotation. Kind of a lot of work though. At that point you might as well add the text yourself.

View solution in original post

7 Replies
SepheFox
Frequent Contributor

Yes, you could create a label expression for your point feature class. In the label properties for the layer, click on the expression button, leave it in the default vbscript, and enter this in the box:

[DemField] & "% D" & vbCrLf& [RepField] & "% R" & vbCrLf& [UNAField] & "% UNA"

(You will need to change the text in the square brackets to your field names)

ELTerrell
New Contributor III

When I do that, it gives me the whole number of voters at the site as a percent i.e. 415%D, 500%R, 300%UNA.  Am I doing something wrong?  Would it be simpler to change my spreadsheet to include the percent at each site instead just the whole number?

0 Kudos
SepheFox
Frequent Contributor

Ok, it wasn't clear that your fields contained whole numbers, you only talked about percentages. Yes, you should add fields to calculate the percentages into, by putting in field calculator something like: ([DemField]/([DemField]+[RepField]+[UNAField]))*100. Then use the percentages fields to create your label expression. You could do the calculation in the label expression, but I'd do it in separate fields first.

ELTerrell
New Contributor III

That worked, thanks!  Is there a way to uncouple the %'s so I can put each label in it's respective pie slice?  Kind of like when you convert a legend to graphics, uncouple, and edit.

0 Kudos
SepheFox
Frequent Contributor

The only way I can think of to do that, would be to have three copies of the layer (two can have no symbology), label each one with a different field, convert to annotation, and then edit the annotation. Kind of a lot of work though. At that point you might as well add the text yourself.

ELTerrell
New Contributor III

Yeah, that's what I was thinking.  Thanks!

0 Kudos
SepheFox
Frequent Contributor

You're welcome. If this answered your question, would you mind marking it as answered? Thank you!

0 Kudos