In this article , let us see an example for creating SSRS PIE chart .
Let us try to create Pie chart like in MSDN forum users profile .
Drag & drop , Pie chart on to the report body :
From Toolbox - > Report Items - > Chart - > Shape - > Pie
or Under Design pane - > right click on report body - > Insert - > Chart - > Shape - > Pie
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8aRuyebKxFznReLMul5k939-kAXmrat_2Xj_LWHWQjTQqayeiTLcgHXSoo_dlcfPvsna53Jw2lLLLVP8LMOeGjqlaSkkw5Pev4XtWzQMQ1jDz8NS25HXSwebikJffDR-2ZwXHFIjJd0L/s640/pi1.JPG)
Create Dataset with below sample query :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMQvjpO1xSSWZJ_XlO4pdWU9D44bef-Nfo57reEoggIWhg6Xa_R-rWY1dD3bLBIPRgeTs0wLrSCaJix1luscfoxUUxpXI-10KDAMhg9m5v068GehKZTV-7LrsgXR0xSiBvopCXdgTmAd8r/s640/pi1.1.JPG)
Click on the any corner of the chart area - > Chart Data - > Assign Fields from the Dataset .
Edit the Chart title with appropriate title .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicDIAprXEQKE-w30XcY_gxJ5QJ6KGmQJPNSRVpKHjuWYHcvsqYujDR1Xh1yAO-3q-IIUZKYdy3Dj4YW8aCppF0aLUa_ITZeOGG4MpS6JOW2y0nBjH_esbwXi3fuX9vSH4c1lqMxqPLN7S8/s640/pi2.JPG)
If we preview the report , it will look like as shown below :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwrVEhgVkS91D-VnGMrrv4MH35NbKpR-HtKuXmjr8cCMrDYzyNS1vS0fegBF5OuSCw0pecUwHeXIb6lSRpiKMorfC7rR6GVEfaphtOQ2FDJkVOu-NNA3YktDNE1uMo22e8jmL3Pwp3C8U4/s640/pi3.JPG)
Click on the Legend - > right-click - > Legend properties ... - >
If you want to adjust anything (Position , Font or Visibility etc ..) .
Click on the Pie chart - > Press F4 - > Properties and then set the Data labels visibility and Tooltip options .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEvzU8wjYb2-vGjGEnCFcvqLkMg_rmLZqZpFs4hES4pQVnCaffPuILQGUQAfK_P_FBmwVOVAGxntFHRuty3zpVHYDX6qCR4RGcD5mvfapxHZXGjVVan1ZoecaabzB1e_c2PwqkoyRITn8L/s640/pi4.JPG)
If you want to sort the sections of Pie chart , Under Chart Data - > Category Groups - >
Category Group Properties .. - > Sorting - >
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4FpWabTF3Z1lcLzC5QcVEbh36aCOy0LNgtlATb4zZGxVtHDSloRVqHOzuw-GsMKDOKZTb4lGEYMeirvU-hHrl1NKNXuPbT2tO5xBpQ2wTenaxBR191tAZ-8R2y-b0YF07NzPrHZPn0pQr/s640/pi5.JPG)
If you want to format color for each sections of Pie chart - > click on chart - > right-click
-> Series Properties ... - > Fill - > Color and then write expression like this :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8rrmkXeYlZdGTiy6hyphenhyphenQRvr_WK6dj4mucCzUAQgcZ27-zF37jIU38bMCBUh5BK_mzoHW5BYKJaTBK0e-suvHLeRMp33s2kPhESEl_eQCJCge13w5n7qLH4auqcQytXO6NaRbOtzmSCNvL2/s640/pi6.JPG)
If we preview the report , it will look like as shown below :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6OuPyKl4YxtPY0PGvvhBCbH6pPLt8Dv-yBAKKtSu7Srxp07mxGUpS3MKRc1w9AlOpmbXRmZLUDg6UtQa1ke-lEbIFRb7B_OA3ef6mFl03wAxR1mb-UMyLCO_ox1xm6ZOl9RQhwdEBumo3/s640/pi7.JPG)
Let us try to create Pie chart like in MSDN forum users profile .
Drag & drop , Pie chart on to the report body :
From Toolbox - > Report Items - > Chart - > Shape - > Pie
or Under Design pane - > right click on report body - > Insert - > Chart - > Shape - > Pie
Create Dataset with below sample query :
DECLARE @tmp TABLE (Activities VARCHAR(50),Cnt INT,Sort TINYINT) INSERT @tmp SELECT 'Galleries' , 700 , 1 INSERT @tmp SELECT 'TechNet Wiki' , 250 , 2 INSERT @tmp SELECT 'Blogs' , 200 , 3 INSERT @tmp SELECT 'Forums' , 2500 , 4 INSERT @tmp SELECT 'Translation' , 100 , 5 SELECT * FROM @tmp
Click on the any corner of the chart area - > Chart Data - > Assign Fields from the Dataset .
Edit the Chart title with appropriate title .
If we preview the report , it will look like as shown below :
Click on the Legend - > right-click - > Legend properties ... - >
If you want to adjust anything (Position , Font or Visibility etc ..) .
Click on the Pie chart - > Press F4 - > Properties and then set the Data labels visibility and Tooltip options .
If you want to sort the sections of Pie chart , Under Chart Data - > Category Groups - >
Category Group Properties .. - > Sorting - >
If you want to format color for each sections of Pie chart - > click on chart - > right-click
-> Series Properties ... - > Fill - > Color and then write expression like this :
=Switch(Fields!Activities.Value = "Galleries" , "#0010A5" , Fields!Activities.Value = "TechNet Wiki" , "#FEC500" , Fields!Activities.Value = "Blogs" , "#FF0000" , Fields!Activities.Value = "Forums" , "#0FAD00" , Fields!Activities.Value = "Translation" , "#6300A5")
If we preview the report , it will look like as shown below :
No comments:
Post a Comment