SSRS - Bar chart with line

In this article , I will shown an example on how to create Bar chart with line .

Step 1: Create Data source and then create Dataset with below query :

DECLARE @SalesByMonth TABLE (Sort INT,Months VARCHAR(20),Sales INT)
INSERT @SalesByMonth SELECT 1,'Jan',100
INSERT @SalesByMonth SELECT 2,'Feb',1000
INSERT @SalesByMonth SELECT 3,'Mar',200
INSERT @SalesByMonth SELECT 4,'Apr',500
INSERT @SalesByMonth SELECT 5,'May',300
INSERT @SalesByMonth SELECT 6,'Jun',900
INSERT @SalesByMonth SELECT 7,'Jul',100
INSERT @SalesByMonth SELECT 8,'Aug',400
INSERT @SalesByMonth SELECT 9,'Sep',400
INSERT @SalesByMonth SELECT 10,'Oct',600
INSERT @SalesByMonth SELECT 11,'Nov',900
INSERT @SalesByMonth SELECT 12,'Dec',900
SELECT * FROM @SalesByMonth



Step 2 :
Drag&drop Chart from Toolbox or right-click on report body - > Insert - > Chart .
Add a column chart :






Step 3 :  Double - click on the chart area , you will notice Chart Data , Under Chart Data
for summation Values add sales column from the Dataset ,
again for summation Values add sales column from the Dataset (one for Bar & one for line above the bars) and then for Category Groups add Months column from the Dataset .

Step 4 : Under Chart Data , right-click on Sales 1 (second summation value) - >  Change Chart Type ... - > add Line chart as shown in below images :




 Click on Preview Pane :


For sorting labels on X (horizontal) axis -  http://www.allaboutmssql.com/2013/06/ssrs-in-charts-how-to-sort-labels-on-x.html
For displaying all labels on X (horizontal) axis -  http://www.allaboutmssql.com/2013/06/ssrs-in-charts-how-to-display-all.html

2 comments:

Kris said...

I love this article.

I enjoyed reading this article and tried it worked fine.

Recommend others to read.

Thanks for educating the community and appreciate your volunteer-ship.

Please keep producing as many articles as possible in SSRS.

Thanks a lot

Kris said...

I enjoyed reading this article and recommend others

Practically I tried and works fine.

Thanks for educating the community and appreciate your efforts.

Please keep publishing some more articles on SSRS.

Thanks,
Kris