Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 3418f27

Browse files
authored
Merge pull request #3516 from ktoliver/tree-map-and-sunburst-charts-in-reporting-services
edit pass: tree-map-and-sunburst-charts-in-reporting-services.md
2 parents b5b7f15 + 60f0930 commit 3418f27

1 file changed

Lines changed: 82 additions & 81 deletions

File tree

Lines changed: 82 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tree Map and Sunburst Charts in Reporting Services | Microsoft Docs"
2+
title: "Treemap and sunburst charts in SQL Server Reporting Services | Microsoft Docs"
33
ms.custom:
44
- "SQL2016_New_Updated"
55
ms.date: "08/31/2015"
@@ -16,134 +16,136 @@ author: "maggiesMSFT"
1616
ms.author: "maggies"
1717
manager: "erikre"
1818
---
19-
# Tree Map and Sunburst Charts in Reporting Services
19+
# Treemap and sunburst charts in Reporting Services
2020
[!INCLUDE[feedback_stackoverflow_msdn_connect_md](../../includes/feedback-stackoverflow-msdn-connect-md.md)]
2121

22-
The [!INCLUDE[ssRSnoversion](../../includes/ssrsnoversion-md.md)] Tree Map and sunburst visualizations are great for visually representing hierarchal data. This topic is an overview of how to add a Tree Map or Sunburst chart to a [!INCLUDE[ssRSnoversion](../../includes/ssrsnoversion-md.md)] report. The topic also includes a sample Adventureworks query to help get you started.
22+
The SQL Server [!INCLUDE[ssRSnoversion](../../includes/ssrsnoversion-md.md)] treemap and sunburst visualizations are great for visually representing hierarchical data. This article is an overview of how to add a treemap or sunburst chart to a [!INCLUDE[ssRSnoversion](../../includes/ssrsnoversion-md.md)] report. The article also includes an AdventureWorks sample query to help you get started.
2323

24-
## <a name="bkmk_treemap_chart"></a> Tree Map Chart
25-
![ssrs_treemap_icon](../../reporting-services/media/ssrs-treemap-icon.png "ssrs_treemap_icon")
26-
27-
A tree map chart divides the chart area into rectangles that represent the different levels and relative sizes of the data hierarchy. The map is similar to branches on a tree that start with a trunk and divide into smaller and smaller branches. Each rectangle is broken into smaller rectangles representing the next level in the hierarchy. The top level tree map rectangles are arranged with the largest rectangle in the upper left corner of the chart to the smallest rectangle in the lower right corner. Within a rectangle, the next level of the higher is also arranged with rectangles from the upper left to the lower right.
28-
29-
For example, in the following image of the sample tree map, the Southwest territory is the largest and Germany is the smallest. Within the Southwest, Road Bikes are larger than Mountain Bikes.
30-
31-
![ssrs_treemap_example](../../reporting-services/report-design/media/ssrs-treemap-example.png "ssrs_treemap_example")
24+
## <a name="bkmk_treemap_chart"></a> Treemap chart
25+
26+
A treemap chart divides the chart area into rectangles that represent the different levels and relative sizes of the data hierarchy. The map is similar to branches on a tree that start with a trunk and divide into smaller and smaller branches. Each rectangle is broken into smaller rectangles that represent the next level in the hierarchy. The top-level treemap rectangles are arranged with the largest rectangle in the upper left corner of the chart to the smallest rectangle in the lower right corner. Within a rectangle, the next level of the higher is also arranged with rectangles from the upper left to the lower right.
27+
28+
For example, in the following image of the sample treemap, the Southwest territory is the largest and Germany is the smallest. Within the Southwest, Road Bikes are larger than Mountain Bikes.
29+
30+
![ssrs_treemap_example](../../reporting-services/report-design/media/ssrs-treemap-example.png "ssrs_treemap_example")
3231

33-
### To insert a tree map chart and configure for the sample Adventureworks data
32+
### To insert a treemap chart and set up the sample AdventureWorks data
3433

