The Scatter Plot in SSRS is useful to visualize the relationship between any two sets of data. In this article, we will show you, How to create a Scatter Plot in SSRS, How to change the Chart Title, Legend Position, Legend Title, and Font style of a Scatter Plot in SQL Reporting Services with an example.
For this SSRS scatter plot example, we are going to write the Custom SQL Query against the SQL Server Data Source, and the query that we are going to use for this report is:
-- SQL Query that we use in SSRS Scatter Plot SELECT [Carat] ,[Color] ,[Clarity] ,[Depth] ,[PricePerCt] ,[TotalPrice] FROM [Diamonds]
and the Data that it’s going to return is:
Create a Scatter Plot in SSRS
In this example, we are going to create a Scatter Plot to display the Total Price against the Diamond caret. Below screenshot will show you the Data Source, and Dataset that we used for this Scatter Plot Report.
In SSRS report design, we can add a Scatter Plot by dragging the Chart property from the SSRS Toolbox to Design space, or we can simply right-click on the report designer to open the context menu. From the context menu, please select the Insert -> Chart option as we shown below.
Once you select the Chart option, a new window called Select Chart Type will be opened to select the required chart from the available once. For this example, we are selecting a Scatter Plot as shown in below screenshot.
Once you click on Ok button, Scatter Plot will be displayed in the design region with dummy data.
Click on the empty space around the Chart will open the Chart Data window
- Values: Any Numeric (Metric) value such as Total Sales, Sale Amount, Number of Customers, Tax etc. All these values will be aggregated using an aggregate function (Sum, Avg, Count etc). This is because we are grouping them with the category group items.
- Category Group: Please specify the Column name on which you want to partition you the Scatter Plot.
- Series Group: Please specify the Dimension here. This will further group the individual category
Drag and drop the Total Price Metric column from dataset to chart data values, and Carat Dimension to category group.
NOTE: Please be careful when dragging the columns to values region, if you mishandled or dropped in design area will end up in mess.
Click on the Preview tab to see the report preview.
If you observe the above screenshot, It is providing perfect result.
Format Scatter Plot in SSRS
The following list of examples will show you the steps involved in formatting the Scatter Plot in SSRS
Change Axis properties of a Scatter Plot in SSRS
Right click on the Axis of a Scatter Plot, and select the Horizontal Axis Properties.. option from the context menu to format the Axis values.
Here we changed the Font style and font size of the Horizontal Axis.
Next, Right click on the Vertical Axis of an Area Chart, and select the Vertical Axis Properties.. option from the context menu to format the Axis values. Please use the above-specified technique to change the font of the vertical Axis. Next, format the Numbers in the vertical axis by selecting the Number tab.
Change Axis Titles of a Scatter Plot in SSRS
In order to change an Axis title, Please select the Axis title region as we shown in below screenshot, and change the title as per your requirement. OR, right-click on it will open the context menu. Please select the Axis Title properties.. option from the context menu as shown below.
This will open a new window called the Axis Title Properties window. Under the General section, we can change the Title text as per our requirements. For now, we are changing it to Carat
Under the Font tab, we can change the Font style, size, and colour of an Axis title. For now, we are changing the Color to Dark Green, Font to Century Gothic, Size to 12pt, and style to Bold
Please apply the same properties to Y-Axis as well. Once you are done, Click on the Preview tab to see the report preview.
Change SSRS Scatter Plot Title
To change the title of a Scatter Plot, Please select the Chart title region as we shown in below screenshot, and change the title as per your requirement. OR, right-click on it will open the context menu. Please select the Title properties.. option from the context menu as shown below.
Here we are changing the title as SSRS Scatter Plot Example because the report is displaying the same
Format SSRS Scatter Plot Title Font
Within the Font tab, we can change the Font Size, Font Family, Font Style and Color of a Scatter Plot Title. Here we are changing the Font to Century Gothic, Font size to 14pt, and colour to Dark Green as shown in below screenshot
Format Legend of a Scatter Plot in SSRS
To format the Scatter Plot Legend region, Please Select the Legend region and right-click on it will open the context menu. From the menu, please select the Legend Properties option.
This will open a new window called the 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 leaving its position as it is.
Next, Under the Font tab, we can change the Font style, size, and colour of a Legend. For now, we are changing the Font to Century Gothic, and Size to 9pt
Click OK button to close the Properties window, and hit the preview tab to see the report preview
Right click on the Marker will open the context menu. Please select the Series Properties from that context menu.
Once you click on the Series properties option, a new window called Series properties will be opened up as we shown below.
Under the Markers tab, we can change the Marker Type, Color, Size, Border width, and Border Color. First, let me change the shape from Auto to Diamond
Let me change the Color to Maroon, and size to 5pt
From the report preview, you can see that, we successfully changed the Marker Shape, size, and colour
You have an option to add one more dimension to the Series group to further divide the Scatter plot markers. For now, we are adding Color to the Series group
Next, we are changing the Marker size to 5pt(default 3.5pt) and kept the colour to Automatic
Let me show you the report preview
As you can see that the report is showing the perfect result perhaps it would be nice if I change the default Color combinations to more meaningful output. For this let me go to the series properties (as I explained above) and click on the expression button under the Make Color property
Let me change the Color from Automatic to Color Dimension filed
Click on the preview tab to see the report preview
From the above screenshot, you can observe that We successfully changed the Color of a Scatter Plot using the Color Dimension.
Thank You for Visiting Our Blog