Line Chart in SSRS

The Line Chart in SSRS is useful to connect individual dots. We can use this line chart to find the Forecast details, or trends in sales, or profit trends, etc.

In this article, we will show you how to create an SSRS Line Chart, How to change the Chart Title, Legend Title, Legend Position, Line Chart Font, Chart Model, and Display Data Labels on Line Chart in SSRS or SQL Server Reporting Services with an example.

For this SSRS Line Chart example, we use the Custom SQL query.

-- SQL Query that we use in SSRS Line Chart
SELECT Geo.EnglishCountryRegionName AS Country, 
       Geo.StateProvinceName AS State, 
       Geo.City, 
       Prod.EnglishProductName AS ProductName, 
       Prod.Color, 
       Fact.OrderQuantity, 
       Fact.TotalProductCost, 
       Fact.SalesAmount, 
       Fact.TaxAmt, 
       Fact.[Freight]
FROM DimProduct AS Prod 
   INNER JOIN FactInternetSales AS Fact 
      ON Prod.ProductKey = Fact.ProductKey 
   INNER JOIN DimSalesTerritory AS Terry 
      ON Terry.[SalesTerritoryKey] = Fact.[SalesTerritoryKey] 
   INNER JOIN DimGeography AS Geo 
      ON Geo.[SalesTerritoryKey] = Terry.[SalesTerritoryKey]

Create a Line Chart in SSRS

In this example, we are going to create a Line Chart to display the Trend in Sales amount by the Product Color. Below screenshot shows the Data Source and Dataset we used for this Line Chart Report.

Line Chart in SSRS 1

In the SSRS report design, we can add a Line chart by dragging the Chart property from the SSRS Toolbox to Design space. Or right-click on the report designer and elect the Insert -> Chart option from the context menu.

Line Chart in SSRS 2

It opens a new window called Select Chart Type to select the required chart from the available once. For this SSRS example, we are choosing the Line Chart.

Line Chart in SSRS 3

Once you click on the Ok button, the Line chart will display in the design region with dummy data.

Line Chart in SSRS 4

Click on the empty space around the SSRS Line Chart will open the Chart Data window

  • Values: Any Numeric (Metric) value such as Total Sales, Sale Amount, etc. All these values will aggregate using an aggregate function (Sum, Avg, Count etc). Because we are grouping them with the category group items.
  • Category Group: Please specify the Column name on which you want to partition your Line Chart.
Line Chart in SSRS 5

As we said before, In this example, we create a Line chart to find the Sales Trend by Product color. So, Drag and drop the Sales Amount column from dataset to chart data values and Product Color in the category group.

Line Chart in SSRS 6

Click on the Preview button to see the report preview.

Line Chart in SSRS 8

If you observe the above screenshot, It is providing the perfect result. Still, we are unable to identify the Sales at a Given point. So, let us add the Data Labels.

Add Data Labels to Line Chart in SSRS

Right-click on the Line chart, and select the Show Data Labels option from the context menu to show the values

Line Chart in SSRS 9

Next, we are formatting the Font, and changing the Number format from Default to Currency. To do so, Please select the Data labels, and right-click on it will open the context menu. Next, please select the Series Label Properties option.

Line Chart in SSRS 10

Here we are using comma separator for 1000, and we are allowing the SSRS report to show the data labels in Thousands

Line Chart in SSRS 12

Change Axis properties of a Line Chart in SSRS

Right-click on the Axis of a Line chart, and select the Horizontal Axis Properties.. option to format the Axis values.

Line Chart in SSRS 13

Here we changed the Font style and font size of both the Horizontal and Vertical Axis

Click on the Preview button to see the Line Chart in SSRS report preview.

Line Chart in SSRS 14

Change SSRS Line Chart Title

To change a Line Chart title, Please select the Chart title region, and change the title as per your requirement. OR, right-click on it and select the Title properties.. option from the context menu.

Line Chart in SSRS 15

Here we are changing the title as Line Chart Example because the report is displaying the same

Line Chart in SSRS 16

Format SSRS Line Chart Title Font

Within the Font tab, we can change the Font Size, Font Family, Font Style, and Color of a Line Chart Title. Here we are changing the Font to Cambria, Font size to 14pt, and color to Green

Line Chart in SSRS 17

Click on the Preview button to see the report preview.

Line Chart in SSRS 18

Change Axis Titles of a Line Chart in SSRS

To change an Axis title, Please select the Axis title region, and change the title as per your requirement. OR, right-click on it and select the Axis Title properties.. option from the context menu.

Line Chart in SSRS 19

It opens a new window called the Axis Title Properties window. Here you can change the Title text and also the Font style, size, and color. For now, we are changing the Color to Green, Font to Cambria, Size to 12pt

Line Chart in SSRS 20

Please apply the same properties to Y-Axis, as well. Next, click on the Preview tab to see the report preview.

Line Chart in SSRS 21

Multiple Line Charts in SSRS

Though the above chart fulfilled our requirement. Let me check the sales trend for each country. To do so, we have to add the country dimension to the existing Line chart.

For this, select the empty region around the Line Chart, and add the Country dimension to the Series Group.

Line Chart in SSRS 22

Now you see the sales trend for each color, and country

Line Chart in SSRS 23

Let me change the Lines thickness. And to do so, right-click on the Lines, and select the Series properties..

Line Chart in SSRS 24

It opens a new window called the Series Properties window. Under the Border tab, we can change the Line width, Color, Style (dotted, solid etc). For now, we are changing the line width from default 1pt to 2pt

Line Chart in SSRS 25

Click the Ok button to close the Series Properties window, and select the preview tab to see the report preview

Line Chart in SSRS 26

Format Legend Position of a Line Chart in SSRS

To format the Legend region, Please right-click on the Legend region, and select the Legend Properties option.

It opens a Legend Properties Window. Within the General Tab, we have an option called Legend Position to change the Legend Position by changing the dot positions. For now, we are changing the position from default right corner to Middle.

Click the Ok button to close the Properties window, and hit the preview tab to see the report preview

Line Chart in SSRS 27

Change the type of a Line Chart in SSRS

SSRS allows us to change the chart type even after creating a Line chart. To do so First, select the Line chart and right-click on it will open the context menu. Please select the Change Chart Type… option from it

Line Chart in SSRS 28

Once you select the Change Chart Type… option, it will open a new window called Select Chart Type to select the change. Here we are choosing the 3D Line chart

Line Chart in SSRS 29

Click on the preview tab to view the 3D line report preview

Line Chart in SSRS 30

From the above screenshot, you can observe that We successfully changed the Chart Type from 2D Line chart to 3D Line chart in SSRS

This time we are going to change the Chart Type from 3D Line chart to Smooth Line

Line Chart in SSRS 31

Click on the preview tab to see the line chart preview

Line Chart in SSRS 32

This time we are going to change the Chart Type from Smooth Line to Line with Markers

Line Chart in SSRS 33

Let me change the Marker Size, Color, Border Width, and border Color, before we see the preview

Line Chart in SSRS 34

Click on the preview tab to see the line chart preview

Line Chart in SSRS 35

This time we are going to change the Chart Type from Line with Markers to Smooth Line with Markers

Line Chart in SSRS 36

Let’s see the report preview

Line Chart in SSRS 37

Comments are closed.