Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 131
  • Last Modified:

Can't add data labels to data series on secondary axis

Hello,
I've been trying to add data lables to a line data series on a secondary axis via vba.  The labels are not being displayed.  When I try to add the data labels manually, I get the following message, "The maximum number of data labels that can be displayed is 1000.  Some labels will be remitted from the chart"  .  The chart contains only 100 labels. I've attached the pdf file of the chart.

With objNewSeries
            .Name = "Aggregate LIFR (Non-NEX)"
            .Values = objXlDataSheet.Range("F:F")
            .AxisGroup = 2
            .ChartType = 65
            .Format.Line.Weight = 1
           .ApplyDataLabels
         .DataLabels.NumberFormat = "0.0%"
        End With

Open in new window

PDF-File.pdf
0
chtullu135
Asked:
chtullu135
1 Solution
 
Rgonzo1971Commented:
Hi,

maybe you could restrict the range

instead of

.Values = objXlDataSheet.Range("F:F")


.Values = objXlDataSheet.Range(Range("F1"), Range("F" & Cells.Rows.Count).End(xlUp))


Regards
0
 
chtullu135Author Commented:
Thanks that's what I needed.  I just needed to modify the provided code so that it would work using late-binding.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now