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.

-- Query that we use in 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.

Data Source and dataset

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

Insert Line Chart

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.

Select Line Chart Type

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

Line Chart with sample data

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.
Add Line Chart Data

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.

Add Values and Category Groups columns

Click on the Preview button to see the report preview.

Preview Line Chart

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

Show Data labels of Line Chart

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 Series Label properties

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

Format Line Chart Numbers

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 Horizontal Axis Properties

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 Preview

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 Title Properties

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

Change Line Chart Title Position

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

Format Line Chart Title Font

Click on the Preview button to see the report preview.

Formatted Line Chart Preview

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.

Change Line Chart Axis Titles

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

Format Line Chart Axis Title properties

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

Line Chart 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 22

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

Multiple Line Charts

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

Multiple Line Chart Series properties

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

Change Line width

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

Line Chart preview

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 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

Change Line Chart Type

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

Select 3D Line Chart Type

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

3D Line Chart in SSRS

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

Select Smooth Line Chart type

Click on the preview tab to see the line chart preview

Smooth Line Chart Preview

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

Select Line and Markers Chart

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

Change Markers Color and size

Click on the preview tab to see the line chart preview

Line and Markers Chart Preview

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

Select Smooth Line and Markers Type

Let’s see the report preview

Smooth Line and Markers Type Preview

Comments are closed.