Online tableau training, tableau tips, & video tutorials

Chart Types


3 Ways to Make Lovely Line Graphs in Tableau



Ryan Sleeper

Cementing line graphs as a top choice for your Tableau data visualizations by making them more engaging

This video shares three ideas for making your Tableau line graphs more engaging including formatting tips and two ways to use a dual-axis.

Hi, this is Ryan with Playfair Data TV. And in this video, I’m going to show you three ways to make your line graphs more engaging in Tableau.

To get started, I’m going to make a just default line graph by double-clicking Sales, right-clicking Order Date, dragging it to the columns shelf, and choosing the Month Date part with the green icon next to it, which will make it continuous.

I’m also going to break down this line graph by segment by putting the segment dimension on the color marks card. This creates what a lot of people call a spaghetti graph. Looks like a bunch of noodles just thrown onto the view. To make us a little bit better, I’m going to also filter the date down to just one year of the data. That will clean up the marks just a little bit.

But essentially, this is the default format of a line graph in Tableau. It’s good. It’s actually really good. I know that Tableau invests a lot of money in R&D trying to figure out the best colors, the best data-ink ratio, the best fonts, formats, all kinds of things.

But I’m going to show you three ways to enhance this. The first is to use some of the formatting features already available to you in Tableau.

First thing that I almost always get rid of is this axis title. So Month of Order Date 2018, that’s kind of repetitive. I’m going to– you can get rid of that by right-clicking on the axis. Don’t deselect Show Header because that’ll get rid of both the axis title as well as the tick marks. But if you click Edit Axis, there’s a spot where you can remove the axis title. Just highlight the axis title, clear it out. Notice it updated in real time. And now if I close this, we no longer have that redundant month of date, title down there.

Also, we could add markers it’s called, which is an effect that I like, by clicking the Color Marks card. And under Effects, there’s something called Markers. The option in the middle will add a little circle to each data point. I think that looks a little bit nicer.

And lastly, we could enhance this by highlighting a specific dimension member. The first way we could do that, so let’s pretend that we’re the manager of the home office segment. If we wanted to highlight our performance in the context of the consumer and corporate segment, the first way to do that is to just click on the dimension member within the color legend. And as long as this little icon right here is selected, that’s supposed to look like a small highlighter, clicking on a dimension member will highlight it throughout the view.

But you can also set that color or that highlight to be a little bit more permanent by remapping colors. To remap a color, you can– there’s a couple of ways, but the easiest way is to just double-click any of the colors in the color legend. That opens this little interface where you can remap a color.

So for example, I could apply some type of gray shading to my other two dimension members. So Consumer, I’ll make that a light gray. Corporate, maybe a slightly darker gray. Click OK. And now we’ve set this permanent highlight.

This is if we didn’t really care to analyze the specific performance of the other segments. We just wanted to see how we’re performing in context of the others. This would be a good application for this.

Notice now that the gray lines– here’s a good spot to look– are laying on top of the red line. That’s because these colors go in order. This is drag and drop just like much of Tableau. If I wanted to reorder these, I can left-click the home office segment and drag it towards the top. Now, the red line will always lay on top of those gray lines.

So that was the first method. We just used some of the formatting techniques that were available to us right out of the box in Tableau to make this line graph a little bit better.

The second way I encourage you to make your line graphs more engaging is to maximize the data-ink ratio. It’s the ratio of total ink on the view that’s dedicated to the data.

This particular view has quite a bit of what’s called redundant data-ink. Mainly looking at the y-axis here. So notice we’ve got, we’ve got our sales amounts. They go in increments of every 5,000. Yes, that ink is dedicated to data, but that data is quite redundant. That’s a few too many tick marks for my taste.

So if I wanted to fix that, I could right-click and click Edit Axis. And there’s a tab called Tick Marks. I’ll navigate to that Tick Marks tab. And maybe instead of every 5,000, which is the automatic sizing of the tick marks, I could choose Fixed, and we’ll just use 10,000, which is what it changed to there.

