all groups > sql server reporting services > september 2004 >
You're in the

sql server reporting services

group:

How to Avoid Label overlaping in Pie Charts


How to Avoid Label overlaping in Pie Charts bala
9/2/2004 7:57:02 PM
sql server reporting services:
Hi, I am totally new to Reporting services.
I currently ran in to this problem, Any help will be appreciated.

I currently have a pie chart with one piece having 95% and the rest 5% is
shared by 5 to 10 peices of the pie chart. Now here when I have label in the
pie chart, The percentage values for these 5-10 peices get overlap.

It is a must for me to display the % some way either as label or in legand

Thanks
Bala

Re: How to Avoid Label overlaping in Pie Charts Robert Bruckner [MSFT]
9/2/2004 10:27:25 PM
In order to hide datapoint labels of very small pie segments (the chart
control does not support non-overlapping data point labels for pie and
doughnut charts), you have to provide a blank string label (" "). Note: NULL
or empty string (="") would not work, because the chart control will
automatically show the datapoint value as label in those cases.
The example below uses an expression to hide labels for pie segments smaller
than 3%:
=iif( Sum(Fields!Sales.Value) / Sum(Fields!Sales.Value,"SalesChart") < 0.03,
" ", Sum(Fields!Sales.Value) / Sum(Fields!Sales.Value,"SalesChart"))

The sample runs against the AdventureWorks2000 sample database.

--
This posting is provided "AS IS" with no warranties, and confers no rights.



<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Matrix Name="matrix1">
<Corner>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</Corner>
<Height>0.5in</Height>
<ZIndex>1</ZIndex>
<Style />
<MatrixRows>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="Sales">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>C</Format>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>Sales</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Sum(Fields!Sales.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.25in</Height>
</MatrixRow>
</MatrixRows>
<MatrixColumns>
<MatrixColumn>
<Width>1.125in</Width>
</MatrixColumn>
</MatrixColumns>
<DataSetName>DataSet1</DataSetName>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<Grouping Name="matrix1_ProdCat">
<GroupExpressions>
<GroupExpression>=Fields!ProdCat.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="ProdCat">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>ProdCat</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!ProdCat.Value</Value>
</Textbox>
</ReportItems>
</DynamicColumns>
<Height>0.25in</Height>
</ColumnGrouping>
</ColumnGroupings>
<Width>3.125in</Width>
<Top>4.5in</Top>
<RowGroupings>
<RowGrouping>
<DynamicRows>
<Grouping Name="matrix1_OrderYear">
<GroupExpressions>
<GroupExpression>=Fields!OrderYear.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="OrderYear">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>OrderYear</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!OrderYear.Value</Value>
</Textbox>
</ReportItems>
</DynamicRows>
<Width>1in</Width>
</RowGrouping>
<RowGrouping>
<DynamicRows>
<Grouping Name="matrix1_OrderQtr">
<GroupExpressions>
<GroupExpression>=Fields!OrderQtr.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="OrderQtr">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>OrderQtr</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!OrderQtr.Value</Value>
</Textbox>
</ReportItems>
</DynamicRows>
<Width>1in</Width>
</RowGrouping>
</RowGroupings>
</Matrix>
<Chart Name="SalesChart">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<Style />
<Legend>
<Visible>true</Visible>
<Style />
<Position>BottomCenter</Position>
<Layout>Table</Layout>
</Legend>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!Sales.Value)</Value>
</DataValue>
</DataValues>
<DataLabel>
<Style>
<Format>P2</Format>
</Style>
<Value>=iif(
Sum(Fields!Sales.Value)/Sum(Fields!Sales.Value,"SalesChart") &lt; 0.03, " ",
AddThis Social Bookmark Button