35-
[!NOTE] Before you add a chart to your report, create a data source and dataset. For sample data and a sample query, see the section [Sample Adventureworks data](#bkmk_sample_data) in this topic.
36-
37-
1. Right-click the design surface, click **Insert**, and then click **Chart** .
34+
> [!NOTE]
35+
> Before you add a chart to your report, create a data source and dataset. For sample data and a sample query, see [Sample AdventureWorks data](#bkmk_sample_data).
3836
39-
Select Tree Map ![ssrs_treemap_icon](../../reporting-services/media/ssrs-treemap-icon.png "ssrs_treemap_icon").
40-
41-
![ssrs_insert_treemap_sunburst](../../reporting-services/report-design/media/ssrs-insert-treemap-sunburst.png "ssrs_insert_treemap_sunburst")
42-
43-
2. Reposition and resize the chart. For use with the sample data, a chart that is 5 inches wide is a good start.
37+
1. Right-click the design surface, then select **Insert** > **Chart**. Select the **Treemap** icon.
38+
39+
![ssrs_treemap_icon](../../reporting-services/media/ssrs-treemap-icon.png "ssrs_treemap_icon")
40+
41+
2. Reposition and resize the chart. To use with the sample data, a chart that is 5 inches wide is a good start.
4442

4543
3. Add the following fields from the sample data:
4644

47-
|||
48-
|-|-|
49-
|![ssrs_treemap_example_properties](../../reporting-services/report-design/media/ssrs-treemap-example-properties.png "ssrs_treemap_example_properties")|**Values:** LineTotal<br /><br /> **Category Groups:** Add them in the order of:<br /><br /> 1) CategoryName<br /><br /> 2) SubcategoryName<br /><br /> **Series Groups:** TerritoryName|
45+
* **Values**: LineTotal
46+
* **Category Groups** (in the following order):
47+
1. CategoryName
48+
2. SubcategoryName
49+
* **Series Groups**: TerritoryName
50+
51+
![ssrs_treemap_example_properties](../../reporting-services/report-design/media/ssrs-treemap-example-properties.png "ssrs_treemap_example_properties")
5052

51-
4. To optimize the page size for general shape of a Tree Map, set the legend position to the bottom.
53+
4. To optimize the page size for the general shape of a treemap, set the legend position to the bottom.
5254

53-
5. To add tool tips that display the subcategory and the line total, right-click **LineTotal** and then click **Series Properties**.
55+
5. To add tooltips that display the subcategory and the line total, right-click **LineTotal**, and then select **Series Properties**.
5456

5557
![ssrs_visualization_seriesproperties](../../reporting-services/report-design/media/ssrs-visualization-seriesproperties.png "ssrs_visualization_seriesproperties")
5658

57-
Set the **Tooltip** property to the following:
59+
Set the **Tooltip** property to the following value:
5860

