The easiest way to add labels to the end of the lines on the line chart is through the marks card. Marks card is located below your filters shelf to the right of the data pane.
To illustrate how to label lines with the marks card, I have created a simple graph below using the Global Superstore dataset:
First, click on the Label icon under your marks card and tick Show Mark Labels. Then specify what kind of labels you want, in this instance, we choose Line Ends. You can also specify whether you want labels to appear at the start of the line, end of the line or both. For this example, I have chosen to label only the end of the line.
After these steps, you should be able to see the labels next to the line ends as per the example below:
I also embolden the text and matched the colour of the label with the colour of the mark, which can be done under the font option in your Labels card.
However
What if your chart is a dual-axis chart, with one of the axis already labelled? That is exactly the issue I have encountered during my second week of the Data School. I have created a bump chart that ranked markets by their profitability in 2013 and instead of displaying the colour legend, I wanted to display the name of the market next to each line.
However, when I tried following the previous process, the labels from one of the axis obstructed the labels from another.
Andy Kriebel showed me a useful trick on how to overcome this, which I want to share with you today. The first step was to extend the length of the axis and allow some breathing space for our labels. To do that, click on your date axis and choose Edit Axis.
On the window that opens, change the Range option from Automatic to Fixed and increase the fixed end by a month (from 20/10/2013 to 20/11/2013).
Then in your marks card, go to the shelf you want to edit. In my case, it was SUM(Profit), because SUM(Profit) (2) had my labels for ranks (1,2,3 etc.). In your case the names might differ, therefore make sure you are on the correct shelf.
After this, hit the Label icon again and click on the three dots next to the Text option. On the window that opens, move your cursor to the beginning of the text and add some spaces, which will shift your labels to the right.
After this you should be able to see the desired result:
Please feel free to download my dataset here.