visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Making a Stacked Bar Pivot Label refer to column names.

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Getting Started
View previous topic :: View next topic  
Author Message
bradwood



Joined: 12 Oct 2017
Posts: 4

PostPosted: Thu Oct 12, 2017 12:10 pm    Post subject: Making a Stacked Bar Pivot Label refer to column names. Reply with quote

SO I've built this stacked bar using a Pivot command.

https://pasteboard.co/GOBoZ7b.png

I want to label the bars within each stack, but not with the number (a count) but with the label for that set of data.

How do I do that?

Been scratching my head for a while on this...

Loving the software otherwise, although the curve is pretty steep!

THanks

Brad
Back to top
View user's profile Send private message
bradwood



Joined: 12 Oct 2017
Posts: 4

PostPosted: Mon Oct 16, 2017 6:53 am    Post subject: Reply with quote

bump...
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1940
Location: Chapel Hill, NC

PostPosted: Mon Oct 16, 2017 9:27 am    Post subject: Reply with quote

Thanks.

I thought about this a little bit. There is a way to do this. You can extract the data from the pivot command back as columns. The simplest way to do that is to use the gear menu in the top right corner. Once you have them as columns, including the column labels, you can use those labels in a Bars command.

Normally you use the legend to indicate what color is what. I can see how drawing the labels in one of the categories (in your case the top one) could be a good way to do this, but I think it gets a little redundant to have a the same label.

If you just want to do it for one graphic, you can use the Label command since every point has a coordinate. I would not recommend it if you want to do this for multiple data sets, and then the first approach is better.

David
Back to top
View user's profile Send private message Send e-mail
bradwood



Joined: 12 Oct 2017
Posts: 4

PostPosted: Mon Oct 16, 2017 9:42 am    Post subject: Reply with quote

Thanks David,

I guess I'm just being thick, but I don't get what you mean for your first option. I did this:

click gear on pivot command
extract all pivot columns
create a bar command and set type to Y-stacked
set the label to "Row Labels"

It doesn't seem to work Sad

Can you tell me what I'm doing wrong?

Regarding legends:

I'm not a fan of legends/keys at all, based on my reading of "Show me the numbers" by Stephen Few. I am much more in favour of actually labelling the line/bar on the chart itself with legend information...

This PDF, by Few, gives the gist of his argument...

https://nces.ed.gov/programs/slds/pdf/08_F_06.pdf

However, I'd strongly recommend shelling out for the book.

Thanks again

Brad
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1940
Location: Chapel Hill, NC

PostPosted: Mon Oct 16, 2017 11:09 am    Post subject: Reply with quote

Legends are often overused, but to avoid them (like the book shows) you might need to manually position them. For the Plot command you can decide if the label shows up in the legend or at the end of the line, just like in the pdf that you sent a link to.

I looked at your graph a little better, and see that there are a lot of categories, some with the same colors. A lot of the values in the pivot table are 0 so they aren't drawn. In fact, it might be that labels wouldn't be repeated at all if you drew all of the labels instead of the values, but for a typical Pivot command that would happen.

My directions would not be very helpful in this case, and the flattened output would be closer to what you want. The problem with that however is that it won't include the stacked location.

Another issue is that you are cycling through the color scheme. The most recent beta added a new way to color categories based on a color scheme. That will be better for you in this case to associate colors with categories.


The fallback is to create the locations by hand and put them into three columns, x, y, label. Then use the Points command to draw those labels at the x,y locations. That might be needed anyway because there isn't that much space for a lot of the labels and you might need to visually stack them or put them in the same order to the right of the column. For example for 'Performance" you might need to just list the three categories to the right of the stack in order for things to be legiblel.

You can also send us the file to help@visual... and we can comment on the the particulars.

David
Back to top
View user's profile Send private message Send e-mail
bradwood



Joined: 12 Oct 2017
Posts: 4

PostPosted: Mon Oct 16, 2017 11:52 am    Post subject: Reply with quote

ok... all good comments...

in the end I decided to do this manually with a combination of either text or label commands...

thanks

b
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> Getting Started All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group