5961
```
6062
=Fields!SubcategoryName.Value &": " &Format(Sum(Fields!LineTotal.Value),"C")
6163
```
6264
63-
For more information, see [Show ToolTips on a Series &#40;Report Builder and SSRS&#41;](../../reporting-services/report-design/show-tooltips-on-a-series-report-builder-and-ssrs.md).
65+
For more information, see [Show ToolTips on a series &#40;Report Builder and SSRS&#41;](../../reporting-services/report-design/show-tooltips-on-a-series-report-builder-and-ssrs.md).
6466
65-
6. Change the default chart title to "Categorized Sales by Territory".
67+
6. Change the default chart title to **Categorized Sales by Territory**.
6668
67-
7. The number of label values that are displayed are affected by the size of the font, the size of the overall chart area, and the size of specific rectangles. To see more of the labels, change the Label font property of LineTotal to 10pt instead of the default 8pt.
69+
7. The number of label values that are displayed are affected by the size of the font, the size of the overall chart area, and the size of specific rectangles. To see more labels, change the **Label Font** property of **LineTotal** to **10pt** from the default of **8pt**.
6870
6971
70-
## <a name="bkmk_sunburst_chart"></a> Sunburst Chart
71-
![ssrs_sunburst_icon](../../reporting-services/media/ssrs-sunburst-icon.png "ssrs_sunburst_icon")
72+
## <a name="bkmk_sunburst_chart"></a> Sunburst chart
73+
74+
In a sunburst chart, the hierarchy is represented by a series of circles. The highest level of the hierarchy is in the center, and lower levels of the hierarchy are rings displayed outside the center. The lowest level of the hierarchy is the outside ring.
7275
73-
In a sunburst chart, the hierarchy is represented by a series of circles, with the highest level of the hierarchy in the center and lower levels of the hierarchy as rings displayed outside the center. The lowest level of the hierarchy is the outside ring.
76+
![ssrs_sunburst_example](../../reporting-services/report-design/media/ssrs-sunburst-example.png "ssrs_sunburst_example")
7477
75-
![ssrs_sunburst_example](../../reporting-services/report-design/media/ssrs-sunburst-example.png "ssrs_sunburst_example")
78+
### To insert a sunburst chart and set up the sample AdventureWorks data
79+
> [!NOTE]
80+
> Before you add a chart to your report, create a data source and dataset. For sample data and a sample query, see [Sample AdventureWorks data](#bkmk_sample_data).
7681
77-
### To insert a sunburst chart and configure for the sample Adventureworks data
78-
[!NOTE] Before you add a chart to your report, create a data source and dataset. For sample data and a sample query, see the section [Sample Adventureworks data](#bkmk_sample_data) in this topic.
82+
1. Right-click the design surface, and then select **Insert** > **Chart**. Select the **Sunburst** icon.
83+
84+
![ssrs_sunburst_icon](../../reporting-services/media/ssrs-sunburst-icon.png "ssrs_sunburst_icon")
7985
80-
1. Right-click the design surface, click **Insert**, and then click **Chart** .
81-
82-
Select Sunburst ![ssrs_treemap_icon](../../reporting-services/media/ssrs-treemap-icon.png "ssrs_treemap_icon").
83-
84-
![ssrs_insert_treemap_sunburst](../../reporting-services/report-design/media/ssrs-insert-treemap-sunburst.png "ssrs_insert_treemap_sunburst")
85-
86-
2. Reposition and resize the chart. For use with the sample data., a chart that is 5 inches wide is a good start.
86+
2. Reposition and resize the chart. To use with the sample data, a chart that is 5 inches wide is a good start.
8787
8888
3. Add the following fields from the sample data:
89+
90+
* **Values**: LineTotal
91+
* **Category Groups** (in the following order):
92+
1. CategoryName
93+
2. SubcategoryName
94+
3. SalesReasonName
95+
* **Series Groups**: TerritoryName
96+
97+
![ssrs_treemap_example_properties](../../reporting-services/report-design/media/ssrs-treemap-example-properties.png "ssrs_treemap_example_properties")
8998
90-
|||
91-
|-|-|
92-
|![ssrs_treemap_example_properties](../../reporting-services/report-design/media/ssrs-treemap-example-properties.png "ssrs_treemap_example_properties")|**Values:** LineTotal<br /><br /> **Category Groups:** Add them in the order of :<br /><br /> 1) CategoryName<br /><br /> 2) SubcategoryName,<br /><br /> 3) SalesReasonName<br /><br /> **Series Groups:** TerritoryName .|
93-
94-
4. To optimize the page size for the general shape of a Sunburst, set the legend position to the bottom.
99+
4. To optimize the page size for the general shape of a sunburst chart, set the legend position to the bottom.
95100
96-
5. Change the default chart title to "Categorized Sales by Territory, with sales reason".
101+
5. Change the default chart title to **Categorized Sales by Territory, with sales reason**.
97102
98-
6.
99-
|||
100-
|-|-|
101-
|![ssrs_sunburst_linetotalproperties](../../reporting-services/report-design/media/ssrs-sunburst-linetotalproperties.png "ssrs_sunburst_linetotalproperties")|To add the values of the category groups to the sunburst as labels, set the label property **Visible** = true and the **UseValueAsLabel**=False.<br /><br /> The label values that are displayed are affected by the size of the font, the size of the overall chart area, and the size of specific rectangles. To see more of the labels, change the Label font property of LineTotal to 8pt instead of the default 10pt.|
103+
6. To add the values of the category groups to the sunburst as labels, set the label properties **Visible=true** and **UseValueAsLabel=false**.<br /><br /> The label values that are displayed are affected by the size of the font, the size of the overall chart area, and the size of specific rectangles. To see more labels, change the **Label Font** property of **LineTotal** to **10pt** from the default of **8pt**.
104+
105+
![ssrs_sunburst_linetotalproperties](../../reporting-services/report-design/media/ssrs-sunburst-linetotalproperties.png "ssrs_sunburst_linetotalproperties")
102106
103107
7. If you want a different range of colors, change the chart **Palette** property.
104-
105-
108+
106109
![ssrs_visualization_palette](../../reporting-services/report-design/media/ssrs-visualization-palette.png "ssrs_visualization_palette")
107110
108111
109-
## <a name="bkmk_sample_data"></a> Sample Adventureworks data
110-
This sections includes a sample query and the basic steps for creating a data source and dataset in [!INCLUDE[ssRBnoversion](../../includes/ssrbnoversion-md.md)]. If your report already contains a data source and dataset you can skip this section.
112+
## <a name="bkmk_sample_data"></a> Sample AdventureWorks data
113+
This section includes a sample query and the basic steps for creating a data source and dataset in [!INCLUDE[ssRBnoversion](../../includes/ssrbnoversion-md.md)]. If your report already contains a data source and dataset, you can skip this section.
111114
112-
The query returns Adventureworks sales order detail data with sales territory, product category, product sub category, and sales reason data.
115+
The query returns AdventureWorks sales order detail data with sales territory, product category, product subcategory, and sales reason data.
113116
114-
1. **Get the Data:**
117+
1. **Get the data**.
115118
116-
The query in this section is based on the Adventureworks database which is available for download from [Adventure Works 2014 Full Database Backup](https://msftdbprodsamples.codeplex.com/releases/view/125550).
119+
The query in this section is based on the AdventureWorks database, which is available for download from GitHub: [AdventureWorks 2016 full database backup](https://github.com/Microsoft/sql-server-samples/releases).
117120
118-
For more information on how to install the database, see [How to install Adventure Works 2014 Sample Databases.pdf](https://msftdbprodsamples.codeplex.com/releases/view/125550).
119121
120-
2. **Create a data source:**
122+
2. **Create a data source**.
121123
122-
1. In the **Report Data** pane, right-click **Data Sources** and click **Add data source**.
124+
1. Under **Report Data**, right-click **Data Sources**, and then select **Add data source**.
123125
124126
2. Select **Use a connection embedded in my report**.
125127
126-
3. Select the connection type of **Microsoft SQL Server**.
128+
3. For connection type, select **Microsoft SQL Server**.
127129
128-
4. Type in the connection string to your server and database, for example the following:
130+
4. Enter the connection string to your server and database. For example:
129131
130132
```
131-
Data Source=[server name];Initial Catalog=AdventureWorks2014
133+
Data Source=[server name];Initial Catalog=AdventureWorks2016
132134
```
133135
134-
5. It is a good idea to verify with the **Test Connection** button and then click **OK**.
136+
5. To verify the connection, select the **Test Connection** button, and then select **OK**.
135137
136-
For more information on creating a data source, see [Add and Verify a Data Connection &#40;Report Builder and SSRS&#41;](../../reporting-services/report-data/add-and-verify-a-data-connection-report-builder-and-ssrs.md)..
138+
For more information about creating a data source, see [Add and verify a data connection &#40;Report Builder and SSRS&#41;](../../reporting-services/report-data/add-and-verify-a-data-connection-report-builder-and-ssrs.md).
137139
138-
3. **Create a dataset:**
140+
3. **Create a dataset**.
139141
140-
- In the **Report Data** pane, right-click **Datasets** and click **Add dataset**.
142+
1. Under **Report Data**, right-click **Datasets**, and then select **Add dataset**.
141143
142-
- Select **Use a dataset embedded in my report**.
144+
2. Select **Use a dataset embedded in my report**.
143145
144-
- Select the data source you created in the previous steps.
146+
3. Select the data source that you created.
145147
146-
- Select the **Text** query type and then copy and paste the following query into the **Query:** text box:
148+
4. Select the **Text** query type, and then copy and paste the following query into the **Query** text box:
147149
148150
```
149151
SELECT Sales.SalesOrderHeader.SalesOrderID, Sales.SalesOrderHeader.OrderDate, Sales.SalesOrderDetail.SalesOrderDetailID, Sales.SalesOrderDetail.ProductID, Sales.SalesOrderDetail.LineTotal,
@@ -168,17 +170,16 @@ manager: "erikre"
168170
Sales.SalesOrderHeaderSalesReason.SalesReasonID = Sales.SalesReason.SalesReasonID
169171
```
170172
171-
- Click **OK**.
172-
173-
For more information on creating a dataset, see [Create a Shared Dataset or Embedded Dataset &#40;Report Builder and SSRS&#41;](../../reporting-services/report-data/create-a-shared-dataset-or-embedded-dataset-report-builder-and-ssrs.md).
174-
173+
5. Select **OK**.
175174
176-
## See Also
177-
[Shared Dataset Design View &#40;Report Builder&#41;](../../reporting-services/report-builder/shared-dataset-design-view-report-builder.md)
178-
[Show ToolTips on a Series &#40;Report Builder and SSRS&#41;](../../reporting-services/report-design/show-tooltips-on-a-series-report-builder-and-ssrs.md)
179-
[Tutorial: Treemaps in Power BI](https://support.powerbi.com/knowledgebase/articles/556200-tutorial-treemaps-in-power-bi)
180-
[Treemap: Microsoft Research Data Visualization Apps for Office](http://research.microsoft.com/en-us/projects/msrdatavis/treemap.aspx)
175+
For more information about creating a dataset, see [Create a shared dataset or embedded dataset &#40;Report Builder and SSRS&#41;](../../reporting-services/report-data/create-a-shared-dataset-or-embedded-dataset-report-builder-and-ssrs.md).
181176
182177
178+
## See also
179+
* [Shared dataset design view &#40;Report Builder&#41;](../../reporting-services/report-builder/shared-dataset-design-view-report-builder.md)
180+
* [Show ToolTips on a series &#40;Report Builder and SSRS&#41;](../../reporting-services/report-design/show-tooltips-on-a-series-report-builder-and-ssrs.md)
181+
* [Tutorial: Treemaps in Power BI](https://support.powerbi.com/knowledgebase/articles/556200-tutorial-treemaps-in-power-bi)
182+
* [Treemap: Microsoft Research Data Visualization Apps for Office](http://research.microsoft.com/en-us/projects/msrdatavis/treemap.aspx)
183+
<br>
183184
[!INCLUDE[feedback_stackoverflow_msdn_connect_md](../../includes/feedback-stackoverflow-msdn-connect-md.md)]
184185

0 commit comments

Comments
 (0)