Stop making simple line charts. Add the power of max and min?instead.
Are you related to data and somehow make line charts on a daily basis? Well, let’s discuss how to make the line charts better.
I was recently creating a dashboard on Tableau and felt the need of creating a line chart. Well, if you are new to the field of data, line charts are normally used to distribute an attribute over a period of time. For example, if you want to show the growth in revenue for the last five years, you may use a line chart for it. What would it look like visually? Let me show you:
Returning to the topic, I was creating a line chart containing the revenue across different months for a year. This is how my chart was looking when I first added the measures to my workbook:
After creating this I felt like it is quite raw and like my steaks, I don’t like it raw. I wanted to add some flavor to it and cook it.
Then I chose to unleash the power of using maximum and minimum values in my distribution and also hiding all the axis and different values being shown here as I did not want the exact values to be shown I just wanted to see the distribution and where the sales hit the maximum and the minimum.
Let me take you to the workbook and show you the process.
After the first step, I hid the x and y axis on my sheet. This is how it looked after it:
A pretty clean diagram as I wanted it to be.
Then I created a custom measure as min/max sales and this is how the formula looked:
Then added this custom measure to my rows. Which changed my diagram to this:
But this is not what I wanted. I wanted it to be with the max and min on my diagram. Here comes the secret sauce of Tableau. You can combine the different attributes into a single axis. How?
Right-click on min/max sales and you will get:
领英推荐
Click on Dual Axis and voila, your diagram changed to:
Then I wanted the colors of the points to be appropriate and for this, I did the following:
Determined the field value on the Marks pane for the min/max sales as a circle which gave me the leverage to style them.
Then I dragged and dropped min/max sales custom measure on the color value of the same tab and it gave me the option to style the values we have in the measure and here they were only two, the min and the max.
This added a box on the right like this:
The next step wasto edit colors and this box had an option of “Edit Colors” which brought me to my next dialog box of color palettes. I wanted my max to be green while the min to be colored red.
Choosing red and green diverging color palettes distributed the two values perfectly.
After all this exercise this insane man finally had what he wanted, a line chart with max and min in distinguishing colors without any text distraction. The size could also be adjusted accordingly.
Let me show you how this visual looked on my dashboard; now you will know why I wanted it to be this way.
Does it look good? Let me know.
I hope this was helpful. I would love to know how you experimented with your line chart.
Basharat, a learning analyst, signing off.