This week #workoutwednesday challenge was set up by Rody Zakovich, it was about creating a connected scatter plot on hover which allows user experience (UX) feature not available in natively available in product.
Requirements
- Dashboard size is 600 x 600
- The Scatter Plot has Sales by Profit for each Category and Year
- When a user hovers over any category, all years for the category will be connected by a line
- The line connects the categories by year in ascending order
Data for the workout can be downloaded from here
Here is my output for the challenge (Click on Image for interactive version):
The Challenge seems to be simple but the actual challenge is to create the effect without affecting other categories i.e. they should still be visible and not disappear
Let me share the steps I performed to achieve this effect which I think is cool way to showcase scatter plot for user experience:
Step 1: Data Preparation
Since dataset has 3 categories, we will union the orders sheet twice with original data with required fields of Order_date, Category, sales and profit.
This union of dataset will help us to create the action filter in further steps.
Step 2: Calculated Fields
CalcProfit: we will use LOD function to create average of profit values on the basis of Category, Table Name, year of Order date) since we have duplicated the numbers average will help us get original values
CalcSales: we will use LOD function to create average of sales values on the basis of Category, Table Name, year of Order date) since we have duplicated the numbers average will help us get original values
SalesCategorywisesales: This field is to aggregate the data on each category using the Table name field
SalesCount: This field is conditional field to show the line chart in our next chart
CalcCategory: Final field of mapping each category to table name for Action Filter
Step 3: Create the visualisation
Replicate the below Visualisation with relevant fields into rows and column shelf then create the dual axis. Post this add required field into Marks shelf for both CalcSales and SalesCount field.
Step 4: Add Action Filter
Last but the most important step, create an dashboard and import the sheet into dashboard. Then select the Dashboard –> Action Filter
set the action on hover on the basis of CalcCategory to Table Name
Do few changes in format and tooltip
Now we are ready with visualization with user experience which we wanted to show.
Thanks Rody Zakovich for this workout.
Happy Data Visualisation!!!!
Thanks for visiting this post. Please do let me know your feedback or if you have any questions about the blog do not hesitate to contact me on twitter (@Desaimithun)
Do subscribe to Tabvizexplorer.com to keep receive regular updates.