For #VizTheVote month I wanted to take a closer look into what has arguably been one of the biggest political events this year in the UK – the Scottish independence referendum (the outcome: on 18 September 2014 Scotland voted ‘No’ and chose to remain part of Great Britain). The question of Scottish independence is very emotive for many people, and nowhere could this be seen better than on Twitter using #Indyref. I was particularly interested in seeing how the conversation on the 18th compared to the outcome of the vote; did #Indyref align to how people were voting?
(Click the image below to view the viz)
Building the Viz
As I was looking at Twitter data (collected via DataSift) I really wanted my viz to look like a TwitterReverb graphic (if you haven’t seen one before check this one out showing #Indyref during the referendum debate on 25 August). While TwitterReverb graphics are eye-catching, they are pretty limited in how they let you interact with the data. My challenge was set: how can I make a dashboard where you could drill down into the data while keeping true to the TwitterReverb one page style?
I had recently read this post by Andy Kriebel on how to make pop-up charts in Tableau and thought they would be perfect for my TwitterReverb style challenge. After I built the basic elements of the TwitterReverb graphic: tweets/min line chart and circular badge images, I was ready for some pop-up action! (Check these posts for how to use custom images into Tableau and how to make bar charts in tooltips).
Making pop-up charts in Tableau
Drag the chart you want to drill down to onto the dashboard where you want it to ‘pop-up’ (I added it as a floating object). Hide the chart’s title and remove any unwanted quick filters or legends. If you don’t hide the chart’s title you will end up with a title floating on your dashboard.
Now create a dashboard filter action (Dashboard > Actions > Add Action > Filter). Within the Filter options menu you need to have this selection:
- Source Sheets = the sheet you want to click on to trigger the pop-up sheet. For my dashboard I wanted people to click on the circular badges to trigger the pop-ups, so I selected the badges as my source sheets. Note that you should only have one source sheet to one pop-up sheet. This meant that I had to make multiple dashboard actions to get all the pop-ups I wanted.
- Target Sheets = the sheet you want to pop-up. In my case these were my ‘drill down’ sheets. Again note that you should only have one pop-up sheet to one source sheet.
- Clearing the selection will = select ‘Exclude all values’ (this is very important if you miss selecting this then your sheet won't disappear!!).
- Run action on = what action do you want to trigger the pop-up? I wanted a ‘click’ so I chose ‘Select’, but it works well with ‘Hover’ as well.
- Target Filters = if you want to filter your pop-up sheet by a field in your source sheet, you will need to select ‘Selected Fields’ and then choose which field you want to filter on. I needed to do this for my ‘VoteYes’ and ‘VoteNo’ pop-up and I added the ‘Hashtag (manual)’ field as the filter.
If you have more than one pop-up sheet on your dashboard that overlap (I had three) you will need to layer them. This is important because once a pop-up sheet overlaps another sheet you won’t be able to interact with the data on that sheet.
In my case I only had one pop-up sheet (the ‘VoteYes’/’VoteNo’ tweets by minute drill down) that I really wanted people to be able interact with. I re-ordered my pop-up sheets to make sure that this sheet was sitting on top of the other two pop-up sheets.
To re-order the layering of sheets on a dashboard right-click on that sheet in the ‘Layout’ part of the dashboard marks menu and select ‘Floating Order’ to bring sheets forward or backwards.
How does the pop-up work?
By selecting the ‘Exclude all Vales’ in the Actions menu you effectively exclude all the data in the pop-up sheet until the pop-up action is triggered. This means that the sheet sits on your dashboard with ‘nothing’ in it – in effect it is invisible.
This same principle – having no data on a sheet – can be used to make other great effects. Check out one of them (making a hidden image ‘appear’) in this post.
Using pop-up style actions meant that I could keep all my sheets on one page and stick to my TwitterReverb stylistic challenge. But what did I find out about the use of #Indyref on the day of the vote? It appears that the chatter on Twitter wasn’t a good predictor of the outcome of the vote – ‘VoteYes’ was a lot more vocal than ‘VoteNo’.