Link to home
Start Free TrialLog in
Avatar of patd1
patd1Flag for United States of America

asked on

formatting data labels on a line graph

please see my sample image attached. The data labels (shown with red arrow pointers) need to be formatted with commas, but i can't find where to set it. I could set the formatting of numbers on y axis and dates on x axis, but don't know where to set data label formatting.

Please help.

Thanks.
sample-chart.png
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Click one of the labels on the chart.  Now you'll see something like Chart Series Labels selected in the Properties window.  Hit F4 in case you don't see the Properties window.

With the Chart Series Labels selected, one of the properties is called Format.  Enter a valid format in there, such as #,0

For more options, please refer to this article: Formatting Numbers [SSRS]
Avatar of patd1

ASKER

When I am in design mode, i din't see the the labels or the line. I just see a blank chart area. The line and labels appear when i do preview.

Ho do I see graph line and labels in the design view?

Thanks for your help.
I can see the line while in design mode.  Same with the labels.  How did you activate the labels if you're not seeing that line?  By default these are not shown and you need to activate them by right-clicking on the line...

What version of SSRS are you using?  Have you got the latest service packs for both Visual Studio and SQL Server installed?  You are actually using VS (BIDS) to design the report, right?  Ow, and that's a regular Line chart, right?
Avatar of patd1

ASKER

I am using Visual studio 2010 sp1, and  .net version 4.0 on SQ Server 2008 R2.

Can you suggest adding format of data label numbers in the code copied below. I use
<Style >
      <Format>n0</format> 
 </Style> 

Open in new window

for y axis, and it displays my numbers in the correct format(ex: 1,231,345), but when I added this code to Data Labels, it still shows the numbers without commas.

 <ChartData>
          <ChartSeriesCollection>
            <ChartSeries Name="unique_customer_count">
              <ChartDataPoints>
                <ChartDataPoint>
                  <ChartDataPointValues>
                    <Y>=Fields!unique_customer_count.Value</Y>
                  </ChartDataPointValues>
                  <ChartDataLabel>
                    <Style>
                      <FontSize>7pt</FontSize>
                      <FontWeight>Normal</FontWeight>
                    </Style>
                    <UseValueAsLabel>true</UseValueAsLabel>
                    <Visible>true</Visible>
                  </ChartDataLabel>
                  <Style />
                  <ChartMarker>
                    <Type>Diamond</Type>
                    <Style>
                      <Color>Tomato</Color>
                     <Format>n0</format>  --tried this but didn't help,
                    </Style>
                  </ChartMarker>
                  <DataElementOutput>Output</DataElementOutput>
                </ChartDataPoint>
              </ChartDataPoints>
              <Type>Line</Type>
              <Subtype>Smooth</Subtype>
              <Style />
              <ChartEmptyPoints>
              <Style/>               
                <ChartMarker>                 
                   <Style >
                    <Format>n0</format>  --tried this but didn't help,
                </Style>
                </ChartMarker>
                <ChartDataLabel>
                  <Style >
                    <Format>n0</format>  --tried this but didn't help,
                </Style>
                  <Position>Top</Position>
                </ChartDataLabel>
              </ChartEmptyPoints>
              <ValueAxisName>Primary</ValueAxisName>
              <CategoryAxisName>Primary</CategoryAxisName>
              <ChartSmartLabel>
                <CalloutLineColor>Black</CalloutLineColor>
                <MinMovingDistance>0pt</MinMovingDistance>
              </ChartSmartLabel>
            </ChartSeries>
          </ChartSeriesCollection>
        </ChartData>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ValentinoV
ValentinoV
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of patd1

ASKER

Thanks. That worked.