One little word of caution with this, once you fix tick marks, they are truly fixed. So you have to be careful because if the scale ever changes dramatically, the tick marks will not. So if this scale all of a sudden was zero to a million, we might want even fewer than increments of 10,000. Or on the other side of that scale, if all of a sudden our range only went from zero to 9,000, we wouldn’t see any tick mark.

So you have to be careful if you’re ever fixing the tick marks. For that reason, I often opt to do a direct label instead of even having an axis, but just a couple of things to watch out for.

You can also modify tick marks even with dates if it’s a continuous axis, which is what we’ve got here. This one– take it or leave it, but this is my personal preference. I don’t need to see the name of each month down here. I just would like to know the start of the range and the end of the range.

So another opportunity to get rid of some of this redundant data-ink is to modify the tick marks of the x-axis, just like we did on the y-axis. You can right-click on the axis, click Edit Axis, go to Tick Marks, and we’ll fix those to occur every 12 months.

And we’ll also need to change the tick origin to be January 1. So to ensure that our ticks start at January 1. And actually, it was every 11. Let’s see. Yeah, there we go. So I changed the tick origin to start on January 1, which gave me the first tick, and then 11 months later, we had the end of the range for December.

Exit off of here. And now we’ve greatly maximized the data-ink ratio, leaving just the data that’s critical to this analysis.

The third and final tip I’ve got for you to make your line graphs more engaging is to leverage a dual axis. I’m going to show you two different applications of this. You obviously can’t do this last tip unless you’re not using the other axis for anything. But in this case, we’re not.

So I’m going to replicate this left axis on the right-hand side by dragging Sales next to itself on the rows shelf. When I do that, we’ll have the same chart on two different rows. I’m going to combine these by making this a dual axis.

There’s several ways to do this as well. The way that most people learn is to click on the second occurrence of the pill and click Dual Axis. That makes both of our line graphs lay right on top of each other.

If I click Undo, another way to do it that’ll save you one click is to hover over that axis, and when this green triangle appears, click on it and drag it to the opposite side. That does the same exact thing.

But what’s important about this is we’ve got two measures on the rows shelf, and now they each have their own set of marks cards over here, and we can edit those independently of each other. So I can navigate to the second axis and change the mark type from Line to Circle.

And notice what happened there. It looks like our markers got a little bit bigger. But actually what’s happening is we’ve got a line graph on the left and a dot plot on the right. I can see they’re not exactly lined up. You can ensure the axes are lined up by right-clicking on either axis and clicking Synchronize Axis. You saw just a tiny shift there. But now we know for sure that both these line graphs, or both of these graphs are lying right on top of each other and they’re perfectly synchronized.

But the use case for this, a lot of people, they love those markers, those little circles that appear on each data point. But one of the drawbacks with those or limitations to those is the formatting is very, very limited. Basically, what you see is what you get.

With what we’ve just done, we can now format the label or the markers independently of the lines. So for example, I could make those circles larger if I wanted to. I could also color them based on an increase or a decrease. I could use shapes. So I could have an up triangle or a down triangle based on performance. Basically, we’ve unlocked limitless formatting capabilities of our markers by leveraging that dual axis.

I’m going to show you one more application of that dual axis that works best if we’re just looking at one dimension member. So I’m first going to limit this to just the home office segment.

And this is a little trick I borrowed from Google Analytics. And any time that they show the performance of one specific dimension member, they use a dual axis line graph and area chart. It’s very easy to convert what we’ve already built with these markers to that combination chart I just described by simply changing the mark type. So instead of Circle for the second axis, I’m going to change the mark type to Area.

And whenever I do this, I make the area very kind of faded out. And you can do that by clicking on the color marks card and reducing the saturation or the opacity of that color by dragging this to the left. I go pretty far. Somewhere between 15 and 20.

But this kind of gives us the best of both worlds. We’ve now got the full saturation and we can see the trend on the line graph. But it makes it a little bit more design friendly. Just gives it a little bit more professional polish with that area chart in the background.

Lastly, because we no longer need the second y-axis, I’ll go ahead and hide that by simply right-clicking on it and deselecting Show Header.

This has been Ryan with Playfair Data TV – thanks for watching!